Skip to content

fix(release): say on #80 when an open release pull request holds the night - #1209

Open
HugoXK wants to merge 1 commit into
mainfrom
dev1/1204-release-silence
Open

HugoXK wants to merge 1 commit into
mainfrom
dev1/1204-release-silence

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Written-by: Fledge Platform Dev-1

Fixes #1204

What changed

A night held by an open release pull request used to be a green no-plan that said nothing anywhere a person reads. The refusal was right (scripts/lib/release-trigger.mjs), the push step was gated on a plan (.github/workflows/daily-release.yml), and the #80 step exited on the empty push — while the collected state carried only {number, title} of that pull request, so its ci-ok was never read. #1200 was red from 02:05:32Z and #80 still only said "opened v0.4.5".

The refusal stays exactly as it is: nothing here merges, closes, re-runs or pushes, and open-pr remains a no-plan. What changes is that the held night becomes visible:

  • Collect (.github/workflows/daily-release.yml): the collect step picks the accepted release pull request with the same predicate buildState uses (the new selectedOpenPr export in scripts/lib/release-state.mjs) and reads that head's check-runs beside main's. The state now carries openPrCiOk (id, status, conclusion) and openPrFailedChecks (names of concluded non-success checks); with no head or no collection it reads missing, never a silent green. The CLI takes --open-checks.
  • Reason (scripts/lib/release-trigger.mjs): openPrReason names the pull request, the short head and the ci-ok conclusion, plus the failing check names when it is red — open-pr: #1200 is the open release pull request at 9ee14f9, ci-ok failure (failing: ci-ok, test (24)). A caller that passes only the number keeps the old wording, so existing behaviour is unchanged.
  • release: daily minor release with the 10+/5+ rule #80 (.github/workflows/daily-release.yml): the held night gets its own path before the empty-push exit, posting one marker-guarded line keyed by #<number>:<short head>:<conclusion>. Green and red read differently, and the line repeats only when one of the three changes. Both shapes share the single gh issue comment 80 call.

Red

At base 044c7515a6111560bf96cdd20e8c724535cefc0a, one new assertion per file, verbatim:

  • test/releaseTrigger.test.ts (case 3b): AssertionError: the conclusion is part of the reason, so a red night is not silent — actual reason open-pr: #1200 is the open release pull request.
  • test/releaseState.test.ts: TypeError: Cannot read properties of undefined (reading 'conclusion') — the state has no openPrCiOk.
  • test/dailyRelease.test.ts: AssertionError: the open-pr reason has a path of its own — the release: daily minor release with the 10+/5+ rule #80 step has no held path.

Green at the tip: the three files together, 73/73.

Ran:

  • npm run check at 8f91df5ed16cc932f4891479c061d8e836c4ff1d — exit 0, # tests 3296 / # pass 3296 / # fail 0; lint 11 warnings (baseline); typecheck; build.
  • node scripts/risk-gate.mjs --base origin/main — risk-tier: T3; basis: .github/workflows/daily-release.yml.
  • bash -n on the modified release: daily minor release with the 10+/5+ rule #80 step's run: block — exit 0.
  • node --test on test/releaseTrigger.test.ts, test/releaseState.test.ts, test/dailyRelease.test.ts — 73/73.

Not run:

  • The workflow itself: it runs only on schedule, push to main and workflow_dispatch, so the release: daily minor release with the 10+/5+ rule #80 line is proved by the structural test and the shell syntax check, not by a live run. No production deploy.
  • No live red release pull request: the fixture is constructed, and #1200 (merged as 044c7515) is not depended on.

Risk and rollback

T3: .github/workflows/** and scripts/**. Revert this commit to restore the previous nightly; the slot rule, the planner, the trigger conditions and the refusal itself are untouched.

Docs

docs/deploy.md updated: a held night now reports the pull request, its head and its ci-ok on #80, and the "runs that pushed nothing never reach the write path" sentence is narrowed to the held-night case.

Changelog

changelog.d/1204.fixed.md.

A night held by an open release pull request refused the slot and then said
nothing on #80: it pushed nothing, so the record step exited, and the state
kept only {number, title} of that pull request, so its ci-ok was never read.

The refusal is unchanged. The collect step now reads the accepted release pull
request's head and its ci-ok conclusion, with the names of the checks that
failed; the pure open-pr reason names the head and the conclusion; and a held
night posts one marker-guarded line on #80 keyed by number, head and
conclusion. Fixes #1204.

@HugoXK-bot HugoXK-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: PASS at 8f91df5

  • The refusal is untouched: scripts/lib/release-trigger.mjs:144 still returns no(...) (plan false, catchUp false, the boundary preserved) for an open release pull request, and openPrReason (:69-88) only composes text — every other decideTrigger branch and the whole drive/plan path are unchanged in the diff.
  • The collection uses the same predicate the state does: selectedOpenPr (scripts/lib/release-state.mjs:90) is releaseCandidates(...).candidate, the function buildState itself consumes, so the head read at .github/workflows/daily-release.yml:134-151 and the state can never disagree about which pull request is meant; --open-checks (:172) feeds openPrCiOk/openPrFailedChecks (scripts/lib/release-state.mjs:156-157), which read missing when no head or no collection exists (test/releaseState.test.ts:59-97).
  • The held line has its own path before the empty-push exit (.github/workflows/daily-release.yml:519-597, exit at :555), keys its marker daily-release:held:#<number>:<short head>:<conclusion> (:534), reads green and red differently, and shares the one gh issue comment 80 call with the pushed shape; bash -n on the extracted step is clean and the 25-minute timeout, the slot rule and the plan step are not touched.
  • Docs and changelog match the behaviour: docs/deploy.md:480-495 narrows "runs that pushed nothing never reach the write path" to the held case, while dry runs still write nothing (daily-release.yml:505 keeps always() && inputs.dry_run != true), and changelog.d/1204.fixed.md names the defect.
  • Evidence: at this tip the three test files are 73/73; at base 044c7515 with only the test hunks, exactly the three new tests fail (AssertionError, TypeError, AssertionError), so the Red section reproduces; the 32 latest checks at this sha are green (skipped where the path filter excludes them) except review-gate, which is red only with "no conclusion at 8f91df5…"; the open head is read without filter=, which is the API's latest default (default 31 runs = filter=latest, while filter=all returns 55 and includes superseded failures), so no stale names leak in.
    Ran: npx tsx --test test/releaseTrigger.test.ts test/releaseState.test.ts test/dailyRelease.test.ts on a tree built from base 044c7515 + this diff with all ten blobs hash-equal to the PR head — 73/73 pass; the same three files on base 044c7515 with only the test hunks applied — 69 pass, the three #1204 tests fail; bash -n on the extracted Comment on #80 run block (exit 0); curl reads of the 32 latest check-runs at the sha and of 9ee14f9's check-runs with and without filter.
    Not run: the workflow itself (it runs on schedule, push to main and workflow_dispatch) — the held line is proven structurally plus the shell syntax check, not by a live held night; npm run check locally (CI ci-ok 136934800647 is green at this sha and my run covered the three affected files); no production deploy. Non-blocking note: the new open-head read sits on the collect step's critical path, so a 5xx there turns a green no-plan into a red run whose #80 step exits silently — the same failure class the collect step already had, not a new decision.
    Written-by: HugoXK-bot

@HugoXK-bot HugoXK-bot added the review:approved Issue reviewed and approved by the Fledge Platform Reviewer label Nov 21, 2026
@HugoXK

HugoXK commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

Security: PASS at 8f91df5

  • .github/workflows/daily-release.yml:95-99,101,105,596,619,621: no gate surface moved — the release permissions and all five uses: (40-hex) pins are identical at base, and the diff adds no secrets. reference.
  • .github/workflows/daily-release.yml:507,474: the held step gets no more privilege than before — GH_TOKEN: secrets.GITHUB_TOKEN under the job's issues: write, while RELEASE_OPEN_TOKEN stays confined to the opener at :474.
  • .github/workflows/daily-release.yml:527,534,554: the held branch runs only on an empty push and an open-pr: reason, ahead of the empty-push exit; a non-held no-push run still exits 0 silent, and the pushed body and marker are byte-identical to base on the same inputs.
  • .github/workflows/daily-release.yml:531,543: state values reach printf/gh --body as arguments, never through eval; a check name containing $(…) printed literally and ran nothing, so the new text cannot act on the run.
  • scripts/lib/release-trigger.mjs:140-144: the refusal and slot order are unchanged — open-pr still returns plan:false ahead of branch/tag/slot, verified at both shas for number-only, red and green, with only the reason text extended (:69-83).
  • scripts/lib/release-state.mjs:74-91,156-157: the candidate predicate is the same find(accepted) extracted as-is, and the new fields feed only the reason and the release: daily minor release with the 10+/5+ rule #80 line; an uncollected head reads missing/[], never a green.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review:approved Issue reviewed and approved by the Fledge Platform Reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: a night held by an open release pull request says nothing on #80, even when that pull request is red

2 participants