Skip to content

ci: Make "Build and test wheels" fail when a wheel job fails - #1108

Open
kiri11 wants to merge 1 commit into
bloomberg:mainfrom
kiri11:release-gate
Open

kiri11 wants to merge 1 commit into
bloomberg:mainfrom
kiri11:release-gate

Conversation

@kiri11

@kiri11 kiri11 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Problem

"Build and test wheels" succeeds even when wheel jobs fail. It is a
required check, so PRs can merge with failing wheel builds or tests. And
upload_pypi only waits for it, so a release with a failed wheel job
would still publish to PyPI, just without that platform's wheels.

Context

#516 made upload_pypi depend on "Build and test wheels" on purpose, so
that one job means "all wheels built and tested" for both the required
check and publishing. Back then, a failed wheel job made that job skip,
and upload_pypi skipped with it.

58adb86 (#670) made the job always run so that the required check could
fail. But its if: "!success()" step only sees earlier steps of the same
job, not needs, so the step never runs. The job always succeeds, and
publishing is no longer gated on the wheel jobs.

Changes

Fail the job when any wheel job failed, was cancelled, or was skipped.
The wheel jobs are only skipped when a job before them fails, such as
build_sdist.

Alternative

Make upload_pypi depend on the wheel jobs directly instead:

    needs: [build_linux_wheels, build_macosx_wheels, build_sdist]

That only fixes releases. The required check would keep passing, so PRs
could still merge while wheel jobs fail, but flaky wheel failures
wouldn't block them.

@codecov-commenter

codecov-commenter commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.38%. Comparing base (bc9b7bc) to head (eb7b36c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1108   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files         103      103           
  Lines       13506    13506           
  Branches      483      483           
=======================================
  Hits        12478    12478           
  Misses       1028     1028           
Flag Coverage Δ
cpp 92.38% <ø> (ø)
python_and_cython 92.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@godlygeek

godlygeek commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Alternative

Keep upload_pypi depending on "Build and test wheels" and fix the
job's condition instead:

      - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')

That matches the original design and also makes the required check
honest. But PRs could then not merge while any wheel job fails, flaky
failures included.

That's definitely what we should be doing instead. If the "Build and test wheels" job is succeeding despite one of its dependencies failing (or being cancelled), that's the problem we should be fixing. The whole point of that job is to let us block PRs from merging if testing any of the wheels failed!

The job always succeeded: in a step, success() only checks earlier steps
of the same job, not the jobs in needs. So the required check passed
even when wheel jobs failed, and a release with a failed wheel job would
still publish to PyPI. Fail when any wheel job fails, is cancelled, or
is skipped because a job before it failed.

Signed-off-by: Kirill Ignatev <kignatev@bloomberg.net>
@kiri11 kiri11 changed the title ci: Publish to PyPI only if every wheel job succeeds ci: Make "Build and test wheels" fail when a wheel job fails Nov 25, 2026

@godlygeek godlygeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kiri11
kiri11 marked this pull request as ready for review November 25, 2026 23:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants