Description
We have several issues with codecov trying to guess the base commit to compare against, so we decided to use the -N
flag to tell it ourselves.
I’ve seen several other people having the base report problem (one, two, three). All suggestions to fix this are using the -N
flag… but we cannot make it work.
We first had an issue with codecov identifying the head commit, but we solved it by using the -C
flag. This one works fine. We tried doing the same with -N
, but unsuccessfully.
Codecov bash script is properly setting the parent parameter when uploading the reports to codecov… but the report I see is wrongly using the incorrect parent, and not the one provided.
Repository
Private repo
Steps to Reproduce
- Create a branch
feature
from a base branchdevelop
- Commit anything into base branch
develop
- Open a pull request from “delayed” branch
feature
- Configure your CI to do a virtual merge on the
feature
with recentdevelop
changes - Run your tests on this virtual merge (I call it virtual, because is not pushed)
- Since codecov is not picking correctly the base commit to compare, find it yourself and provide it with
-N
Expected behavior: Get the report comparing against the commit passed with -N
Actual behavior: The report is comparing about whatever codecov script picks without the parameter
Flakiness? Always
Versions
Github and jenkins. Using the bash uploader.
We allow outdated PRs, but have the Merging the pull request with the current target branch revision
enabled.
Additional Information
Let me show a git tree to visualize better the problem.
* 5555 Virtual Merge commit develop into feature branch
|\
| * 0022 Latest develop commit
| * 0011 Another develop commit
* | 1122 Second commit on feature branch
* | 1111 First commit on feature branch
|/
* 0000 First develop commit
We have a base commit 0000 in develop branch.
We create a branch feature from there and push two commits, 1111 and 1122. The head of the branch is 1122 and this is the commit we want to bind the report. We use -C to tell this to the bash codecov script.
While we open our PR, other developer pushes two more commits to develop: 0011 and 0022. The head of develop is 0022.
Now, we would like to compare our test report with develop. If we do nothing, codecov picks 0000, which is outdated, producing a fake and useless report.
If we tell bash codecov script to use 0022 with -N
flag to have the most updated develop version… codecov ignores us
Console output
curl -s
codecov.io/bash
| bash -s – -t token -C 1122 -N 0022
[ … ignoring … ]
==> Gzipping contents
==> Uploading reports
url:codecov.io
query: parent=0022&branch=PR-1206&commit=1122&build=24&build_url=ignore&name=&tag=&slug=ignore&service=jenkins&flags=&pr=1206&job=
→ Pinging Codecov
codecov.io/upload/v4?package=ignore&token=secret&parent=0022&branch=PR-1206&commit=1122&build=24&build_url=ignore&name=&tag=&slug=ignore&service=jenkins&flags=&pr=1206&job=
→ Uploading
→ View reports at
codecov.io/github/company/commit/1122
Up to here it looks ok… but when I open the report, it’s comparing with the wrong commit 000 instead!
Appreciation
Thanks!