codecov-action icon indicating copy to clipboard operation
codecov-action copied to clipboard

[BUG] Can't get coverage report

Open HarelM opened this issue 7 months ago • 14 comments

Describe the bug Coverage files are being uploaded to codecov, but the report is "empty"

Image

To Reproduce Steps to reproduce the behavior:

  1. See the following PR, which is the third attempt of getting a coverage report for this code changes and fork: https://github.com/maplibre/maplibre-gl-js/pull/5903

Expected behavior I should get a coverage report and a comment in the PR with the coverage updates

Regression State whether this is a regression and when the last successful instance occurred

Screenshots See above

Product Area Coverage

Versions

  • OS: linux, ubuntu-v24,
  • Git Host: GitHub,
  • CI/CD: GitHub Actions
  • Uploader: Current latest version 5 of github actions

Commit and CI link See above

Additional context This is going on for a few days now, the PR owner only want to get his PR merged and I can't approve it without the code coverage report

HarelM avatar May 15 '25 12:05 HarelM

This issue is essentially identical to the one I submitted in #1831. I created #1831 because the description here lacks some clarity and detail. I believe this is a bug rather than a support request, and therefore the "support" label may not be appropriate. @thomasrockhu-codecov

Upon reviewing the PR link provided by the author of this issue, it’s clear that Codecov successfully created the relevant checks, but did not generate a coverage report comment. In the Codecov UI, the commit and its coverage data are correctly shown, yet the PR itself displays a ‘missing head commit’ message — indicating that Codecov is unable to associate the commit with the pull request.

vivodi avatar May 31 '25 05:05 vivodi

I'm not sure if this is the same issue or not, but in the following PR I'm missing coverage comment, which I'm using a lot to understand if a specific code that was introduced is covered in tests. Not having it really make my job harder... https://github.com/maplibre/maplibre-gl-js/pull/5989

HarelM avatar Jun 13 '25 11:06 HarelM

I'm not sure if this is the same issue or not, but in the following PR I'm missing coverage comment, which I'm using a lot to understand if a specific code that was introduced is covered in tests. Not having it really make my job harder... maplibre/maplibre-gl-js#5989

I can tell you with confidence that we have the same issue — Codecov is able to create comments on PRs from different branches within the same repository, but it cannot create comments on PRs from forked repositories. Also, if you open the 'Pulls' tab in the Codecov UI, you'll see that PRs from forked repositories show 'Missing Head Commit'.

vivodi avatar Jul 12 '25 11:07 vivodi

I believe that https://github.com/Flexget/Flexget is also experiencing the same issue.

vivodi avatar Jul 12 '25 11:07 vivodi

Any updates on this, I'm flying blind here... Here's another PR without coverage:

  • https://github.com/maplibre/maplibre-gl-js/pull/6163

HarelM avatar Jul 22 '25 20:07 HarelM

Same here, the main branch definitely had multiple verified coverage uploads from GH, but still no message in PR, and the same error about Missing Head Commit is shown on Codecov website (same as for OP).

tsinis avatar Jul 26 '25 17:07 tsinis

Same here, the main branch definitely had multiple verified coverage uploads from GH, but still no message in PR, and the same error about Missing Head Commit is shown on Codecov website (same as for OP).

Your issue is different from the one the PR author and I have. The two of us just can't see comments on PRs from forked repositories, but the check status always shows up, and comments on PRs from different branches of the same repository are visible.

vivodi avatar Jul 26 '25 23:07 vivodi

@HarelM https://github.com/codecov/feedback/issues/789#issuecomment-3448221444 is the final answer to this issue, and I think this issue can be closed.

vivodi avatar Oct 26 '25 12:10 vivodi

Is the problem fixed? I haven't seen codecov comments on my project's PRs in the recent days.

HarelM avatar Oct 26 '25 13:10 HarelM

@HarelM Did you check the link I sent above?

vivodi avatar Oct 26 '25 13:10 vivodi

Yup, read it from start to end, but the resolution of the issues was not clear to me, and the issue is still open... So I'm a bit confused...

HarelM avatar Oct 26 '25 13:10 HarelM

@HarelM There’s a link to a PR in that comment. You’ll need to apply a similar fix in your own repository.

vivodi avatar Oct 26 '25 14:10 vivodi

@HarelM, the short end of it is to migrate from using codecov/test-results-action to codecov/codecov-action. I'll be deprecating the test-results-action this week.

You can do that by replacing test-results-action@v? to codecov-action@v5 and adding report_type: test_results. See this PR as an example

thomasrockhu-codecov avatar Oct 26 '25 19:10 thomasrockhu-codecov

I'll simply remove it, there's no real added value for me in using it... Thanks for circling back to this issue.

HarelM avatar Oct 26 '25 19:10 HarelM