__init__.py suddenly being ignored in reports

Description

Coverage for __init__.py is suddenly being ignored in reports uploaded to codecov. I still get coverage for these files in the locally generated coverage output. It’s only when I view the report online that these files seem be ignored.

This started happening about 6 days ago following this totally innocuous commit on my repo: Release v3.15.3 · lexicalunit/spellbot@ff593b8 · GitHub

Repository

CI/CD

GitHub Actions

Uploader

Commit SHAs

Codecov YAML

I don’t have any codecov.yml file. I do have a .coveragerc file though if that matters:

[run]
branch = True
source = src/spellbot
omit =
    src/spellbot/_version.py
    src/spellbot/versions/env.py

[report]
ignore_errors = True
exclude_lines =
    pragma: no cover
    raise NotImplementedError
    if __name__ == .__main__.:

Hi @lexicalunit, I’m guessing this might be a path fixing issue. Could you try adding something like

fixes:
  "::src/spellbot/"

Hey @tom, I don’t see a fixes configuration property documented here: Configuration reference — Coverage.py 7.0.4 documentation

Did you mean that I should put that somewhere else other than .coveragerc? If so, where?

Ah, I see it’s a setting in codecov.yml. I don’t actually have that file. Do I just add it to the root of my repository? I guess I can try that.

@tom Ok I added that file with those contents to the root of my repository: Trying to fix codecov · lexicalunit/spellbot@0a95520 · GitHub

But the report is still ignoring __init__.py: Code coverage done right.

Please note that codecov started ignoring this file randomly about 6 days ago after no changes on my part so I’m pretty sure it’s not something I changed. This used to work fine. Something broke or changed on codecov’s side of things for sure.

Hi @lexicalunit, this is my fault, it should read

fixes:
  - "::src/spellbot/"

It is quite strange that it stopped working 6 days ago, I don’t see anything in particular that should signal a shift. If that doesn’t work, let me know, and I can dig in a bit deeper.

Thank you @tom. I added the file to my repo: Trying to fix codecov · lexicalunit/spellbot@4c01af6 · GitHub

But it still seems to be ignoring the __init__.py files: Code coverage done right.

Posting there here so it won’t get lost.

Some additional info about the issue:

Hi @lexicalunit, would you be able to try

fixes:
  - "__init__.py::src/spellbot/__init__.py"
1 Like

It works! Code coverage done right.

1 Like

Uh… weird. I am now getting some weird error on my reports.

The error is: “Unable to find report content in the storage archive”

Not sure why this is suddenly happening or if it’s at all related to this change?