Codecov website can not show line by line coverage

Description

On the Codecov website, the coverage looks properly displayed, but once you select the file, it displays this error:

There was a problem getting the source code from your provider. Unable to show line by line coverage.

CI/CD URL

The XML coverage and the upload is done on this GitHub action CI: https://github.com/mne-tools/mne-icalabel/blob/07beb68637dd9c0e962492f87a8f8fe8d8857023/.github/workflows/unit_tests.yml#L156-L166

      - name: Run pytest  # headless via Xvfb on linux
        uses: GabrielBB/xvfb-action@v1.6
        with:
          run: pytest main/mne_icalabel --cov=main/mne_icalabel --cov-report=xml --cov-config=main/pyproject.toml
      - name: Upload coverage stats to codecov
        if: ${{ matrix.os == 'ubuntu' && matrix.python-version == '3.10' && matrix.mne == 'stable' }}
        uses: codecov/codecov-action@v3
        with:
          files: ./coverage.xml
          fail_ci_if_error: true
          verbose: true

Codecov Output

==> linux OS detected
https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
==> SHASUM file signed by key id 806bb28aed779869
==> Uploader SHASUM verified (66cbf87269acc529c87f6ea29395ba329f528e92cfda4fc199eab460123e18b6  codecov)
==> Running version latest
==> Running version v0.2.5
/home/runner/work/_actions/codecov/codecov-action/v3/dist/codecov -n  -Q github-action-3.1.0 -Z -f ./coverage.xml -C 83bf6071f44d3a2f803e738529d8b0896d6f4256 -v
[2022-08-08T10:39:53.758Z] ['verbose'] Start of uploader: 1659955193758...
[2022-08-08T10:39:53.760Z] ['info'] 
     _____          _
    / ____|        | |
   | |     ___   __| | ___  ___ _____   __
   | |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
   | |___| (_) | (_| |  __/ (_| (_) \ V /
    \_____\___/ \__,_|\___|\___\___/ \_/

  Codecov report uploader 0.2.5
[2022-08-08T10:39:53.775Z] ['info'] => Project root located at: /home/runner/work/mne-icalabel/mne-icalabel
[2022-08-08T10:39:53.777Z] ['info'] -> No token specified or token is empty
[2022-08-08T10:39:53.777Z] ['verbose'] Start of network processing...
[2022-08-08T10:39:53.777Z] ['verbose'] Searching for files in /home/runner/work/mne-icalabel/mne-icalabel
[2022-08-08T10:39:53.925Z] ['verbose'] Skipping coveragepy, files already specified
[2022-08-08T10:39:53.926Z] ['info'] Searching for coverage files...
[2022-08-08T10:39:54.020Z] ['verbose'] Preparing to clean the following coverage paths: ./coverage.xml
[2022-08-08T10:39:54.021Z] ['info'] => Found 1 possible coverage files:
  ./coverage.xml
[2022-08-08T10:39:54.021Z] ['verbose'] End of network processing
[2022-08-08T10:39:54.021Z] ['info'] Processing ./coverage.xml...
[2022-08-08T10:39:54.026Z] ['info'] Detected GitHub Actions as the CI provider.
[2022-08-08T10:39:54.026Z] ['verbose'] -> Using the following env variables:
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_ACTION: __codecov_codecov-action
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_HEAD_REF: coverage
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_REF: refs/pull/94/merge
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_REPOSITORY: mne-tools/mne-icalabel
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_RUN_ID: 2817244728
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_SERVER_URL: https://github.com
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_SHA: c09821e5bc25cc941b2ce2ff27bccb2cdd7e1bb3
[2022-08-08T10:39:54.027Z] ['verbose']      GITHUB_WORKFLOW: unit-tests
[2022-08-08T10:39:54.028Z] ['verbose'] Using the following upload parameters:
[2022-08-08T10:39:54.028Z] ['verbose'] branch
[2022-08-08T10:39:54.028Z] ['verbose'] build
[2022-08-08T10:39:54.028Z] ['verbose'] buildURL
[2022-08-08T10:39:54.028Z] ['verbose'] commit
[2022-08-08T10:39:54.028Z] ['verbose'] job
[2022-08-08T10:39:54.029Z] ['verbose'] pr
[2022-08-08T10:39:54.029Z] ['verbose'] service
[2022-08-08T10:39:54.029Z] ['verbose'] slug
[2022-08-08T10:39:54.029Z] ['verbose'] name
[2022-08-08T10:39:54.029Z] ['verbose'] tag
[2022-08-08T10:39:54.029Z] ['verbose'] flags
[2022-08-08T10:39:54.030Z] ['verbose'] parent
[2022-08-08T10:39:54.038Z] ['info'] Pinging Codecov: https://codecov.io/upload/v4?package=github-action-3.1.0-uploader-0.2.5&token=*******&branch=coverage&build=2817244728&build_url=https%3A%2F%2Fgithub.com%2Fmne-tools%2Fmne-icalabel%2Factions%2Fruns%2F2817244728&commit=83bf6071f44d3a2f803e738529d8b0896d6f4256&job=unit-tests&pr=94&service=github-actions&slug=mne-tools%2Fmne-icalabel&name=&tag=&flags=&parent=
[2022-08-08T10:39:54.039Z] ['verbose'] Passed token was 0 characters long
[2022-08-08T10:39:54.039Z] ['verbose'] https://codecov.io/upload/v4?package=github-action-3.1.0-uploader-0.2.5&branch=coverage&build=2817244728&build_url=https%3A%2F%2Fgithub.com%2Fmne-tools%2Fmne-icalabel%2Factions%2Fruns%2F2817244728&commit=83bf6071f44d3a2f803e738529d8b0896d6f4256&job=unit-tests&pr=94&service=github-actions&slug=mne-tools%2Fmne-icalabel&name=&tag=&flags=&parent=
        Content-Type: 'text/plain'
        Content-Encoding: 'gzip'
        X-Reduced-Redundancy: 'false'
[2022-08-08T10:39:54.666Z] ['info'] https://codecov.io/github/mne-tools/mne-icalabel/commit/83bf6071f44d3a2f803e738529d8b0896d6f4256
https://storage.googleapis.com/codecov/v4/raw/2022-08-08/9D7806D1E9FCB6CC3EB73CD77D25A04D/83bf6071f44d3a2f803e738529d8b0896d6f4256/70bf7d2f-3b4f-43af-bc46-1de713ece4b6.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJOGFN2JQ4OCTGA2MU5AEIT7OT5Z7HTFOAN2SPG4NWSN2UJYOY5U6LZQ%2F20220808%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20220808T103954Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=adea607298ffa24eaea6915d131ec76fc034b5a608eec0ec56ea4add3e82f690
[2022-08-08T10:39:54.666Z] ['verbose'] Returned upload url: https://storage.googleapis.com/codecov/v4/raw/2022-08-08/9D7806D1E9FCB6CC3EB73CD77D25A04D/83bf6071f44d3a2f803e738529d8b0896d6f4256/70bf7d2f-3b4f-43af-bc46-1de713ece4b6.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EJOGFN2JQ4OCTGA2MU5AEIT7OT5Z7HTFOAN2SPG4NWSN2UJYOY5U6LZQ%2F20220808%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20220808T103954Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=adea607298ffa24eaea6915d131ec76fc034b5a608eec0ec56ea4add3e82f690
[2022-08-08T10:39:54.667Z] ['info'] Uploading...
[2022-08-08T10:39:54.893Z] ['info'] {"status":"success","resultURL":"https://codecov.io/github/mne-tools/mne-icalabel/commit/83bf6071f44d3a2f803e738529d8b0896d6f4256"}
[2022-08-08T10:39:54.893Z] ['verbose'] End of uploader: 1135 milliseconds

I’ve been looking around at what could cause this, but I am at a lost. Any help on configuring Codecov correctly would be appreciated!

Mathieu

@mscheltienne, can you try adding this to your codecov.yml file?

fixes:
  - "main/::" 

Looks like you the coverage reports being uploaded have a prepended main directory

1 Like

Thanks for the suggestion. Unfortunately, it does not seem to work. I tried it on this repository which has a similar setup: GitHub - mscheltienne/simple-stimuli: Simple auditory and visual stimuli that do not require PsychoPy.

main was also pre-prended by the CIs, as you can see here: simple-stimuli/pytest.yml at e91e753350e8676541e1a6926884cc56fc165bb0 · mscheltienne/simple-stimuli · GitHub and simple-stimuli/pytest.yml at e91e753350e8676541e1a6926884cc56fc165bb0 · mscheltienne/simple-stimuli · GitHub

On the mne-icalabel repo, I tried a different fix: I replaced main/mne_icalabel with mne_icalabel in the cov argument of pytest (and thus did not add a .codecov.yml file.

Neither worked!

Nevermind, it just took a bit of time to update!

1 Like

Hi guys,

I have the same problem at the moment.
The line by line coverage worked some time ago, but now I get the same error as @mscheltienne

I also tried to update the codecov-action to from v2 to v3 but that does not make any difference.
It does not work for any branch

@auchri please open a new topic for this