Repository navigation
fix(vale): hold the upgrade wait until the registry reaches the manifest's Vale - #736
Conversation
…est's Vale A push-triggered upgrade run waited for the Release Vale run, then took the first registry answer "newer than the pins" as the new release. On 3.29.0 the pins were at 3.27.0 (the 3.28.1 upgrade unmerged) and npm still served 3.28.1 as latest for a minute and a half after the publish succeeded, so the run rebuilt vendor/vale/upgrade at 3.28.1, older than the release that started it. On a push, waitForRegistry now also requires the base version of the published stamp to equal the manifest's valeVersion at GITHUB_SHA. A registry that never gets there ends as the existing registry-stale warning, and non-push runs are unchanged.
|
@claude /review |
|
Claude finished @aibex-agent[bot]'s task in 3m 13s —— View job Review: fix(vale): hold the upgrade wait until the registry reaches the manifest's ValeReview mode: incremental — read 0 prior review thread(s) before reviewing.
Findings[New] One inline comment on Everything else checked out:
|
| @@ -330,14 +366,19 @@ async function waitForRegistry({ | |||
| try { | |||
| const comparison = await probe(); | |||
| answered += 1; | |||
| if (comparison.ahead === true) { | |||
| const reached = | |||
| expectedVersion === undefined || | |||
| stampBase(comparison.upstream) === expectedVersion; | |||
There was a problem hiding this comment.
[New] reached requires the registry's base version to be exactly expectedVersion (line 371: stampBase(comparison.upstream) === expectedVersion), not "at least" it. That's a fine fix for the measured incident (registry lagging behind the manifest), but it creates the mirror case: if the registry has already raced past the manifest's version by the time this probes — e.g. a second manifest bump (3.30.0) merges and its own Release Vale run finishes publishing while this run (waiting for 3.29.0) is still in its 5-attempt registry poll — stampBase(comparison.upstream) is "3.30.0", never equals "3.29.0", and the run reports registry-stale and defers to the next day's cron even though the registry is actually ahead of the pins and could be upgraded to immediately.
Both release-vale.yml and vale-upgrade.yml serialize themselves via their own concurrency: groups (release-vale, vale-upgrade), so this needs two manifest-bump PRs to merge within roughly the 5-minute registry-poll window to trigger — narrow, but not impossible with quick reviews/bot approvals.
Since vale-release.cjs already exports compareValeVersions for comparing two plain (non-stamped) Vale versions, consider compareValeVersions(stampBase(comparison.upstream), expectedVersion) >= 0 instead of strict equality, so "ahead of the pins and at or past the manifest's target" both count as reached.
There was a problem hiding this comment.
Agreed, fixed in bafc124. The wait now uses compareValeVersions(stampBase(upstream), expectedVersion) >= 0 (imported from vale-release.cjs), so a registry already past the manifest's version counts as reached. An earlier, intermediate version still waits. Added a test for the 3.30.0-past-3.29.0 case and reworded the warning and comments to say "at or past".
Review on #736: an exact match would report registry-stale when a later manifest bump published first. Compare with compareValeVersions so at or past the manifest's version counts.
A push-triggered Upgrade the pinned Vale run could propose an older Vale than the release that triggered it.
What happened (2026-12-02, run 46830233801). Merging #729 (manifest → 3.29.0) started both Release Vale and the upgrade. The wait correctly held for the Release Vale run (success at 07:10:47Z), then
waitForRegistry()returnedaheadimmediately: its only condition was "registry serves a newer set than the pins". The pins were still 3.27.0 (the 3.28.1 upgrade, #731, was unmerged) and npm still served 3.28.1 as latest, so 3.28.1 counted. 3.29.0 became visible at 07:12:28Z, after the run had already rebuiltvendor/vale/upgradeat 3.28.1.Fix. On a push, the wait now also requires the base version of the published stamp (3.29.0 of
3.29.0-<stamp>) to equalvaleVersionin.github/scripts/vale-manifest.jsonatGITHUB_SHA. An intermediate newer set is logged as "newer than the pins, but not yet Vale X" and polled again.Unchanged. Every exit is still 0. A registry that never reaches the manifest's version ends as the existing
registry-stalewarning (now naming the version it waited for) and leaves the work to the daily cron. Scheduled and dispatched runs skip both waits and never read the manifest. A manifest that cannot be read falls through to the existingrecover()path (ready=true,wait-errored).Tests.
.github/scripts/vale-upgrade-wait.test.cjsreplays the incident: pins at 3.27.0, registry at 3.28.1, then 3.29.0 → waits for 3.29.0; registry stuck at 3.28.1 →registry-stale; plusreadManifestVersionand a check that non-push runs never read the manifest. 39/39 pass;pnpm typecheckandpnpm lintpass.The workflow change is comments only. CI-only, so no changeset.