Repository navigation
ci: the merge-queue reuse decision is built and run from the base commit - #866
Merged
Merged
Conversation
Addresses #826. Build and run the reuse judge in a separate base-commit worktree outside the workspace, using the base's global.json. Rule 5 now guards .github/ only.
…and its one executed command Review fix-ups for #826. The gate now asserts that QUEUE_BASE comes from merge_group.base_sha, that the judge worktree is added in the fail-closed "if ! git worktree add ...; then" form, that only the "Decide reuse" step runs a dotnet command, that this command is exactly the base's tool run (a commented copy or a relative path out of the judge fails), and that the job never names github.workspace. The redundant checkout path check is gone: the working-directory assertion already catches a judge placed anywhere else. quality-gates.md says a PR is judged by the base's tool and rules, and that the workflow calling the judge comes from the group's tree, so a workflow change is covered by review.
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.
📝 Description
What does this PR do?
The merge-queue reuse decision is now built and run from the merge group's base commit instead of from the group's own tree, so a pull request can no longer change the judge that decides whether its green PR run can be reused. With that, the self-vouching guard shrinks from eight paths to
.github/only. SDK pin moves and dependency refreshes (global.json,Directory.Packages.props,tools/,Directory.Build.*,nuget.config) can now skip the second full CI run when the queue tests the exact tree their PR run already tested.ci.yml,reusejob only:git worktree add --detach "$RUNNER_TEMP/judge" "$QUEUE_BASE"; a failed add refuses withunavailable judge;global.json, and "Decide reuse" runs withworking-directory: ${{ runner.temp }}/judge;$RUNNER_TEMP, a sibling of the workspace, on purpose: MSBuild, NuGet and the SDK resolver search parent folders forDirectory.Build.*,Directory.Packages.props,nuget.configandglobal.json, so a judge inside the group's checkout would import the group's files.MergeGroupReuseDecision.IsGuarded(rule 5) now matches.github/only, case-insensitively. Permissions are unchanged:contents,actionsandpull-requestsread. No secret is added.quality-gates.mdandworkflow.mddescribe the base-commit judge.Design check: #826 (comment)
Related Issue(s):
🔄 Type of Change
🎯 Protocol & API Surface
spec/) is untouchedexternal/was hand-edited🧪 Testing
MergeGroupReuseCommandTests):.github/rows now expectall rules hold, and a rootDirectory.Packages.propsrow is added;tools/example.cs+different-treeandDirectory.Packages.props+different-base-treeshow that rule 4 still demands the exact tested tree;.github/rows stay rule 5.CiMergeGroupReuseTests), against the realci.yml, asserts:QUEUE_BASEcomes frommerge_group.base_sha;if ! git worktree add …; thenform;global.json;dotnet, with exactly the base tool's command, from the judge;HEAD;QUEUE_BASEfromgithub.sha;|| trueafter the add;global.json;dotnet tool restorein the workspace, both one-line and as a block;IsGuardedback to the old eight-path list (fails 12 decision rows).ci.ymlread helpers moved out ofCiBenchmarkGuardTestsinto a sealedCiWorkflow(IFileSystem); its assertions are unchanged.Test Environment: Windows (UNDERDARK), SDK 11.0.100; the Tools project on net10.0.
✅ Completion Gate
quality-gates.mdpasses: slopwatch, the Release build (0 warnings), both format passes,verify-clones(0 new clones), andOpenCode.Sdk.Tools.TestsexceptNativeAot(2791/2791), on the rebased head.OpenCode.Sdk.Testsis untouched.📚 Documentation
docs/engineering/quality-gates.md(the reuse paragraph) anddocs/engineering/workflow.md(its relay)CHANGELOG.mdentry: CI only, nothing a consumer sees✅ Code Quality Checklist
master🔍 Additional Notes
What to check on this PR's own merge group: this PR touches
.github/, so the queue judges it with the current base's tool and must answerrule 5: guarded pathand run in full. The reuse job should end success with that reason, not failure. That is the first live proof that the judge builds in the worktree. The first later pin or dependency PR should reportall rules hold.Review: the change had an independent Grok 4.7 review and an independent Opus review. Neither found a way for the group's tree outside
.github/to reach the judge, and both walked every failure path to the full run. Their test findings are folded into the second commit.🎯 Reviewer Focus Areas