Repository navigation
feat(pr-require-checks): run ci-status and its lanes on merge_group - #820
Merged
Merged
Conversation
Add `merge_group: { types: [checks_requested] }` so a required merge queue
gets a ci-status report on the group head instead of waiting out the check
timeout. The contract-only predicate is already false without a pull request
payload, so every aggregated lane runs in full; the Claude review lanes and
the Dependabot arm stay pull_request-only and advisory.
check-contract gains a merge-group path: it reads the queued pull request
number from the gh-readonly-queue head ref, fails when that pull request
carries the do-not-merge label, skips title and linkage, writes nothing, and
fails closed on an unparsable ref or an unreadable pull request.
gitleaks git mode scopes a merge group to merge_group.base_sha..HEAD, and the
ci-status sha default names merge_group.head_sha explicitly.
Refs: #661
Co-Authored-By: Claude Opus 5.5 <[email protected]>
kyle-sexton
marked this pull request as ready for review
October 20, 2026 19:27
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. |
…LGREEN A merge-group run now applies the Conventional Commits title check to the queued pull request as well as its live do-not-merge label, since either can change after enqueue; linkage stays skipped and nothing is written. The head ref names only the group's last pull request, so document that the merge queue must use grouping_strategy ALLGREEN: under HEADGREEN an earlier entry that failed, a do-not-merge one included, can still merge. Refs: #661 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 20, 2026
kyle-sexton
added a commit
that referenced
this pull request
Oct 20, 2026
…group (#823) Closes #710 ## Summary In a `merge_group` run, `check-managed-files` passed without checking anything. The payload carries no pull request, so `base-ref` and `head-ref` both resolved to `github.sha` and the mode step fell through to `hand-edit`. `run.sh` then diffed an empty range and printed "No managed-file hand-edits in this diff". claude-code-plugins' gating job already runs on `merge_group`, so the gap is live there today. ## Fix The action now handles the merge group itself, so callers need only a pin bump. - **Mode step.** On `merge_group` it selects `merge-group`. The pull-request steps' gates are unchanged, so non-`merge_group` events behave as before. - **New step `Map the merge group to its pull requests`** (`merge-group.cjs`, via github-script): - Parses `pr-<N>` from `gh-readonly-queue/<base>/pr-<N>-<sha>`, using the same pattern as `check-contract/run.sh`. An unparsable ref fails and the error names the ref. - Reads each pull request with `pulls.get`. A stack lands as one group, so while a pull request targets another branch instead of the queue's base, it finds the single open pull request from that branch and continues down to the base. - Selects each pull request's mode by the mode step's rules. A parity test holds the bash and JS copies together. - **Hand-edit:** its own `pulls.listFiles` paths, both sides of a rename included, are checked against the managed set by `run.sh`, through the new `CHANGED_PATHS_FILE` input. - **Dependabot:** skipped only when its commits pass the existing Dependabot check against its own `head.sha`. - **Sync:** must be queued alone. Its commit identity is re-checked, and `verify-sync.sh` verifies the group's `base_sha...head_sha` against standards `main` as resolved at run time. - Fails closed when: - the ref cannot be parsed; - `pulls.get`, `pulls.list` or `pulls.listFiles` fails; - the file list reaches the 3000-file API cap; - the walk does not reach the base; - a sync pull request shares its group; - any path in `merge_group.base_sha...head_sha` belongs to none of the group's pull requests. - **README.** Documents merge-group behavior and the `grouping_strategy: ALLGREEN` requirement, as check-contract's README does. - **Dogfooding.** ci-workflows' own advisory `check-managed-files` job now also runs on `merge_group`. It is still outside `ci-status`, and its contract-only predicate is unchanged. **Security review requested.** This changes a trust-boundary guard. #710 rates the risk LOW. Please review the fail-closed paths in `merge-group.cjs` and the stack walk in particular. ## Verification - `node --test .github/scripts/*.test.cjs`: 496/496 pass. - `node --test .github/actions/*/*.test.cjs`: 101/101 pass. - New tests in `.github/scripts/check-managed-files-sync.test.cjs` exercise `resolveMergeGroup` against a real git fixture and then run `run.sh` or `verify-sync.sh` as the action does: - an unparsable ref fails, naming the ref; a `pulls.get` failure fails; - a sync pull request that matched standards main passes, and fails once standards main moves past it; - a sync pull request with foreign commits fails; - a hand-edit pull request touching a managed path fails. The test also shows that the pre-fix head-only diff passes the same fixture; - a non-sync pull request touching no managed path passes; - a verified Dependabot pull request is skipped; - in a two-PR stack, a managed edit in either pull request fails and names only that pull request; - a group path in neither pull request fails closed; a stack whose base has no open pull request fails closed; a sync pull request sharing its group fails closed. - `.github/scripts/check-managed-files-skip.test.cjs`: - the mode step yields `merge-group` on `merge_group`; - the bash and JS mode rules agree across the existing case table; - the gate assertions cover the new steps. - shellcheck (scripts and composite `run:` blocks via `composite-run-shellcheck.sh`), actionlint, `zizmor --offline` (no findings), shfmt, `biome ci .github/scripts` and markdownlint: all clean. ## Related - Refs #661: merge_group support, part 1 landed in #820. This PR copies #820's queue-ref pattern and does not edit `check-contract/run.sh`. - Refs #729: it touches the same mode step, but its fix lands in dotfiles, so no ci-workflows change is expected. - The queue must use `grouping_strategy: ALLGREEN`: the head ref names only the group's last pull request. - claude-code-plugins picks this up after a ci-workflows tag and a pin bump there. Its `check-managed-files` job comment ("A merge group … passes") becomes stale at that bump. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
kyle-sexton
added a commit
to melodic-software/standards
that referenced
this pull request
Oct 20, 2026
…hape (#825) Refs: melodic-software/ci-workflows#736 ## Summary `check-pr-convention-copies` fails on every standards PR and on `main` ([job](https://github.com/melodic-software/standards/actions/runs/39484573331/job/118841536250)). [ci-workflows#815](melodic-software/ci-workflows#815) rewrote two parts of `check-contract/run.sh` that the static parsers in `lockstep-drift.mjs` anchor on. The behavioral tests still passed; only the text parsers broke: - `drift: gate composite: closing-keyword / no-issue-marker match expressions not found in run.sh` - `drift: gate composite (negated closers): negation_trigger's window, "not only" exception, trigger words, or suffix test not found in run.sh` ## Fix - Keyword scan: the parser now also accepts the #815 form, where `scan_line` applies `closing_regex` in one pass (`marked = lower`, `gsub(closing_regex, "\n&\n", marked)`, `count = split(marked, pieces, "\n")`). The `match(chunk, closing_regex)) break` loop is no longer required. Before, the scan had to run over the lowercased line; it still must. - Negation window: the parser accepts either shape, and each must keep all of its anchors. - Pre-#815: `first = (count > N) ...`, unchanged. - #815: `++seen == N) break` plus the window slice `tail = substr(line, start, keyword_index - start)`. The punctuation set (`. ! ? ; ,`) is left to the behavioral layer, as before; an existing test asserts that changing it is behavioral drift only. `N` is still compared against `policy.json`'s `wordWindow` (5). The "not only" exception, the trigger words and the `n't` suffix test are read as before. - The pre-#815 shape stays accepted. Older consumer pins still run it, and so does the head of [ci-workflows#820](melodic-software/ci-workflows#820). - New fixture `fixtures/lockstep/check-contract-run-bounded-scan.sh.txt`: the #815 run.sh, plus the `spellchecker:ignore-next-line` comment the existing fixture carries. New tests: - The #815 fixture passes `checkPinnedComposite` and `checkCopies`, and the negation parser reads the policy values from it. - Each new anchor, mutated away, is drift: window 5→4, an unbounded slice, `gsub` applied to a different regex, and `marked` taken from the raw line. A dropped `,` stop is behavioral drift. ## Verification - `npm run lint:pr-convention-copies` against live ci-workflows `main`: `every copy matches policy.json`. - `checkPinnedComposite` on each run.sh, with that ref's `action.yml`, ran locally: 0 findings for ci-workflows `main`, for #820's head `f43d19ee492d3f8f53e72109023cb50071f92b0c`, and for the pre-#815 parent of `cc7613fbf8bacca72700d6498c32145c05fe1f09`. - New mutation test: passes locally. - `npm run test:pr-convention-lockstep`: not green locally. The host was overloaded (load average 83 on 32 cores), so the hook validator's behavioral harness hit its 10s limit (`the validator did not finish within 10s`). That harness also threw one `spawnSync bash EPIPE`. Neither involves the composite parsers. CI's hermetic run on this PR is the authoritative result. - Pre-commit hooks passed: editorconfig, typos, biome, gitleaks. ## Related - [ci-workflows#815](melodic-software/ci-workflows#815): the rewrite this tracks. - [ci-workflows#820](melodic-software/ci-workflows#820): merge_group title check; its head parses under this change. - [standards#822](#822) - [ci-workflows#736](melodic-software/ci-workflows#736) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: #661
Summary
Part 1 of #661:
pr-require-checks.ymlnow runs onmerge_group(checks_requestedonly), soci-statusreports on the merge-group commit once a queue is required. This PR does not turn the queue on; that is part 2,UsesMergeQueuefor ci-workflows in github-iac.Fix
pr-require-checks.yml: addsmerge_group: { types: [checks_requested] }. No job gate needed changing. A merge-group payload has nogithub.event.pull_request, so the contract-only predicate is false and every laneci-statusaggregates runs in full. The concurrency group falls back togithub.run_id, so queued runs never cancel each other.pr-review,pr-review-securityandpr-automerge-dependabotkeep theirgithub.event_name == 'pull_request'gate, so they stay off on merge groups and stay advisory.check-managed-filesis still pull_request-only; its merge-group handling is check-managed-files: re-verify sync PRs in merge-group runs #710.check-contract: a merge-group path. It reads the queued PR number frommerge_group.head_ref([refs/heads/]gh-readonly-queue/<base>/pr-<N>-<40-hex>) and re-reads that PR live. It re-runs the Conventional Commits title check and fails when the PR carries thedo-not-mergelabel, so the queue drops it; either can change after enqueue. It reportslinkageasskippedand writes no comment or label. The head ref names only the group's last PR, so the README states the queue must usegrouping_strategy: ALLGREEN. It fails closed when the ref cannot be parsed or the PR cannot be read.pr-numberis ignored onmerge_group.aggregate-results: theshadefault is nowpull_request.head.sha || merge_group.head_sha || github.sha. On a merge group,github.shais already the group head, so this only names it explicitly.ci-lanesis recorded on the group commit, where theci-statuscheck run also reports.gitleaksgit mode: a merge group defaults tomerge_group.base_sha..HEAD, the same way a PR uses its base SHA. A missing base SHA fails closed. This repo's own dogfood scans indirmode, so this change affects git-mode consumers only.actions-expression.cjs(test helper): addsfromJSON,cancelled()(always false) and element-wisecontainsover arrays. With these, the test can evaluate the real job gates under a merge-group context.Verification
node --test .github/scripts/*.test.cjs: 479 pass, 0 fail. New tests inci-fanout-consolidation.test.cjs:merge_groupwithchecks_requestedonly;ci-status'sneeds, andci-statusitself, evaluatestrue;false;pr-require-checks-<run_id>.&& github.event_name == 'pull_request'toruff's gate fails the lanes test, which namesruff.node --test .github/actions/*/*.test.cjs: 88 pass, 0 fail.check-contract/run.test.sh: all pass. The new cases runrun.shitself:do-not-mergefails;refs/heads/main, non-numeric PR, short SHA) fail closed with no API call;run.sh, every new case fails.aggregate-results/run.test.shandgitleaks/scan.test.sh(newmerge_grouprange case and missing-base case): pass.actionlint: clean.zizmor --offline .: no findings.shellcheck,shfmt -d,composite-run-shellcheck.shand Biome 2.5.11ci .github/scripts: clean.ci-statuson a real merge-group commit. That needs the queue from part 2.Live probes on pr-pipeline-sandbox (queue:
merge_method: SQUASH,ALLGREEN)--match-head-commit: refused, not enqueued. In #180, the first headb85280cwent green. I then pushedec7de8d, waited until every check on it was green, and rangh pr merge 180 -R melodic-software/pr-pipeline-sandbox --match-head-commit b85280cc18966310e6fcabd0bd4759a5e72e7e43(gh 2.102.0):isInMergeQueue: falseandautoMergeRequest: null, so the queue path enforcesexpectedHeadOid. An earlier try, while checks onec7de8dwere still pending, was stopped by the local guardrailsblock-unresolved-pr-mergehook before it reached GitHub.0e01991was green. The local Claude Code permission system deniedgh pr merge 181 -R melodic-software/pr-pipeline-sandbox --merge --match-head-commit 0e019915a7a063f3b7fc0e45596e24f599699c62before it reached GitHub:Permission to use Bash with command ... has been denied.No other shape was tried. refactor: extract shared find-tracking-issue core into one generated source #181 was closed unmerged.Both probe PRs are closed and their branches deleted.
Related
UsesMergeQueue: truefor ci-workflows) stays open and follows this PR.check-managed-filesmerge-group handling, out of scope here.🤖 Generated with Claude Code