Skip to content

[DEVOPS-12319] Only publish to PyPI and GHCR after a successful build - #2099

Merged
abacchilb merged 1 commit into
developfrom
ab/DEVOPS-12319-gate-publish-on-build
Nov 3, 2026
Merged

abacchilb merged 1 commit into
developfrom
ab/DEVOPS-12319-gate-publish-on-build

Conversation

@abacchilb

@abacchilb abacchilb commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Follow-up to #2098, found while dry-running the new release flow in a fork. Jira: DEVOPS-12319.

Bug

pypi-publish and container-publish run when test-build succeeded or was skipped. When build is skipped or fails, test-build is skipped too, so both jobs still run.

Since #2098, build is skipped whenever check-draft-release fails, for example when a maintainer publishes the release by hand instead of leaving it a draft. In that case:

  • pypi-publish fails harmlessly, because there is no build artifact to download.
  • container-publish does not need the build artifact. It rebuilds the image from the tag and pushes ghcr.io/labelbox/labelbox-python:latest and :<tag>, even though the run failed its release check.

The same was already true before #2098 whenever build itself failed.

Fix

Both jobs now also require needs.build.result == 'success'.

Testing

Dry run in a fork (abacchilb/labelbox-python, temporary; it will be deleted) with Immutable Releases on, the PyPI upload replaced by a no-op and the container jobs removed:

  • Before the fix, a run against an already-published release failed at check-draft-release as intended, but pypi-publish still ran.
  • After the fix, the same run skips every job after check-draft-release.
  • A full run with the fix still publishes: every job passes, and the release ends up published and immutable with the wheel, sdist and multiple.intoto.jsonl.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

🤖 Generated with Claude Code

When build is skipped or fails, test-build is skipped too, and the
'success or skipped' check let pypi-publish and container-publish run
anyway. Since #2098, build is skipped whenever check-draft-release fails,
so a run against an already-published release would still have pushed the
container image to ghcr.io (:latest and :<tag>). Found in a dry run of the
release flow in a fork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abacchilb
abacchilb merged commit 4eb25aa into develop Nov 3, 2026
10 checks passed
@abacchilb
abacchilb deleted the ab/DEVOPS-12319-gate-publish-on-build branch November 3, 2026 14:46

This branch was successfully deployed

1 active deployment
Test-PyPI — 5fedc5de Deployed Nov 3, 2026 by abacchilb via test-pypi #2577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants