We are using codecov in our CI, lately we stoped seeing the codecov reports on PRs.
Turns out the base report is always missing.
Every PR has to run CI before it could be merged, and as part of CI we are uploading codecov reports. The reports are attached to the branch’s latest commit - the one that is tasted in CI.
We are able to see the reports in the codecov UI as expected, but always there is the “Missing base report” error and there is no commit to compare.
We stoped having reports on the base branch starting 2020-12-02 although we didn’t changed anything.
To merge PRs we are using ‘squash and merge’ strategy. As a result, the commit that is merged to the base branch is different from the commit we submitted report to and missing the report.
I actually don’t understand how it worked previously, since the only commits that we are uploading belongs to feature branches and does not enters the base branch.
Is it a known issue? Is codecov is incompatible with squash? how can we fix it?
@tom Was there any answer to these questions? We recently started using the ‘squash and merge’ strategy on Github and now all of our PRs are missing their base reports. Thanks
@mdemoret-nv can you share the Codecov output? If you are running GitHub Actions, you need to set fetch-depth to > 1 or 0 in the actions/checkout stage.
@tom any updates? Since I posted this message, we are encountering another issue where all recent commits are saying “Unable to find commit in Github”.
Hi @mdemoret-nv, I have a suspicion as to why this is happening, but I’d like to try to rule out a few things. If you don’t mind, I would like to see if it was a particular change in the bash uploader that caused this. Would you be able to upload using this in the curl https://raw.githubusercontent.com/codecov/codecov-bash/20201130-cc6d3fe/codecov as opposed to https://codecov.io/bash?
@tom We actually don’t use the bash uploader because it exits with a 500 error on some of our nodes and not others (You can see the error at the end of the build log here). Instead we have been using v2.1.11 of the python uploader which doesn’t run into the same 500 error.
I can try to use that version of the bash uploader if you think it would still be useful. If there is anything else I can try to rule out issues, let me know.
@mdemoret-nv, yes that would be helpful. I can’t track down the 500 as our logs don’t go that far back, but if you do get it again, let me know. Our bash uploader should be more sturdy and reliable.
@tom I was able to do some more digging today and discovered why the bash uploader wasn’t working for us but the python client is. The root cause appears to be the --connect-timeout 2 argument to curl in the bash uploader. We were not aware of this issue but our DNS lookup was taking about ~10 seconds causing the curl command to timeout. This issue was hidden by the bash client due to the line:
We have fixed the issue and reverted back to using the bash uploader and everything is working smoothly now (as far as uploading the reports to CodeCov). It might be a good idea to update the bash uploader to show any curl errors in case others have similar issues.
Thanks for your help on this. We wouldn’t have looked into the issue more if you didn’t suggest trying the bash uploader again. However, we still havent solved the original issue where the base report for PR’s is missing after switching to a “squash and merge” strategy on Github.
Do you have any suggestions on fixing the “squash and merge” issue?
@mdemoret-nv, that’s an incredible catch! I’ll make a note to update the uploader to expose curl issues. Thanks for finding that, I really appreciate it.
Do you have a PR/commit SHA that I can take a look at that has the issue? I don’t have any specific tips, but I can poke the product team with something specific, or find a workaround that fits your needs.
@mdemoret-nv, for me, running tests and uploading coverage on the base branch after every merge solved the issue.
Every time new commit enters to the base branch, CI pipeline is triggered to run on the base branch.
Then the coverage is uploaded for the commit id of the base branch and next PRs are compare to that.
This is the PR I have been working on: https://github.com/rapidsai/cuml/pull/3338. If you click on the Codecov report link in the comment, it only shows an error page now:
@tom Please let me know if there is anything else I can help with on my end. Would be great to hear what your product team has to say about this issue.
Thanks for the advice. We have been considering this approach so I am glad to hear it’s a viable method. Our hesitation with going this route is it would add to our already overworked CI system (which currently takes >12 compute hours per commit/PR). We would like to avoid adding an additional CI run who’s only purpose is to re-upload identical coverage with a different commit SHA.
We have an (undocumented) option in the codecov.yml you can try adding
codecov:
allow_coverage_offsets: true
I think if you add a commit to that PR it should resolve. Let me know if it doesn’t.
Something we have been working on is a better squash->merge strategy for users who don’t run CI on the default branch. A possible workaround so you don’t have to run EVERYTHING would be to
Save down the coverage report sent to Codecov using the -q option.
Save that file as an artifact (GitHub Actions has upload-artifact)
Trigger CI on merge, but only to download the above artifact and upload with the -z option.
@tom Thanks for the suggestion. I had noticed that mentioned once in the docs but couldnt find any other reference to it.
Unfortunately I tried that out and didnt see any change. You can view the PR here and the the codecov output is at the bottom of the log here
Do you have any other suggestions as to why this isn’t working for us? The only change I have seen is the Codecov.io reports now show “not found” for the base:
Before this change, a base commit was still shown, even if it was incorrect.
@tom Sorry to keep bombarding you with questions but we keep running into new issues. Lately, some of our builds have failed to upload coverage with a 400 error and the message “Invalid request parameters”. Any ideas? Here is the log:
Same issue here. We run tests and build container image once on the pull request workflow and when merge to master, we just create git tag and tag the PR container aproved image.
So I’m saving PR coverage reports to send it again to codecov as the master coverage report, how to achieve that?
Searching on community.codecov.io I found the exactly solution that I’m trying to acomplish with no sucess using github actions:
Saving PR reports to send againg to codecov on merge, like: