Carryforward flags not working as expected

Hello!

I am in the process of setting up carryforward flags so that I can run only relevant tests in a build.
We have a monorepo, which has several projects, but only two projects are tested, frontend and backend.

I have set up my CI to only run frontend or backend tests if respective files have changed, so only relevant coverage is reported to CodeCov.
Now, for a PR, if only frontend tests are run, I expect that backend test coverage will be carried froward from the last commit of master, but it looks like it’s trying to carry it from the last commit on the branch the PR is on, because of which I am getting 0% coverage from backend flag and hence my PR check is failing.

It’s a private repo, but if it helps to debug, the latest commit SHA on my test branch is 0669d83f971cba046eb9faf1a8f713547b9a1b5e.

My codecov.yml is as files:

coverage:
  status:
    project:
      default:
        target: 65%
        threshold: 0.1%
      backend:
        target: 78.92%
        flags:
          - backend
      frontend:
        target: 54%
        flags:
          - frontend
flags:
  backend:
    paths:
      - packages/backend/
    carryforward: true
  frontend:
    paths:
      - packages/webapp/
    carryforward: true

Previosly, I did not have these carry forward flags, and everything was working as expected.

@tom can you help? :slight_smile:

@tayyab-anwar, I shot you back a DM. Responding here so you see it just in case.

We’re also experiencing this. Where a project had no coverage update, it shows as 100% in the comment and the coverage fails to carry over from master as expected. Here’s our YAML:

codecov:
  range: 25...60
  max_report_age: 24
  status:
    project:
      default:
        target: auto
        threshold: 1%
        flags:
          - mrsup.com
          - manage.mrsup.com
          - sup-ui
          - api
    patch:
      default:
        target: auto
        threshold: 20%
        if_not_found: success
        flags:
          - mrsup.com
          - manage.mrsup.com
          - sup-ui
          - api

flags:
  mrsup.com:
    paths:
      - front-end/packages/mrsup.com/
    carryforward: true
  manage.mrsup.com:
    paths:
      - front-end/packages/manage.mrsup.com/
    carryforward: true
  sup-ui:
    paths:
      - front-end/packages/sup-ui/
    carryforward: true
  api:
    paths:
      - api/
    carryforward: true
codecov:
  max_report_age: 24

coverage:
  range: 25...60
  status:
    project:
      default:
        target: auto
        threshold: 1%
        flags:
          - mrsup.com
          - manage.mrsup.com
          - sup-ui
          - api
    patch:
      default:
        target: auto
        threshold: 20%
        if_not_found: success
        flags:
          - mrsup.com
          - manage.mrsup.com
          - sup-ui
          - api

flags:
  mrsup.com:
    paths:
      - front-end/packages/mrsup.com/
    carryforward: true
  manage.mrsup.com:
    paths:
      - front-end/packages/manage.mrsup.com/
    carryforward: true
  sup-ui:
    paths:
      - front-end/packages/sup-ui/
    carryforward: true
  api:
    paths:
      - api/
    carryforward: true

@grrowl, you can validate your YAML here