From 6fe5680efab609a5a4f48dcdafa9b9cd1ef5746e Mon Sep 17 00:00:00 2001 From: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com> Date: Fri, 7 Aug 2026 05:22:18 -0700 Subject: [PATCH] Give each example lane its own Codecov flag Every example lane uploaded under a shared `examples` flag. That was fine while all lanes ran on every PR, but #2090 gates them independently, and carryforward only applies to a flag with no upload on the commit. With a shared flag a single-lane PR uploads that flag as present but partial, so Codecov replaces the whole picture with the subset that ran and reports a coverage drop for code the PR never touched. One flag per example (examples-) restores the intent: a lane that skips has no upload for its flag and is carried forward, while a lane that ran replaces only its own slice. gpu_tests keeps a single `gpu` flag: its suites are gated at workflow level, so they upload together or not at all. It would need the same treatment if per-suite gating is ever added. Co-Authored-By: Claude Opus 5 Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com> --- .github/codecov.yml | 9 ++++++--- .github/workflows/_example_tests_runner.yml | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 3c8819a15fe..e93736b5c2c 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,6 +1,9 @@ -# Flags partition coverage by test suite. carryforward ensures that if GPU tests are skipped -# on a PR (no relevant file changes), their coverage from the last nightly run is reused so -# the comparison is not penalized for the missing upload. +# Flags partition coverage by test suite, and the example lanes carry one flag each +# (examples-) since they are gated independently. carryforward reuses the last run's +# coverage for any flag with no upload on this commit, so a PR that skips a suite or a single +# example lane is not penalized for the missing upload. A flag shared across independently +# gated jobs would defeat this: the flag would be present but partial, and carryforward only +# applies when a flag is absent. flag_management: default_rules: carryforward: true diff --git a/.github/workflows/_example_tests_runner.yml b/.github/workflows/_example_tests_runner.yml index c3a9ffa1274..4a77131435f 100644 --- a/.github/workflows/_example_tests_runner.yml +++ b/.github/workflows/_example_tests_runner.yml @@ -92,6 +92,9 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - flags: examples + # One flag per example, not a shared `examples`: carryforward only applies to a flag + # with no upload, so a shared flag would replace every lane's coverage with the subset + # that ran once lanes are gated independently. + flags: examples-${{ inputs.example }} fail_ci_if_error: false # test may be skipped if relevant file changes are not detected verbose: true