Skip to content

perf(ci): scope a release merge group's test selection to the release diff - #12781

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12633-41586606124-1
Nov 3, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-12633-41586606124-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Refs: #12633

Summary

Opened by the work-resolve-issue lane. The run's own summary:

scripts/resolve-diff-base.sh used to give a merge group no diff base, and so a whole-tree run, whenever the group's diff touched a plugin or marketplace manifest, as a release does. It now gives every merge group with a usable base the queue's base SHA, so the test plan and every diff-scoped gate select only what the release diff touches. That matches how the release pull request's own pull_request run is already scoped. The fix is in the resolver, not the workflow, because the resolver alone decides when a group falls back to the whole tree (pr-require-checks.yml calls it once and every diff-scoped step reads its output). The --check-release step is unchanged: it passes merge_group.base_sha straight from the event and has no if:, so it still runs on every merge_group commit.

Remaining work

  • Measure release merge-group run-hours per day for 7 days before and 7 days after this merges, and post both here. This needs the Actions run history, and the after window only starts once this PR merges.

Not verified

  • scripts/resolve-diff-base.test.sh was not executed: this lane runs no test runner or interpreter. It is left to the PR's CI (test-bash), where the affected-suite selector picks it up because its subject changed.
  • Two comments in .github/workflows/pr-require-checks.yml still state the old rule: lines 1018-1020 ('unless its diff touches a plugin or marketplace manifest, as a release does') and lines 3976-3979 ('no usable base, or a manifest change'). The lane cannot write that path (protected), and the…
  • Tidy skipped: the change touches the shared path scripts/ and spans two areas (scripts, docs), past the 1-area cutoff.
  • Build and lint not run separately: this lane runs no ShellCheck/shfmt; the PR's lint-shell job covers the two shell files.
  • Residual risk the review flagged: scripts/affected-tests.sh maps plugin.json and CHANGELOG.md to no suite, so a version-sensitive suite without a test-scope line would now be caught by the scheduled whole-tree run after a release merges, not in the queue. The suites the review sampled read the…

Fix

  • scripts/resolve-diff-base.sh: removed the manifest-diff branch that sent a release merge group to the whole tree; the header now says a release group is scoped like any other and its release gates take their own base.
  • scripts/resolve-diff-base.test.sh: the plugin.json and marketplace.json merge-group cases now expect the queue's base as the ref instead of the whole tree.
  • docs/ci-runner-routing.md: 'What each event tests' now says a release group is scoped the same way and that the --check-release gate step still runs on every merge-group commit.

Verification

The runner ran each check from the base copy against ce68929:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 13 fragments valid (no plugin changed, so no fragment is owed)
  • .lane/checks/bin/check-changed-skills: no changed skills, nothing to gate
  • .lane/checks/bin/check-affected: 11 passed, 4 skipped over 3 changed files (run before and after the review fix)
  • .lane/verify/bin/cant-fail-scan --file scripts/resolve-diff-base.test.sh --check: PASS, no gating findings
  • Read .github/workflows/pr-require-checks.yml:2589-2618: the changelog_fragments_release step has no if: and calls --check-release with MERGE_GROUP_BASE_SHA from the event, never lane_base, so scoping the diff base leaves it running on every merge_group commit
  • Read every lane_base / steps.base.outputs.ref consumer in pr-require-checks.yml (markdownlint, skill-count claims, fixture isolation, ShellCheck, cant-fail scans, validate-plugins, detector-eval coverage, check 25, evals quality, docs-only detection, plan-test-lanes): each handles a base…
  • Fresh-context review subagent over the whole diff: no correctness findings; one doc-wording nit, fixed; two stale comments in the protected workflow file, listed in not_done
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41586606124

Left out: the items under Not verified.

Related

#12633

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed ce68929ec0fe61864d98e6b375fa7baf8fbdb234: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read every hunk in all 3 changed files: docs/ci-runner-routing.md, scripts/resolve-diff-base.sh and scripts/resolve-diff-base.test.sh. None of them matches a trusted-path glob.

What changed. resolve-diff-base.sh no longer sends a merge group to the whole tree when its diff touches .claude-plugin/marketplace.json or plugins/*/.claude-plugin/plugin.json. Every merge group with a usable base now gets ref=<merge_group.base_sha>. The fail-closed fallbacks are unchanged: a base that is missing or malformed, or not an ancestor of HEAD, still means the whole tree (resolve-diff-base.sh#L36-L38).

Paths checked

  • Is this a trust-control or merge-hold change? No. The resolver is not one of the trust controls or merge holds this lane covers. Those are check-trusted-trigger, request-lane-token, check-kill-switch, resolve-config, merge-holds and the related scripts, the ci-status hold steps and babysit_risk. The PR widens no trusted actor and no token scope, and it lets no new untrusted text reach a lane.
  • Does a manifest change in a merge group escape the diff-scoped gates? No. The group's base is a SHA from the event, validated against ^[0-9a-f]{40}$ and checked as an ancestor of HEAD. A changed manifest is still inside the diff that every DIFF_BASE consumer in pr-require-checks.yml selects from (the steps.base.outputs.ref and needs.select-tests.outputs.lane_base uses at L915–L4004). So the manifest-validating gates still see the changed manifests. The pull request's own pull_request run was already scoped this way (origin/$BASE_REF), so no group can carry a change that its PR run did not check under the same scoping.
  • Injection. base is regex-checked before it reaches git or $GITHUB_OUTPUT. The removed code was the only other place that used it.
  • Instruction surface. No standing instruction, hook allowlist or skill body is touched. The doc and comment edits only describe the new behaviour.

Not a security finding: release merge groups no longer run the whole test tree in the queue. The scheduled whole-tree run still catches anything missed. This is test coverage, not security.

Spend: this reduces Actions run-time on release merge groups. It starts no billed resource, so there is no cost hold.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed ce68929ec0fe61864d98e6b375fa7baf8fbdb234: read 3 of 3 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #12781 (no findings)

I read the whole change in all 3 files: scripts/resolve-diff-base.sh, scripts/resolve-diff-base.test.sh and docs/ci-runner-routing.md. Nothing reaches the high-signal bar.

What the change does. Before this PR, a merge group whose diff touched a plugin or marketplace manifest fell back to testing the whole tree. That branch is gone. Every merge group with a usable base_sha now diffs against the queue's base. Two fallbacks to the whole tree remain: a missing or malformed SHA, and a base that is not an ancestor of HEAD. A release's own pull_request run already diffs against origin/$BASE_REF, so the merge group now matches it.

What I checked against the code at head:

  • Resolver. It still exits 0 on every path and still writes no ref for the whole tree. The edited header comment matches the code.
  • The --check-release claim in the docs holds. The step at pr-require-checks.yml#L2589-L2618 has no if:. It reads MERGE_GROUP_BASE_SHA straight from the event, not steps.base.outputs.ref, so it still runs on every merge-group commit.
  • Tests. The two manifest cases now expect $PRE as the ref and the "the merge group's base" notice. Each PRE is captured before its commit, so it is a real ancestor and the assertions can fail.
  • Removed log text. Nothing else in the repository greps for the deleted notice. The only other mention of the old rule is a comment, covered in the note below.

Note (not counted as a finding). Two comments in .github/workflows/pr-require-checks.yml still describe the old rule:

  • L1018-L1023 says "unless its diff touches a plugin or marketplace manifest, as a release does".
  • L3976-L3979 says "no usable base, or a manifest change".

The PR description already lists both as not done because that path is protected from the lane. A person needs to update them in a follow-up so the workflow's description of the resolver matches it again.

Residual risk (the author disclosed it; I'm not flagging it). scripts/affected-tests.sh maps plugin.json, marketplace.json and CHANGELOG.md to no suite through a mention. A version-sensitive suite with no declared test scope will now only be caught by the scheduled whole-tree run after a release merges, not in the queue. This tradeoff is deliberate and stated in the PR.

Verification status. I ran nothing; this lane has no shell. The PR says the test file was not executed by its authoring lane and is left to CI's test-bash. That is author-claimed and unverified here.

PR context. The PR only references #12633 and closes no issue, so there are no acceptance criteria to check. I found no embedded instructions in the PR context.

Spend. This change reduces CI runner time on release merge groups. It adds no charge.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 75b2dae Nov 3, 2026
44 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-12633-41586606124-1 branch November 3, 2026 08:21
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.

1 participant