Codecov-python: does not respect fixes in codecov.yml file

Description

As far as I can tell the tool does not respect the fixes in the codecov.yml file. Theirs no reference to the fixes key in the YAML file in the code, and seems to not be doing anything locally. I walked through it with a debugger and don’t see any spot where it does that.

Repository

CI/CD or Build URL

Please provide which CI/CD you are using or a link to the build where coverage is being uploaded.

Uploader

Python uploader, this is a bug/feature request in the tool.

Codecov Output

It’s hard to describe, but lets sat I have a .coverage sqlite3 db with the following information:
sqlite3 .coverage
SQLite version 3.31.1 2020-01-27 19:55:54
Enter “.help” for usage hints.
sqlite> select path from file;
/workspace/tpm2-pytss/tpm2_pytss/init.py
/workspace/tpm2-pytss/tpm2_pytss/ESAPI.py
/workspace/tpm2-pytss/tpm2_pytss/types.py
/workspace/tpm2-pytss/tpm2_pytss/utils.py
/workspace/tpm2-pytss/tpm2_pytss/TSS2_Exception.py
/workspace/tpm2-pytss/tpm2_pytss/crypto.py
/workspace/tpm2-pytss/tpm2_pytss/FAPI.py
/workspace/tpm2-pytss/tpm2_pytss/TctiLdr.py

I then provide a .codecov.yml file:
codecov:
fixes:

  • “workspace/::” # reduce root e.g., “workspace/path/” => “path/”

I then run the codecov tool version 2.1.11
python3.8 -m codecov --dump

And examine the coverage.xml:


I would image that the fixups are performed on the client side to reduce server load.But they don’t seem to be performed. My coverage reports are being uploaded but not displayed, and I cant even access the archived version. One of the suggested fixes was a fixups file.

So I placed this file in the project root:
codecov.yml:

  • fixes: “workspace/::” # reduce root e.g., “before/path/” => “path/”

Using strace and debugger, I could see that codecov python tooling was reading the YAML file. However, I could see no method of fixups being applied to the paths as it processed the report.

Expected Results

Expected the uploaded report to have the leading workspace/ stripped from the coverage.xml

@williamcroberts can you provide a commit SHA here?

I’m using the master tip of codecov python and bash tools. Various uploads to the tpm2-pytss project failed, so I replicated everythign locally to debug, which is when I discovered the paths not lining up and trying to do a path fix. If you just look at the python tool:

You should see a regex grabbing the fixes field and applying a fixup to the code paths in the coverage report. I have some changes locally to codecov-python to implement this, but its not will tested.

@williamcroberts it’s been a while, I wanted to check up on this. We will soon be deprecating most of the work on the python and bash uploaders and we recommend this uploader. Fixes are typically also done server-side, so not sure how that will affect your project. Let me know.