Skip to content

fix(release): watch the run for this tag, and let a re-run converge - #27

Merged
hunterdsp merged 1 commit into
mainfrom
fix/release-watch-race
Aug 7, 2026
Merged

fix(release): watch the run for this tag, and let a re-run converge#27
hunterdsp merged 1 commit into
mainfrom
fix/release-watch-race

Conversation

@hunterdsp

Copy link
Copy Markdown
Contributor

Two defects in the release path, both surfaced by shipping v0.4.1 an hour ago.

make ship reported a failure that wasn't one

ship is tag-release then release-watch, and the tag push returns before
GitHub has created the workflow run — so gh run list --limit 1 handed back
the previous release. v0.4.1 was reported as failed against a run that had
failed the night before, while the real release succeeded on every job.

A watcher that can report the wrong run is worse than no watcher: the failure
it invents is indistinguishable from a real one, and the first instinct is to
go fix a release that is already fine.

Now selects by tag (--branch "v$VERSION" — a tag-triggered run carries the
tag in headBranch) and waits up to 60s for the run to exist, so "not created
yet" becomes a clear error instead of an empty run ID.

A re-dispatched release always died at the last step

gh release create refuses an existing tag, so re-driving a release that had
already got as far as publishing failed on a release with the same tag name already exists — after build and publish had both succeeded, which is the
most confusing place to stop. workflow_dispatch was added to this workflow
precisely so a release could be re-driven through a webhook outage; a final
step that cannot survive a second run takes that back. It now edits the
release and clobbers the asset when one exists.

Verification

Both watcher paths run against real data:

  • make release-watch VERSION=0.4.1 → selects 31137565770, exits 0.
  • make release-watch VERSION=9.9.9 → errors after the 60s wait, naming the
    gh run list query to run by hand.

make lint clean.

Not done here

release-watch.sh in just-makeit and doppler already solves this more
thoroughly — and the two copies have drifted from each other (doppler's adds
C-tarball assertions and a more precise post-publish exclusion). Folding them
into one script here, where bash scripts belong, is the right end state, but
both repos have work in flight; this stays a local fix.

🤖 Generated with Claude Code

Two defects in the same path, both found by shipping v0.4.1.

`make ship` is tag-release then release-watch, and the tag push returns
before GitHub has created the workflow run — so `gh run list --limit 1`
returned the PREVIOUS release. v0.4.1 was reported as failed against a
run that had failed the night before, while the real release went on to
succeed on every job. A watcher that can report the wrong run is worse
than no watcher: the failure it invents is indistinguishable from a real
one, and the first instinct is to go fix a release that is already fine.
Selecting by tag is exact — a tag-triggered run carries the tag in
headBranch — and a bounded wait covers creation latency, turning "not
created yet" into a clear error instead of an empty run ID.

Second, github-release could not survive a re-run: `gh release create`
refuses an existing tag, so a re-dispatch died there every time, after
build and publish had both succeeded. workflow_dispatch was added to
this workflow so a release could be re-driven through a webhook outage,
which the old step quietly took back. It now edits the release and
clobbers the asset when one exists.

Verified both watcher paths against real runs: VERSION=0.4.1 selects
31137565770 and exits 0; VERSION=9.9.9 errors after the 60s wait naming
the query to run by hand.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@hunterdsp
hunterdsp merged commit ce582c0 into main Aug 7, 2026
11 checks passed
@hunterdsp
hunterdsp deleted the fix/release-watch-race branch August 7, 2026 01:34
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