From 362a9243d75de39c2161b5dce7d3b15b09b7403a Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sat, 7 Nov 2026 07:38:35 -0500 Subject: [PATCH 1/2] ci: measure coverage at the PR head that Codecov receives The coverage job checks out the merge of the PR head into the base branch, but codecov-action uploads the report under the PR head SHA. When the base branch has commits the PR lacks, Codecov reads the merge tree's coverage at the head's line numbers and flags the wrong lines. Same change as apache/datafusion-sqlparser-rs#2832. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a4ce0e2a67115..9577ee81e9360 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -432,6 +432,11 @@ jobs: - uses: runs-on/action@284bff869d4a825f778ac7c38e50f1e31ef198fd # v2.6.0 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + # Measure coverage at the PR head commit, not the merge commit. + # codecov-action uploads reports under the PR head SHA, so coverage + # measured on the merge of the PR into main is attributed to the + # wrong line numbers whenever main has commits the PR lacks. + ref: ${{ github.event.pull_request.head.sha || github.sha }} submodules: true fetch-depth: 1 - name: Setup Rust toolchain From 3014f462a8a0ee7345a4b2cdc9d83fadbb2db397 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sat, 7 Nov 2026 14:33:31 -0500 Subject: [PATCH 2/2] Trim comment Co-Authored-By: Claude Fable 5.1 --- .github/workflows/rust.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9577ee81e9360..20e6c2f66dfdf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -433,9 +433,6 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: # Measure coverage at the PR head commit, not the merge commit. - # codecov-action uploads reports under the PR head SHA, so coverage - # measured on the merge of the PR into main is attributed to the - # wrong line numbers whenever main has commits the PR lacks. ref: ${{ github.event.pull_request.head.sha || github.sha }} submodules: true fetch-depth: 1