Open Ryang20718 opened 2 hours ago
cc @thomasrockhu-codecov
From a user's perspective this seems to be a bug. Wondering what your thoughts on this are and if there are any work arounds that I'm missing?
I'm really pushing hard to adopt codecov and am happy to help get this feature in if needed
On codecov reports (github actions), we see the base commit used to compare the PR is rather stale. example PR is https://github.com/Ryang20718/cflag/pull/28
i.e if my branch was branched off commit
C
whilstA
is head, if I submit a pull request to run in github actions (for CI), we run on the merged commit.C --> user/ryang/user_branch
Thus, the state of our branch is actually the following diagram.
C
This leads to a couple of unexpected bugs found in code coverage status checks. I.e because we run all of our tests on the merged commit, there may be a decent amount of files changed between commits
C
andA
which we have inherited because we are running on the merged commit.Thus, project level coverage may differ drastically even though the files we have touched have 100% patch coverage.
I have tried a couple of ways of bypassing this by overriding the commit to use the
merged commit
however, that doesn't work. If you manually rebase your PR and resubmit CI, then the base commit for the codecov report is accurate again. However, this is not a great developer experience as we'd like to make our codecov status checks blocking, but currently this is a bugIt seems like https://community.codecov.com/t/selected-base-commit-when-pr-is-based-on-an-older-commit-of-the-target-branch/4101 is a similar issue
I tried setting
commit_parent
in codecov-action similar to https://github.com/codecov/codecov-action/issues/597, but to no avail and also settingcommit_parent
to the HEAD of main, but to no avail even though main has a more recent commits with coverageLogs from attempt to use
parent_commit