Skip to content

Wait for a new release to appear before writing the manifests - #55

Merged
marcosqlbi merged 1 commit into
mainfrom
fix/manifest-release-race
Aug 21, 2026
Merged

Wait for a new release to appear before writing the manifests#55
marcosqlbi merged 1 commit into
mainfrom
fix/manifest-release-race

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

v0.9.5 was published at 06:23:40. The Publish site run it triggered started at
06:23:42 and succeeded — writing a stable.json that said 0.9.4.

The releases API lags publication by seconds. The script takes the newest non-prerelease
from /releases, got the previous one, and reported success. The site offered 0.9.4 and
the in-app update check agreed with it, which is the same user-visible damage as the tag
rule in #53 arriving by a different route.

dev.json was correct only because the pre-release had eighteen minutes of lead time
before its own run.

The fix

The workflow passes the tag being published as -ExpectTag; the script polls until that
tag appears, and fails after ten attempts rather than writing a manifest it knows is
stale
. A loud failure is recoverable; a quiet wrong answer is what cost us a release.
The tag is empty for push and manual runs, so those paths are unchanged.

A latent bug found alongside it

The same fetch now sorts on published_at. The API orders by created_at, which for a
release carries the date of the commit its tag points at — not when it was published. It is
already observable: v0.9.4-dev.3244 (created 20:32) sorts above v0.9.4 (created 19:43).
Today's filters hide it, since the channels are separated before anything is picked. It
stops being hidden the first time an older commit is promoted after a newer one has already
been released.

Verified

Ran the script three ways against the live API: with -ExpectTag v0.9.5 (found, proceeds),
with an empty tag (unchanged behaviour), and confirmed both manifests select correctly with
the new sort. The site has already been redeployed manually, so
whiteboard.sqlbi.com/stable.json now reports 0.9.5.

The releases API lags publication by seconds. Publish site runs on the release
event, so the 0.9.5 run read a list that did not contain 0.9.5 yet, wrote a
stable.json describing 0.9.4, and reported success - the site offered the
previous version and the in-app update check agreed with it.

The workflow now passes the published tag as -ExpectTag and the script waits
for it, failing after ten attempts rather than writing a manifest it knows is
stale. Nothing changes for push or manual runs, where the tag is empty.

The same fetch also sorts on published_at. The API orders by created_at, which
for a release carries the date of the commit its tag points at, so a
pre-release built from a later commit already sorts above a release promoted
from an earlier one - harmless with today's filters, wrong as soon as an older
commit is promoted after a newer one.
@marcosqlbi
marcosqlbi merged commit f46df2b into main Aug 21, 2026
4 checks passed
@marcosqlbi
marcosqlbi deleted the fix/manifest-release-race branch August 21, 2026 07: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