From e0894cc107d72ffe16c312fc8325f77cce1fa751 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Fri, 17 Jul 2026 01:01:38 -0300 Subject: [PATCH] fix(ci): fetch full base history in pr-test-policy (shallow graft broke merge-base) (#7501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With --depth=1 the base ref is grafted, so 'git diff base...HEAD' resolves a wrong merge-base for PR branches that recently merged the release branch. The three-dot diff then attributes ALREADY-MERGED sibling PRs' changes to the PR under test, producing false high-signal reds (deleted test files / weakened asserts that exist in no ref reachable from the PR). Observed live on #7329: the job blamed it for tests/unit/ui/provider-plan-config.test.tsx (deleted by an unrelated merged PR) and for #7106's antigravity files. Local reproduction with full history returns PASS for the same head. The job's checkout is already fetch-depth: 0, so the full base fetch only updates the ref — negligible cost. --- .github/workflows/ci.yml | 2 +- changelog.d/maintenance/ci-pr-test-policy-shallow-base.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/maintenance/ci-pr-test-policy-shallow-base.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 917ca860aa..d97161e470 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -519,7 +519,7 @@ jobs: with: node-version: ${{ env.CI_NODE_VERSION }} - name: Fetch base branch - run: git fetch --no-tags origin "${GITHUB_BASE_REF}" --depth=1 + run: git fetch --no-tags origin "${GITHUB_BASE_REF}" - name: Validate source changes include tests run: node scripts/check/check-pr-test-policy.mjs --summary-file .artifacts/pr-test-policy.md # Anti test-masking: flag net assert removal / new assert.ok(true) in changed tests. diff --git a/changelog.d/maintenance/ci-pr-test-policy-shallow-base.md b/changelog.d/maintenance/ci-pr-test-policy-shallow-base.md new file mode 100644 index 0000000000..340b60a5ce --- /dev/null +++ b/changelog.d/maintenance/ci-pr-test-policy-shallow-base.md @@ -0,0 +1 @@ +- CI: `pr-test-policy` fetches the base branch with full history instead of `--depth=1` — the shallow graft made `merge-base` resolve wrong for PR branches that recently merged the release, so the three-dot diff blamed the PR for OTHER merged PRs' changes (false "deleted test"/"weakened asserts" reds; observed on #7329 being blamed for #7106's files).