Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to display my files in the codecov interface anymore #1589

Closed
12rambau opened this issue Oct 1, 2024 · 6 comments
Closed

Impossible to display my files in the codecov interface anymore #1589

12rambau opened this issue Oct 1, 2024 · 6 comments
Assignees

Comments

@12rambau
Copy link

12rambau commented Oct 1, 2024

I recently updated my version of the codecov action version and it seems I have broken something. The codecov report is still send to codecov with the exact same values as the one provided in the xml file but now whenever I want to explore the files content and see the coverage miss I get the same error:

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

My action parameter are as follow:

A first step creates the report and save it in an artificat (only one of my matrix run is creating one.

- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
  uses: actions/setup-python@v5
  with:
    python-version: ${{ matrix.python-version }}
- name: Install nox
  run: pip install nox
- name: test with pytest
  run: nox -s ci-test
- name: assess dead fixtures
  if: ${{ matrix.python-version == '3.10' }}
  shell: bash
  run: nox -s dead-fixtures
- uses: actions/upload-artifact@v4
  if: ${{ matrix.python-version == '3.10' }}
  with:
    name: coverage
    path: coverage.xml

And a second one reads it from the artifact:

- uses: actions/download-artifact@v4
  with:
    name: coverage
- name: codecov
  uses: codecov/codecov-action@v4
  with:
    file: ./coverage.xml
    token: ${{ secrets.CODECOV_TOKEN }}
    verbose: true
    fail_ci_if_error: true

Am I doing anything wrong ?
I read in some places that it could be related to path resolution but I don"t really get what i could change as the coverage.xml file is litteraly loaded in the root of the checkouted files.

In case you wxant to see the fuill CI it's available on github here: https://github.com/gee-community/geetools/blob/codecov/.github/workflows/unit.yaml

@thomasrockhu-codecov thomasrockhu-codecov self-assigned this Dec 2, 2024
@thomasrockhu-codecov
Copy link
Contributor

@12rambau I think this is a different issue. In the v4 run you did, there is a bug with the file being the same name as an upstream directory. I'm working on a fix for this, but if you want an ugly workaround, it would be to rename that directory to something that isn't covearge.xml here: https://github.com/gee-community/geetools/actions/runs/12505536958/job/34889449393#step:3:92

@thomasrockhu-codecov
Copy link
Contributor

@12rambau i've been having a really hard time reproducing this. Can you do an ls -alrt after you download-artifact? Why is coverage.xml being seen as a directory? Also, I would recommend using v5 of the Action

https://github.com/gee-community/geetools/actions/runs/12505536958/job/34889449393#step:2:4

@12rambau
Copy link
Author

Hi thanks @thomasrockhu-codecov to have looked into it. let me do a small test repository to exactly undertand how I should handle this artifact, it should not be a directory at all. Once I'm happy, I'll edit the pipeline and move to v5 and report to you in this issue.

@12rambau
Copy link
Author

@thomasrockhu-codecov I moved to v5 of the action and created a small example of the download artifact mechanism in another repository: https://github.com/12rambau/test_actions/blob/main/.github/workflows/unit.yaml

The transfer of a single file works exactly as expected and the action in geetools is happily sending data to the server. On the web interface the problem persists I don't access the files.

I realize that I'm not checking out the repository itself when doing my action could this be the problem ?

@12rambau
Copy link
Author

12rambau commented Jan 16, 2025

I added an extra step to my job to self checkout (gee-community/geetools@50d0a48) my files and that's exactly what was missing, the files are now back on the web interface. I checked all the example and the checkout step is already there it's just never specified that the step is necessary for the tool to work. Should I make a documentation PR somewhere ? or is it so obvious that I should imply close my issue ?

@thomasrockhu-codecov
Copy link
Contributor

@12rambau no, we can probably do a better job of documenting this. I'm going to close out the issue if it's working for you now, but I'll keep it on my sprint board to add docs. Thanks for finding that, I really was struggling to come up with an answer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants