Repository navigation
release, nightly: publish the staged release by id, refuse duplicate drafts, resume a complete staged release - #21139
Conversation
… staged release v0.65.2 was published with 0 assets: softprops/action-gh-release looked the release up by tag, which 404s for drafts, created a second release and published it while the 12 assets sat on the staged draft. - publish-release-assets.py refuses before upload when more than one release object exists for the tag, and reports release_id, asset_count, asset_names. - New scripts/ci/finalize-release.py publishes a release by id, refuses any other release for the tag, and verifies the published release by tag holds the expected assets. It can also download assets from a staged draft. - release.yml: the guard also lists drafts, refuses duplicates, and when the staged release already holds every immutable asset it skips the build and resumes: download the staged appcast, publish by id, upload R2. - nightly.yml: both release metadata steps publish by id with the script instead of softprops tag lookup.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…uoted name lists Review follow-up for #21139.
Correctness review (subagent) and resolutionResult: no blockers. Commit 2 on this branch fixes the findings below where noted.
The reviewer also checked these and found them correct:
|
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
Review follow-up: a rerun of a published release stays a no-op so a demoted release is never republished; the resumed draft must have exactly the asset count the guard saw, all uploaded.
|
Addendum. The review of the main port (#21140) found 1 should-fix and 2 nits that also apply to this branch. Commit
|
…covered build (#21144) * nightly: run publication tooling from the workflow commit, not the recovered build publish-nightly checks out the published build's commit. A recovered build can be days older than the workflow: run 38855116561 recovered 0664bd9, whose nightly_version.py predates --already-published-ok (#20986), so the recheck failed with unrecognized arguments. The same skew would break publish-release-assets.py --github-output and finalize-release.py (#21139). Check out scripts/ at github.sha into .publish-tooling and run the publication tooling from there: nightly_version, nightly_release_notes, nightly-next-guard, prune, publish-release-assets, finalize-release, upload-r2-object and update-release-tag. Scripts that read the build's own source tree stay on the publish ref. * nightly: pin every moved publication script to the tooling checkout in the test Review follow-up for #21144. * test: accept the publication tooling path for the release tag helper * test: allow the publication tooling checkout at github.sha in publish-nightly
Summary
This PR ports the v0.65.2 duplicate-draft fix (#21137, which is still open on main) to the feat-cmux-next universal-app
release.yml. It also fixes the two follow-ups: beads cx-sqadk (the guard cannot see drafts) and cx-9ol90 (nightly uses a softprops tag lookup).Incident: v0.65.2 was published with 0 assets.
publish-release-assets.pystaged draft 414419116 and uploaded 12 assets to it. Thensoftprops/action-gh-releaselooked the release up by tag. That lookup returns 404 for drafts, so the action created release 414419301 and published it with 0 assets (job log of run 38621170537, attempt 5).Changes
scripts/ci/publish-release-assets.py: before any upload, the script refuses when the tag has more than one release object, draft or published. The new--github-outputflag reportsrelease_id,asset_countandasset_names.scripts/ci/finalize-release.py:publishpublishes the given release id. It refuses when any other release exists for the tag. It clears prerelease and sets the metadata first, then setsdraft=falseandmake_latest. It then checks that the tag resolves to the same id, that the release is not a draft, and that the expected assets are there (exact count when one is given).downloadtakes assets from a staged draft and checks the digest.release.yml:appcast.xml, publishes the release by id and uploads the appcast to R2. Before, a failure between upload and publish could not be fixed by a rerun, and a missed R2 upload stayed missed.Publish verified releasenow usesfinalize-release.pywith the upload step's id and asset count. softprops is removed.nightly.yml:Publish verified nightly release metadataandRecord verified nightly publicationnow publish the staged channel release by id with the same release body and token, in place of the softprops tag lookup (cx-9ol90).tests/test_github_release_publication.py: the existing workflow-text assertions are changed to match the new steps. One existing case is changed to have a single draft, because two drafts for one tag are now refused. No new tests (behavior-test rule).Changelog
none
Verification
actionlintpasses onrelease.yml. Onnightly.ymlit reports only a pre-existing SC2129 at line 1597, which is not in this diff.finalize-release.py publish/download --helpload correctly, andpy_compilepasses.ci-guardsandr2-upload-testsjobs run them.Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Fixes release and nightly publication so the staged release is published by id, preventing releases from being published with 0 assets (v0.65.2 shipped empty this way).
finalize-release.pypublishes a release by id, refuses other releases for the same tag, and verifies the published release holds the expected assets; its download command fetches staged assets by id without sending the token on GitHub's redirect.release.yml: the guard lists drafts, refuses duplicate release objects, and skips the build when a complete staged draft exists; the rerun then resumes publication by id with the exact asset count the guard saw, without rebuilding, so signed bytes stay intact. A rerun of an already-published release is a no-op.nightly.ymlpublishes the staged release by id in place of thesoftpropstag lookup.finalize-release.pyloads.Written for commit d4432e6. Summary will update on new commits.