Skip to content

ci: publish release backfills via release workflow#73

Merged
justin-layerv merged 1 commit into
mainfrom
justin/backfill-pypi-release
Jun 6, 2026
Merged

ci: publish release backfills via release workflow#73
justin-layerv merged 1 commit into
mainfrom
justin/backfill-pypi-release

Conversation

@justin-layerv

Copy link
Copy Markdown
Collaborator

Summary

  • add a manual backfill trigger to the existing Release Please workflow
  • build the requested release ref for both test and publish jobs during manual dispatch
  • remove the separate Publish PyPI workflow because PyPI trusted publishing rejected that workflow identity

Business relevance

This keeps the Python SDK publish identity aligned with the existing PyPI trusted publisher and unblocks publishing the already-created v0.2.0 release.

Validation

  • git diff --check
  • parsed workflow YAML locally
  • observed Publish PyPI workflow rejection from PyPI with workflow_ref .github/workflows/publish-pypi.yml

@claude

claude Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review: ci: publish release backfills via release workflow

Nice consolidation. Folding the manual backfill into the release workflow removes a duplicate identity and — importantly — means a manually dispatched ref now passes through the test matrix before publishing, which the standalone publish-pypi.yml skipped entirely. The conditional logic is also handled correctly:

  • release-please is gated to push so it doesn't run a no-op on dispatch.
  • test/publish use always() && (...) so they still evaluate when release-please is skipped on dispatch.
  • The github.event_name == 'workflow_dispatch' && inputs.ref || github.sha ternary is safe here because ref is required: true (can't be empty and silently fall through to github.sha).

A few things worth considering:

Security — arbitrary ref → PyPI (please confirm)

workflow_dispatch accepts any git ref in inputs.ref, and the publish job carries id-token: write against the trusted publisher. That means anyone able to trigger this workflow can build and publish an arbitrary branch/commit to PyPI as layerv-qurl. This isn't a regression (the deleted workflow had the same exposure), but now is a good moment to confirm the pypi environment has required reviewers / a deployment protection rule configured. Without that, the test gate is the only thing standing between an arbitrary ref and a real PyPI release. The environment protection is the right place to enforce this, not the workflow.

Stale hardcoded default

default: v0.2.0 (and the matching description "build and publish") will go stale the moment v0.2.0 ships — a future operator could dispatch and accidentally re-attempt 0.2.0. Since the input is required: true, consider dropping the default (force an explicit choice) rather than pinning it to a one-time backfill value.

No concurrency guard (minor)

There's no concurrency: block, so a push to main that creates a release and a simultaneous manual dispatch could both reach publish. PyPI rejects duplicate file uploads so the blast radius is "one job fails," but a concurrency: { group: publish-${{ inputs.ref || github.sha }} } would make this tidier.

Idempotency on re-run (minor)

If a backfill is dispatched for a version already (even partially) on PyPI, pypa/gh-action-pypi-publish will fail on existing artifacts. Fine for a one-shot backfill; just flagging that re-runs aren't no-ops. skip-existing: true is an option if you want dispatch to be safely repeatable.

Nothing blocking from a code standpoint — the main ask is confirming the pypi environment protection rule, given the arbitrary-ref publish capability.

🤖 Generated with Claude Code

@justin-layerv justin-layerv merged commit 1769673 into main Jun 6, 2026
11 checks passed
@justin-layerv justin-layerv deleted the justin/backfill-pypi-release branch June 6, 2026 18:07
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.

1 participant