Skip to content

fix(pr-pipeline): stop duplicate and pointless lane runs - #7842

Merged
kyle-sexton merged 3 commits into
mainfrom
fix/pr-pipeline-duplicate-lane-runs
Oct 17, 2026
Merged

kyle-sexton merged 3 commits into
mainfrom
fix/pr-pipeline-duplicate-lane-runs

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Closes #7836
Closes #7838
Closes #7839

Summary

Three lane triggers spent runners or model runs that could only duplicate work, skip, or fail. Each now stops before the runner or the dispatch.

Fix

Verification

  • New tests, each run red before its fix and green after:
    • dispatch.test.mjs: skip while a resolve-conflicts run for the PR is queued, in_progress, waiting or pending (mirrors the feedback-dispatch test; the title is read from pr-unblock.yml's run-name); an unreadable listing dispatches nothing. A finished run, another PR's run, or another activity's run does not hold the dispatch. The adapter test checks the runs endpoint.
    • workflow-gates.test.mjs: evaluates each job if: from the workflow file. pr-feedback-dispatch: skipped does not run, success/failure/cancelled do. pr-refine: a standards-sync bot's push, a draft, and the lanes App's own push skip; a human's push (to any PR, bot-opened included) and a dispatch run. Red against both the base if: and an author-type (user.type) variant.
  • npm test in .github/scripts/pr-unblock: 273 pass, 0 fail. .github/actions/check-trusted-trigger: 217 pass. .github/actions/resolve-config: 314 pass.
  • scripts/check-affected.sh --tests: 5 passed, 4 skipped. scripts/affected-tests.sh --run: every selected shell suite passed.
  • actionlint on the four changed workflows: clean. zizmor 1.30.0: no findings.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43

kyle-sexton and others added 2 commits October 17, 2026 18:35
- pr-unblock dispatch.mjs skips a PR while a resolve-conflicts run for
  it is queued or in progress, matched by pr-unblock.yml's run-name the
  way feedback-dispatch.mjs already does; an unreadable run listing
  dispatches nothing.
- pr-feedback-dispatch.yml starts no runner for a review run GitHub
  skipped.
- pr-refine.yml skips fix-docs on pull_request events of a PR a bot
  opened, which claude-code-action refuses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
claude-code-action refuses a non-human actor, so skip fix-docs when
github.event.sender.type is Bot. A human push to a bot-opened PR (a
lanes App PR) still runs fix-docs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01AfcE6qXwStK92XAx21MG43
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 17, 2026 22:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T22:52:41.381639Z 75f0f9d 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 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review needs no new review of 31d20a407cf7b313691af42d7cb8a5fe0362fb68: no file of this pull request changed since the review of 75f0f9d.

No security issues found in PR #7842 at 75f0f9d.

I read the full diff and checked that runTitle is exported from feedback-dispatch.mjs and matches the run-name in pr-unblock.yml. The protected-class list in the instruction exception register was not consulted. The diff changes no standing instruction, so it was not needed.

  • dispatch.mjs:
    • The new listWorkflowRuns is a read-only GET using the existing token and a fixed endpoint.
    • The dedupe only skips a dispatch, so it can't start extra runs. Matching on display_title is not exploitable, because only a user with write access can create workflow_dispatch runs.
    • If the run listing fails, it dispatches nothing and counts a failure.
    • PR numbers and activity strings are only compared, never interpolated into a shell or URL.
  • pr-feedback-dispatch.yml: the added conclusion != 'skipped' condition only stops a runner from starting. It adds no trigger or permission.
  • pr-refine.yml: the added sender.type == 'Bot' condition only narrows when fix-docs runs. The expression reads event context in an if:, not a run: block, so there is no injection. Skipping more bot events removes no control.
  • pr-unblock-dispatch.yml: only a comment changed. actions: write is unchanged.
  • Tests: workflow-gates.test.mjs evaluates the workflow if: expressions with Function(). The inputs are the workflow files in the repo and fixed test values, so it takes no untrusted input.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review needs no new review of 31d20a407cf7b313691af42d7cb8a5fe0362fb68: no file of this pull request changed since the review of 75f0f9d.

No findings on head 75f0f9d. I read the full diff (7 files) and checked the cross-file links against the checkout. I did not run the tests.

  • dispatch.mjs in-flight skip: runTitle is exported from feedback-dispatch.mjs:81 and builds pr-unblock <activity> #<n>. That matches the run-name in pr-unblock.yml. dispatchConflicting doesn't send an activity input, but the workflow's activity input defaults to resolve-conflicts, so the display_title it matches is the one GitHub assigns. A failed run listing returns before any dispatch and counts as one failure.
  • Known gap, author-documented: listWorkflowRuns reads only the newest 100 workflow_dispatch runs. The code comment says this is deliberate.
  • pr-refine.yml gate: the added github.event.sender.type == 'Bot' clause sits inside the existing !(github.event_name == 'pull_request' && (... || ...)). The grouping is right: workflow_dispatch is unaffected and a draft is still skipped.
  • pr-feedback-dispatch.yml gate: conclusion != 'skipped' is a plain added conjunct.
  • Tests: workflow-gates.test.mjs extracts the folded if: with a regex that tolerates the leading comment lines in both jobs. Its context-substitution evaluator handles the operators these two gates use. The new dispatch.test.mjs cases cover each in-flight status, a finished run, another PR's run, another activity's run, and a listing failure. The adapter test covers the new endpoint URL.
  • Not verified: the test suite was not run in this lane, so test results are unverified.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit ef8b1d4 Oct 17, 2026
29 checks passed
@kyle-sexton
kyle-sexton deleted the fix/pr-pipeline-duplicate-lane-runs branch October 17, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant