Skip to content

fix: make release workflow compatible with immutable releases - #949

Merged
farhan merged 1 commit into
openedx:masterfrom
farhan:farhan/fix-immutable-release
Sep 1, 2026
Merged

fix: make release workflow compatible with immutable releases#949
farhan merged 1 commit into
openedx:masterfrom
farhan:farhan/fix-immutable-release

Conversation

@farhan

@farhan farhan commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Important

PR implemented with the assistance of Claude Code. Refined and validated before being submitted for code review.

Problem

This org has immutable releases enabled, which freezes a release's assets the moment it is published. The current release.yml lets python-semantic-release publish the GitHub Release first, then attaches the built distributions afterwards via python-semantic-release/publish-action. That afterward-attach is no longer allowed and fails with:

Failed to upload asset 'dist/xblock-6.3.2-py3-none-any.whl' to release (HTTP 422)
Failed to upload asset 'dist/xblock-6.3.2.tar.gz'      to release (HTTP 422)

The failing step aborts the release job before publish_to_pypi runs, so the tag and GitHub Release are created but the package is never shipped to PyPI.

This has already happened: v6.3.2 is tagged (2026-08-10, run 31368659412) with an empty assets list, and PyPI is still at 6.3.1. Every future fix:/feat: release fails the same way until this is fixed.

Fix

Adopt the immutable-safe draft-then-publish pattern from the sample-plugin standard:

  • Set vcs_release: "false" on the python-semantic-release step so it commits, tags, pushes, and builds the distributions but does not create the GitHub Release itself.
  • Create the release with gh release create "$TAG" ... dist/*, which creates it as a draft, uploads the assets, and only then publishes it — the only ordering immutable releases permit.
  • Remove the now-broken python-semantic-release/publish-action step.
  • SHA-pin all actions (upload-artifact, download-artifact, python-semantic-release, gh-action-pypi-publish) to match the standard.

PyPI publishing is unchanged — still OIDC trusted publishing via pypa/gh-action-pypi-publish with id-token: write.

Result

Once merged, this fix: commit produces a fresh release that finally lands on PyPI, validating the corrected pipeline and closing the 6.3.1 → 6.3.2 publishing gap.

Testing Notes

Validated with actionlint (passes) and an SHA-pin audit (all third-party actions pinned). The release path itself can only be exercised on merge to master.


🤖 Generated with Claude Code

@farhan
farhan marked this pull request as draft September 1, 2026 14:54
The org has immutable releases enabled, which freezes a release's assets
the moment it is published. The old flow let python-semantic-release
publish the GitHub Release and then attached the built distributions
afterwards via publish-action, which now fails with HTTP 422 ("cannot
upload assets to an immutable release"). That failure aborts the release
job before publish_to_pypi runs, so the tag is created but never shipped
to PyPI (v6.3.2 is tagged but missing from PyPI).

Set vcs_release: "false" so python-semantic-release commits, tags, and
builds but does not publish the release, then create it with
`gh release create` which uploads the assets to a draft and publishes it
atomically -- the ordering immutable releases require. All actions are
SHA-pinned to match the sample-plugin standard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@farhan
farhan force-pushed the farhan/fix-immutable-release branch from 1779f02 to c7b8e1a Compare September 1, 2026 15:05
@farhan
farhan marked this pull request as ready for review September 1, 2026 15:09
@farhan
farhan merged commit b0d7826 into openedx:master Sep 1, 2026
9 checks passed
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