Skip to content

fix(pr-pipeline): stop fix-ci re-dispatching a head it already skipped - #8455

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/fix-ci-skip-handled
Oct 19, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/fix-ci-skip-handled

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #8445

Hold: a human merges this (it adds a workflow job).

Summary

When fix-ci-context skipped (a closed pull request, or a head with no failing check), the run posted no pr-unblock / fix-ci check run. fix-ci-dispatch.mjs dispatches any red lanes-App head that has no such check run, lowest PR number first, up to fix-ci-per-run. So #8171 and #8074 took both slots on every main push, and every other red lane PR got no slot.

Fix

  • .github/workflows/pr-unblock.yml: a new fix-ci-not-run job runs when fix-ci-context wrote proceed=false with no escalation reason and a head SHA. It posts pr-unblock / fix-ci neutral not-applicable on that head through report-check-run's not-run-reason. This is the same pattern as publish-feedback-not-run, with the same checks: write + contents: read and base-tip code only. The dispatcher already counts a neutral check that is not untrusted-trigger as handled (fix-ci-dispatch.mjs:91-99), so the script itself is unchanged.
  • docs/conventions/pr-pipeline/pr-run-activity.md: the fix-ci step 1 now says that a skip posts this neutral check.

Why #8171 and #8074 show a red ci-status with no failing check: an earlier full run failed one lane (check-skills on #8171, lint-repo on #8074) and recorded the commit status ci-lanes=failure. A later contract-only pull_request event ran pr-require-checks again with every lane skipped. That run posted newer skipped check runs under the same names, and its ci-status failed on the ci-lanes status left by the earlier run. fix-ci-context.mjs keeps only the latest run per check name (failingChecks), so the skipped run hides the real failure and the context counts 0 failing checks. That is a separate defect and is not changed here.

Verification

  • node --test .github/actions/resolve-config/callers.test.mjs: 15/15 pass. The new test evaluates the job's if: (it runs on a skip, and does not run on proceed, an escalation, or a kill-switch stop). It runs the job's report-check-run step and checks that the posted check is pr-unblock / fix-ci, neutral, not-applicable, on the gated head. It then passes that check, as the listing returns it, to fix-ci-dispatch.mjs's skipReason, which now reports the head as handled.
  • The fix-ci-dispatch, fix-ci-context and report-check-run tests: 123/123 pass.
  • actionlint and zizmor --offline on pr-unblock.yml: clean. scripts/check-affected.sh: 5 passed, 3 skipped.

Related

🤖 Generated with Claude Code

A fix-ci-context skip (a closed pull request or no failing check) ran no
fix-ci job, so no pr-unblock / fix-ci check landed on the head, and
fix-ci-dispatch.mjs, which dispatches any head without one, sent the same
lowest-numbered pull requests on every run. A new fix-ci-not-run job posts
fix-ci neutral not-applicable on that head through report-check-run, as
publish-feedback-not-run does for address-feedback.

Closes #8445

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 19, 2026 15:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T15:34:55.715653Z fc1d836 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed fb5ce2053ada4d4fe9fe2e7f159990190b666056: 0 finding(s), 0 as inline comments.

No security findings in PR #8455 at head fb5ce20.

The PR adds a fix-ci-not-run job to pr-unblock.yml that posts a neutral pr-unblock / fix-ci check on the head when fix-ci-context skips. It also adds a test and a docs line.

  • Token scope: the job has checks: write and contents: read only. It checks out the default-branch tip with persist-credentials: false, so no PR head code runs in the job.
  • Where the head SHA comes from: head-sha is the pull.head.sha that fix-ci-context.mjs reads from the pulls API (fix-ci-context.mjs:106), not from PR text. The job's if requires it to be non-empty, and a kill-switch stop leaves it empty, so nothing is posted then.
  • Same pattern as before: the job mirrors the existing publish-feedback-not-run job. The ./.base local action carries the same zizmor: ignore[self-repository] as that job. The Actions-hardening aspects are left to the zizmor lane.
  • Injection: the job's ${{ }} values go only into action with: inputs, not run: blocks.
  • Instruction surfaces: the diff deletes or softens no standing instruction, hook or allowlist, so the instruction-exception register was not needed.

I did not consider whether a neutral check could hide a later failing check on the same head from the dispatcher. That is functional behaviour, not a security issue, and falls outside this lane.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed fb5ce2053ada4d4fe9fe2e7f159990190b666056: 0 finding(s), 0 as inline comments.

No findings. I reviewed the 4-file diff against the PR context and #8445, and I did not run the tests or the workflow.

Closing issue #8445. The issue says "A fix-ci run that skips records a terminal result for that head (a neutral check run, or an escalation), so the dispatcher counts it as handled and moves on." The change meets that. fix-ci-not-run (.github/workflows/pr-unblock.yml:158-195) posts pr-unblock / fix-ci neutral not-applicable whenever fix-ci-context skips. That covers both skip paths in fix-ci-context.mjs:110-111 and :127-128: a closed PR, and a head with no failing check. I read skipReason in fix-ci-dispatch.mjs:91-99. A neutral run that is not untrusted-trigger makes runs.some(...) true, so the head is reported as already handled. The new test also passes the posted check through skipReason, so a failure of that contract would fail the test.

The issue's second ask was to find why ci-status is red with no failing check. The PR body explains the cause and leaves it unfixed on purpose. The issue states that ask only as "Also find…", not as a criterion, so I did not flag it.

Job conditions.

  • The if: mirrors publish-feedback-not-run and adds escalation-reason == ''. The round-cap escalation path stays with report-escalation.
  • A kill-switch stop leaves head-sha empty, so the job does not run. The test covers that case.
  • The cap escalation emits proceed=false with a head SHA and a reason. The reason check keeps the new job from also posting for it.
  • The new job holds only checks: write and contents: read, and it runs base-tip code only. head-sha comes from a fix-ci-context job output that is validated against a SHA regex on the way out.

Tests. Extracting postNotRunCheck leaves the publish-feedback assertions equivalent. They moved into the test body and still use head and context(...).

Docs and changelog. The pr-run-activity.md addition matches the new behavior, and the changelog fragment is in the usual form.

Observation, not a defect. A neutral fix-ci check is permanent for that head SHA. If a head's fix-ci-context skip were ever transient, for example a lane check not yet listed, the dispatcher would not retry it until a new commit lands. This is the same trade-off publish-feedback-not-run makes. The issue asks for a terminal result per head, so I am not reporting it.

kyle-sexton and others added 2 commits October 19, 2026 13:22
… test comment

comment-hygiene flagged callers.test.mjs:254 as tracker-ref:issue-reference.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton disabled auto-merge October 19, 2026 17:23
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 6855c83 Oct 19, 2026
25 checks passed
@kyle-sexton
kyle-sexton deleted the fix/fix-ci-skip-handled branch October 19, 2026 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pr-pipeline: fix-ci re-dispatches the same two PRs forever when it skips with no failing check

1 participant