.gitignore file can break uploaded reports

Hi,
The .gitignore file can affect the behavior of uploaded reports and make them unusable - I didn’t see this documented in the parts explaining how to integrate using GitHub actions.

I know because:

  1. in February 2020 I tried to give Codecov a try for my public projects in GitHub, and I wasn’t able to make them work in any way
  2. a few days ago I decided to try a second time, and I succeeded to configure Codecov in this project
  3. then I tried again to configure Codecov for the project that was failing in February, and it was failing in the same way (i.e. reports uploaded successfully but failed to parse)

I later noticed that this was caused by my .gitignore file, which came from a generic template from Azure DevOps for Python projects.

Click to expand and see the .gitignore file
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

.vscode

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
venv
htmlcov
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.idea
test-cov.xml
test-output.xml

*/*.py,cover
junit 

When I updated my .gitignore file to look like the following, reports started working (for example, for this other project):

.vscode
venv
htmlcov
.coverage
__pycache__
*.egg-info
*.tar.gz
.mypy_cache

You can see in the GitHub workflow files how I am using Codecov.

Initially reported here: https://github.com/codecov/codecov-bash/issues/376

Side notes:

  • I think that your website is not done according to GDPR because back in February I requested my account to be deleted, yet when I signed-up again a few days ago it recalled the two projects I was playing around in February - meaning that your system was able to match again my email address to the project under /RobertoPrevato/rodi
  • The project /RobertoPrevato/rodi at Codecov.io is in a broken state (reports are uploaded but then your server returns 500 Internal Error when I try to navigate to the results page - see here). A few days ago I used the interface to have this project deleted. The UI says it’s scheduled for deletion but doesn’t say anything when it will be deleted. I would like to delete information on your side to recreate it from scratch and try to integrate again.

@RobertoPrevato, this actually looks like an issue we were having with GitHub Actions. Can you try again and see? If it doesn’t work, please provide a GitHub Actions run URL.

@tom, I ran again the GitHub workflows for my public project “rodi”, the situation improved because I don’t get an HTTP 500 Internal Server Error from your service anymore, but anyway the coverage reports are not working (despite being used in the same way as those of my other two projects which are working, linked in the original description of this ticket).

GitHub Workflow run:

What about my other question about deleting the project? rodi in my codecov account seems broken, I would like to delete it and recreate it. Weeks ago I used the interface to delete all content, it said the project was “scheduled for deletion” but nothing happened.

If the above doesn’t help, I am planning to migrate this project to a GH organization to try again.

@RobertoPrevato, thanks for this, it looks like an issue on our side. If you need a hack, you can try running

bash <(sed -i 's/filename=\"/filename=\"rodi\//g' coverage.xml)

as a command before the Codecov step.

As for deleting, you will need to email support@codecov.io. Apologies for the hassle there.

1 Like

@tom, Thank You! Your solution worked!

GitHub Actions run

I hope this helps someone else, in case they experience the same issue. No need to apologize for the project deleting thing.

Kind Regards,
Roberto

1 Like