Repository navigation
fix(release): wait for ci-ok before refusing a release, and never read a failure twice - #905
Conversation
…d a failure twice (#864)
401d4e8 to
8cdec9e
Compare
HugoXK-bot
left a comment
There was a problem hiding this comment.
Verdict: PASS at 8cdec9e
Written-by: HugoXK-bot
Author: Fledge Platform Verdict
wait-ci is only for a run that has not concluded — missing, unknown, pending or an empty conclusion at scripts/lib/release-drive.mjs:46-48 — and every other non-success still returns none on the first read (:188-194), so a red tip is never waited on.
The re-read is bounded at three reads five minutes apart (:237-238), leaves the loop on any decision that is not wait-ci (:311-317), and asks commits/${MAIN_SHA} from steps.state.outputs.main_sha (.github/workflows/daily-release.yml:210, :235), so a later main cannot be judged; a tip that never concludes ends none naming the run id and the read count (:318-330).
A dry run turns wait-ci into none plus wouldHave: wait-ci before the loop (:209-216), and the suite proves it never touches the reader or the waiter (test/releaseCiOk.test.ts:100-107).
Step and job budgets cover the sleep (daily-release.yml:93, :207), and the rewritten state.json keeps the summary and the #80 comment from reporting missing beside a released branch (:269).
Non-blocking: the push still cuts release/v* from the workflow-start checkout (:380), so the wait widens the window where that branch is based on a main that has since moved (:116).
Ran: at 8cdec9e, clean tree, node v22.23.2
- npm run check → 2431 tests, 2431 pass, 0 fail, exit 0
- node --test test/releaseCiOk.test.ts test/dailyRelease.test.ts → 36 pass, 0 fail
- node scripts/pr-lint.mjs --pr 905 → pr-lint: ok (#905, T3, 9 files)
- mutation in release-drive.mjs: fold
missingback intonone→ 4 of 6 tests fail; re-read a concluded failure → its test fails; drop the dry-run branch → its test fails
Not run: the scheduled workflow itself (no runner here); docker, codeql-required and coverage are CI's own. The red review-gate on this sha is the push-triggered run that predates any verdict.
Written-by: Fledge Platform Dev-3
Bot: Fledge Platform Dev-3
Fixes #864
The daily release read
ci-okexactly once. A run that started while CI was still in flight saw a check run with no conclusion,scripts/lib/release-state.mjsreportedmissing, andscripts/lib/release-drive.mjsfolded that intonone— the 0.3.7 slot was refused with a green tip still running.The two facts stay apart now.
missing(alsounknown/pending) is await-cidecision: the Decide step re-readsci-okat the same tip the plan was computed from, up to three reads five minutes apart (CI_OK_READS,CI_OK_INTERVAL_MSin the module), and decides again — somissing → successreleases. A concluded non-success still returnsnoneon the first read and is never re-read. The reason and the step summary name theci-okrun id, its status and how many reads were made, so "not yet" is distinguishable from "red"; a tip that never concludes ends the slot withnoneand the run id in the reason. A dry run neither waits nor re-reads: it reports what a real run would have done.release-state.mjsgainedlatestRun— the newest run by id, with its status and conclusion — andbuildStatecarries it asciOkRun;latestConclusiondelegates to it, so the older readers keep their behaviour. The Decide step writes the verdict it established back tostate.jsonbefore the step summary and the#80comment read.ciOk, so a released night cannot be commented asmissing. The Decide step statestimeout-minutes: 15and the release job 30, which covers the ten minutes of waiting plus the push, opener, auto-merge and comment that follow.Docs:
docs/deploy.mdgains a shortThe ci-ok read waits for the verdict (#864)subsection under the daily release section. Changelog fragment:changelog.d/864-release-waits-for-ci-ok.fixed.md.Ran:
npm run check— pass, 2412/2412 tests (lint, typecheck, tests, build), read on the tree as cut from3672754cnpx tsx --test test/releaseCiOk.test.ts— pass, 6/6; the same file fails on the base tree becausescripts/lib/release-drive.mjsexports nodecideWithCiRetrynpx tsx --test test/dailyRelease.test.ts test/mechanicalRelease.test.ts test/releaseState.test.ts— passfailurefixture decidesnonewith the run id on one read; a dry-runmissingfixture reportswouldHave: wait-ciand does not sleepnode scripts/risk-gate.mjs --base 3672754c751d5e2367f9cb741ceb29b9d7881faf—risk-tier: T3; basis: .github/workflows/daily-release.ymlNot run: a live workflow run. The bounded re-read is asserted with an injected reader and an injected wait; the step's
gh apicall and its ten-minute sleep cannot be exercised from here, and the first scheduled run after merge is the first live proof.Rebase note: the commit was re-based onto
78ea77a3(current main) after the cut, with the same nine files byte for byte; the tree sha therefore differs from the one the counts above were measured on, and the reviewer's own run is the reading at this tip.Red first:
test/releaseCiOk.test.tsand the two newtest/dailyRelease.test.tsassertions fail at the base tree and pass with the change; both readings were kept.Risk: this touches the nightly release path (
scripts/lib/,.github/workflows/) — T3, PASS at the tip required. The wait can only delay a release inside one slot. It cannot release a red tip:failureis decided before any re-read.