Skip to content

basis-build: never replace an existing basis-<sha10> release - #2

Merged
kiranandcode merged 2 commits into
masterfrom
kg/basis-build-release-guard
Sep 23, 2026
Merged

kiranandcode merged 2 commits into
masterfrom
kg/basis-build-release-guard

Conversation

@kiranandcode

@kiranandcode kiranandcode commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Ports the release guard from BasisResearch/tlaplus#1.

The publish step deleted and recreated the basis-<sha10> release on every run. A re-run (a workflow_dispatch, or re-running a failed job) rebuilds the binaries, which are not byte-reproducible, so the assets under an existing tag get replaced by ones with a different sha256, breaking any hash verus-tools-mcp has pinned to that tag. The publish step now exits early when the release exists; replacing one on purpose needs a manual gh release delete first.

Two smaller fixes from the same review:

  • cancel-in-progress now applies to pull request runs only, so a quick second push to the mainline cannot cancel a run before it publishes and leave that commit without a release.
  • contents: write is scoped to the publish job; the build job is read-only.

The download/upload paths are untouched. Unlike the tlaplus fork, this workflow builds two artifacts, so download-artifact keeps the per-artifact directories the glob expects.

🤖 Generated with Claude Code

Review rounds (iterate-pr) added: the first guard could wedge. gh release create uploads assets to a draft and publishes it last, so an interrupted run leaves a draft, gh release view finds it, and every re-run then exited 0 without publishing. The step now deletes a leftover draft and rebuilds it, keeps a published release that has all its assets (printing a ::notice::), and fails with ::error:: if a published release is missing assets, which needs a manual delete to rebuild. Non-PR runs also get a concurrency group per commit SHA, since a shared group holds only one pending run and would drop the middle of three quick pushes.

kiranandcode and others added 2 commits September 22, 2026 13:38
Ports the guard from BasisResearch/tlaplus#1: a re-run of the workflow
on a commit that already has a release rebuilt the binaries and
replaced the assets. The builds are not byte-reproducible, so that
breaks any hash verus-tools-mcp has pinned. Skip publishing when the
release exists; an intentional replacement needs a manual
`gh release delete`.

Also only cancel superseded PR runs (a cancelled mainline run left that
commit without a release), and scope `contents: write` to the publish
job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ncurrency

The existing-release guard treated any release under the tag as final.
`gh release create` uploads assets to a draft and publishes it last, so a
run killed mid-upload left a draft that every re-run then skipped, green,
with nothing published. Now:

- a draft is deleted and recreated (nobody can have pinned a draft);
- a published release missing any of the five assets fails the job and
  asks for a manual delete;
- a complete published release is kept, with a ::notice:: so a repair
  dispatch visibly did nothing.

Non-PR runs now use a per-commit concurrency group. A group holds only one
pending run, so a shared mainline group still dropped the middle run of
three quick pushes even with cancel-in-progress off.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@kiranandcode
kiranandcode merged commit 2d33fa9 into master Sep 23, 2026
3 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.

1 participant