Repository navigation
chore(ci): open the Vale upgrade PR when the manifest lands on main - #369
Conversation
|
@claude /review |
|
Claude finished @theCodeDrift's task in 4m 52s —— View job Review completeReview mode: incremental — read 0 prior review thread(s) before reviewing.
SummaryThe design — fire on the manifest-commit push instead of a daily cron, then wait out the publish race before running detect — is sound and well-reasoned, and the "never fail the run over a race" intent is clearly stated. I found one correctness bug in how that intent is implemented, plus a related but lower-severity diagnostic issue. Posted as inline comments:
Also worth a look, not inline since it's a design suggestion rather than a bug: both wait loops are hand-rolled shell polling logic embedded directly in the YAML, unlike every other piece of decision logic in this same pipeline ( Nothing else stood out — permissions additions ( |
21d70f8 to
957da48
Compare
Both inline findings were real and are fixed in 957da48: the — AI Coding Agent |
What
vale-upgrade.ymlnow runs on a push tomainthat touches.github/scripts/vale-manifest.json, which is the merge of arelease-vale.ymldetect pull request. That is the same eventrelease-vale.ymlpublishes on, so the upgrade half starts from the manifest commit itself rather than from a clock.workflow_dispatchstays. The daily52 7 * * *schedule stays too, re-commented as a backstop rather than the trigger.Why
The only thing that makes the CLI's six
@taskless/vale-*pins fall behind is a republish, and a republish starts exactly when the manifest lands. Until now nothing here reacted to that: the daily cron was the only trigger.Measured on 3.22.0: the manifest merged at 18:09:13Z, the
Release Valerun started at 18:09:16Z, and the packages on npm carry the stamp3.22.0-20260921180930. The upgrade PR would have been opened by the next52 7 * * *tick, roughly thirteen hours after the packages were on npm. The pins sat packaged-but-unshipped for that whole window.How the publish race is handled
Firing on the same push means this workflow and
Release Valestart within seconds of each other, and the detect step asks the npm registry what is published. Run immediately, it compares against the oldlatest, finds nothing to do, and exits clean. Two new steps, bothif: github.event_name == 'push', sit before detect:gh run list --workflow release-vale.yml --event push --commit "$GITHUB_SHA" --json status,conclusionevery 30 s, bounded at 25 minutes. Proceeds only once every run for that SHA iscompletedwith conclusionsuccess. Any other conclusion, or no run inside the bound, emits a::warning::naming the cron backstop and exits 0. The job getsactions: readfor this and nothing else new.vale-upgrade-detect.cjs --json, 60 s apart, until it reports"ahead":true.--jsonis the script's read-only mode (it refuses--writeand--notes-outalongside it). If the registry still serves the pinned version after five minutes:::warning::, exit 0, detect runs as usual and finds nothing, and the cron picks it up.Neither step can fail the run. A red here would say "the upgrade is broken" when the truth is "the publish is", and the schedule already covers the cases the push run cannot see: a publish re-run by hand (a re-run is not a new push) and slow registry propagation.
The wait-step shell was exercised locally against a stubbed
ghfor four outcomes (in progress then success, failure, two runs with one still queued, never registered) and every path returned 0.Double-opening is not possible:
concurrency: vale-upgradeserializes a push run against a scheduled one, andvendor-pr.cjsrefuses to push when the rebuiltvendor/vale/upgradebranch is identical to the remote and edits the existing open PR (gh pr list --head) instead of opening a second one.Not
workflow_run: the trigger is deliberately the manifest commit, not the other workflow's completion.Rollout
The first run on the new trigger is the next manifest merge. Nothing is waiting on this: a
workflow_dispatchwas run by hand today at 21:16Z for 3.22.0, so the 3.22.0 upgrade PR already exists.Checks:
prettier --check, the YAML parsed withon.push,on.schedule,on.workflow_dispatchpresent, andpnpm test:scripts(443 pass, including the suite that scans committed workflows).actionlintis not installed locally, so it was not run.