Repository navigation
fix(pr-pipeline): clear needs-session when a same-head fix-ci retry lands - #11476
Conversation
Lane-Activity: work-resolve-issue/resolve-issue (cherry picked from commit 4c7b250)
…session reads The merge job gains statuses: read: the clear-escalations sweep reads a lane stop's pr-unblock status with the job token, which the lanes App cannot. Reads are capped at SESSION_CHECKS_PER_RUN, kept labels included, and a success older than the stop no longer clears the label, since report-stop-status posts the stop's failure in a separate job. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed I found no security issues in this change, so there is no hold. critical-findings: 0 What I read: the full diff, the PR context and the surrounding Trust controls touched
Resource use: the sweep makes at most five PR reads a run, plus one status read per routed stop. This spends only API rate budget on existing tokens. It is not a billing change, so there is no cost hold. Owner-threat-model note: no named friction hold (path, trust-path, person-approval, bot-author, pin) is weakened. |
|
claude-review reviewed No findings. I read the diff, the PR context, Closing issue #11087 criteria (the issue and its decision comment read as met):
Checked against the scripts:
Cost: more reads on prepaid API and Actions usage (a list read every sweep, and up to five timeline reads plus status reads per run when PRs carry |
Closes #11087
Summary
A rung-0 flaky
ci-fix-escalatedstop addsneeds-session. When the same-head retry lands,report-escalation.sh clearposts success, but nothing removed the label, so a Dependabot PR lost dependency review until a session took it off. This implements the 2026-10-31 decision on #11087 (option 3): theclear-escalationssweep removes the label, with no comment, once the stop's failing status has cleared.That decision assumed no workflow edit. The sweep runs in the
mergejob, whose token could not read commit statuses, and the lanes App token holds no statuses permission, so every read would fail closed and the label would never come off. This PR adds the read-only grant, the only workflow change.Fix
.github/workflows/pr-merge.yml: themergejob gainsstatuses: read, neverwrite, the same readenable-auto-mergealready declares for these statuses. TheCHECKS_TOKENand sweep comments now say so.clear-escalations.mjs: the label comes off only when the lanes App added it last, and every stop routed to it since then has asuccessfromgithub-actions[bot], newer than the stop, on that stop's head. A person's label, a still-failing stop, an unparsable stop or a failed status read keeps it.SESSION_CHECKS_PER_RUN(5) PRs a run, kept or cleared, from the rotating offset. The lane's commit capped clears only, so a kept label would have been re-read every run with no limit.report-stop-status, a job separate from the comment. A success older than the stop belongs to an earlier stop and no longer clears the label.Verification
node --test .github/scripts/pr-merge/clear-escalations.test.mjs: 118 pass, 0 fail. Includes the rung-0 retry (label gone), the cause still present (label kept), a pre-stop success (kept) and the read cap.node --test .github/scripts/pr-merge/clear-escalations-stale-hold.test.mjs: 17 pass, 0 fail.node --test .github/scripts/pr-merge/workflow.test.mjs: 94 pass, 0 fail. No test pins themergejob's permissions, so none changed.GitHub API delta per scheduled sweep (R34; the step runs only on the schedule, four times an hour):
GITHUB_TOKENneeds-session)So +1 read a run (+4 an hour) today, and in the worst typical case 1 + 5 + 5 reads on the lanes token, including deletes, plus 5 on the job token. A longer timeline or status list adds pages, bounded by
paginate(50 pages) andreadStatuses(10).Left out: the live sweep, which runs only on main's schedule after merge. Local verify is off for this repository (
pre_readyindocs/conventions/source-control.yaml); CI runs the affected suites.Related
needs-sessionroute.🤖 Generated with Claude Code