From 10e3f6977eb5357e4c056d121cc81ddb9bc0fa70 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Sat, 24 Oct 2026 12:04:58 -0700 Subject: [PATCH] fix: package E2E coverage against tested revision (#21904) ## Summary Package E2E coverage against the same candidate revision that setup builds and Playwright exercises. PR workflows previously rendered merge-ref coverage against the unmerged PR head, so unrelated base changes could make genhtml fail with out-of-range lines. Across 19 recent main-targeting PR heads with a completed package job, 7 were red; 6 had the same genhtml range signature across unrelated source files. In run 40087675110, setup built merge commit 165fb9a while packaging checked out head ed221f1; ErrorOverlay.vue had 105 versus 102 lines respectively, while coverage referred to line 103. ## Verification - Regression: targeted test failed on the old source_sha expression and passes after the change (25/25). - Exact artifact control: the 16 shard artifacts from run 40087675110 fail under LCOV 2.4 against ed221f1 with the reported ErrorOverlay.vue line-103 range error, and pass unchanged against tested merge SHA 165fb9a. - actionlint and yamllint pass for ci-tests-e2e.yaml. - Focused oxfmt and oxlint pass. - Pre-commit and pre-push hooks pass under the repository Node 26 runtime. --- .github/workflows/ci-tests-e2e.yaml | 2 +- scripts/cicd/package-e2e-coverage.test.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-tests-e2e.yaml b/.github/workflows/ci-tests-e2e.yaml index 6882b9441ec..5ee682ff64d 100644 --- a/.github/workflows/ci-tests-e2e.yaml +++ b/.github/workflows/ci-tests-e2e.yaml @@ -469,7 +469,7 @@ jobs: }} uses: ./.github/workflows/ci-tests-e2e-coverage-package.yaml with: - source_sha: ${{ github.event.pull_request.head.sha || github.sha }} + source_sha: ${{ github.sha }} # A shard that died partway still uploads a tracefile, and one that # produced none fails its own upload, so the matrix verdict is what # makes the merge trustworthy for trend reporting. diff --git a/scripts/cicd/package-e2e-coverage.test.ts b/scripts/cicd/package-e2e-coverage.test.ts index 3f1ccbb9893..46cd4837be7 100644 --- a/scripts/cicd/package-e2e-coverage.test.ts +++ b/scripts/cicd/package-e2e-coverage.test.ts @@ -356,6 +356,16 @@ describe('completeness gate wiring', () => { ) }) + it('packages coverage against the revision exercised by the workflow', () => { + const job = field( + readWorkflow('.github/workflows/ci-tests-e2e.yaml'), + 'jobs', + 'upload-e2e-coverage' + ) + + expect(field(job, 'with', 'source_sha')).toBe('${{ github.sha }}') + }) + it('gates the saved E2E baseline on a whole merge', () => { const steps = jobSteps( readWorkflow('.github/workflows/coverage-slack-notify.yaml')