CI test-scope detection diffed changed files with a two-dot `git diff --name-only base head`, where base is the moving tip of `next`. A PR branch cut from a slightly older `next` surfaced every product file `next` had gained since the merge-base, flipping product_changed/full_matrix and running the full Windows/macOS matrix + coverage on docs-only PRs. Switch to a three-dot `git diff --name-only base...head` (vs the merge-base), matching GitHub's PR "Files changed" semantics. Add a regression test that builds a stale-base topology, plus a guard test pinning `fetch-depth: 0` on the `changes` job (required for the merge-base to be locally available). Closes #837 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -289,7 +289,12 @@ function changedFiles(args) {
|
||||
if (!args.base || !args.head) {
|
||||
throw new Error('--base/--head or --files is required');
|
||||
}
|
||||
const stdout = execFileSync('git', ['diff', '--name-only', args.base, args.head], {
|
||||
// Three-dot diff (merge-base...head) matches GitHub's PR "Files changed" semantics.
|
||||
// A two-dot `git diff base head` would surface every file `next` gained after this
|
||||
// branch's merge-base, mis-flagging product_changed/full_matrix on docs-only PRs cut
|
||||
// from a slightly stale base (#837). The `changes` job checks out with fetch-depth: 0,
|
||||
// so the merge-base is always available.
|
||||
const stdout = execFileSync('git', ['diff', '--name-only', `${args.base}...${args.head}`], {
|
||||
encoding: 'utf8',
|
||||
});
|
||||
return splitFiles(stdout);
|
||||
|
||||
Reference in New Issue
Block a user