__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: https://github.com/lexicalunit/spellbot/commit/ff593b818d42d15bce99137b3d5b809ffe8ef2fc

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: https://coverage.readthedocs.io/en/latest/config.html

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: https://github.com/lexicalunit/spellbot/commit/0a95520d1422026e91d6bf2b08ab4b7e727556b3

But the report is still ignoring __init__.py: https://codecov.io/gh/lexicalunit/spellbot/tree/0a95520d1422026e91d6bf2b08ab4b7e727556b3/src/spellbot

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: https://github.com/lexicalunit/spellbot/commit/4c01af61123120a7920526a41c3fbc59716b6401

But it still seems to be ignoring the __init__.py files: https://codecov.io/gh/lexicalunit/spellbot/tree/4c01af61123120a7920526a41c3fbc59716b6401/src/spellbot/src/spellbot

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! https://codecov.io/gh/lexicalunit/spellbot/tree/8d36e11225380fc05d8c5653924e0ac6404961d9/src/spellbot

1 Like

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

https://codecov.io/gh/lexicalunit/spellbot/commit/a932ece8adb1da120116631eda7800e48f17c6b8

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?