Skip to content

[ci] Codecov project check fails with false coverage drop on single-module PRs #2264

@jhagberg

Description

@jhagberg

Describe the bug

PRs that only modify files in one Go module (e.g. sda/) cause the codecov/project status check to report a large coverage drop (~18%). This is a false negative — the actual code coverage is fine (codecov/patch passes), but Codecov sees fewer uploads on HEAD than on BASE and treats missing modules as zero coverage.

Root cause: all four test jobs in .github/workflows/test.yml upload to the same unittests flag without carryforward enabled. There is no codecov.yml config in the repo.

Steps to reproduce

  1. Open a PR that only touches files in sda/ (e.g. PR feat(download): new v2 download service replacing sda-download #2187)
  2. All CI test jobs run and upload coverage
  3. codecov/project reports ~-18% coverage drop and fails
  4. codecov/patch passes (all modified lines covered)

Expected behavior

  • codecov/project should not fail when coverage for unchanged modules is unchanged
  • Add codecov.yml with carryforward: true on the unittests flag (or split into per-module flags)

Additional context

Proposed minimal fix — add codecov.yml at repo root:

coverage:
  status:
    project:
      default:
        threshold: 1%
    patch:
      default:
        target: auto

flags:
  unittests:
    carryforward: true

Alternative: split into per-module flags (unittests-sda, unittests-sda-download, etc.) for more granular tracking.

Estimation of size

small

Estimation of priority

low

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions