Default branch failing to show

Hi there!

I have a situation I can’t figure out and I’m hoping someone can help me. I recent enabled codecov for a repo I work in by adding it to our CICD (Jenkins) pipeline. This uploads coverage reports on both PRs and merges to master. When I look at the logs for merges to the master branch, I see things like this being printed (details stripped):

==> Uploading reports
url: https://codecov.io
query: branch=master&commit=COMMIT_SHA&build=285&build_url=BUILD_URL&name=&tag=&slug=SLUG&flags=&pr=&job=

-> Pinging Codecov
https://codecov.io/upload/v4?package=bash-20200602-f809a24&token=secret&branch=master&commit=COMMIT_SHA&build=285&build_url=BUILD_URL&name=&tag=&slug=SLUG&service=jenkins&flags=&pr=&job=
-> Uploading
-> View reports at 
https://codecov.io/github/OWNER/REPO/commit/COMMIT_SHA

However, when I go to the repo on Codecov, I see a message about “Not enough recent commits found with current parameters”. If I go into the branches view and find the master branch specifically, I see the same message, but with a “No commits found.” content view. However if I click on that final link, then I see the commit I’m looking for.

The way I’ve understood it is that the commits are all uploaded, but for some reason they aren’t associated with the master branch (note the branch=master part of the query though).

How do I fix this? What am I missing with the setup?

Hi @evancharlton, can you please provide a commit SHA so we can take a look?

Hi @tom!

The repo is not public, but here’s the latest merge into master if it’s still helpful: 65f801ff29a220327efff81fee8113e96cf49619

Thanks!

Hi @evancharlton, do you run your CI on merges into master?

Hi @tom,

Sorry if I was unclear. I believe so; that log snippet was from one of the merges to the master branch (note the branch=master part of the query)

Thanks for looking into this!

Hi @evancharlton, this is strange. For that SHA you provided, I’m seeing Commit was deleted by force push or pull request rebase. Does this resonate with what you expect? Is there another commit SHA that you would expect to show up?

@tom - Interesting! We use squash-and-merge when our PRs are merged into master, but that commit is very much still in our tree (as part of the master branch).

Or CICD pipeline is basically this:

        stage('Execute unit tests') {
          dir('unit-tests') {
            container('node') {
              sh('yarn test')
              junit(allowEmptyResults: true, testResults: '**/junit.xml')
              if (isPullRequest) {
                // This is just a helper function which posts a comment
                // on the PR of which tests have failed.
                summarizeTestResults()
              }
            }
            stage("Upload coverage reports") {
              sh('bash <codecov-upload-report.sh')
            }
          }
        }

Now that I write this out, I’m pretty sure that those lines about junit(..) and summarizeTestResults() don’t actually do anything on this repo and are left over from when I copy/pasted that from another (java-based) repo. But they shouldn’t be deleting commits on codecov :wink:

Thanks for investigating!

Hmmm… this is wildly bizarre @evancharlton. I’d like to compare a few other commits, if possible. Do you have another SHA that is on the master branch that would be useful here?

Sure thing @tom! Here is a series of sequential commits from origin/master:

1a0fd02ec889be5beb27602bbcf163e4ac42f5aa
ac788639de0c0f7c7440bf4a908009966f71aa0a
12e253c76e929027b5e4f4938d3d6b48ab503761
0181780df883ebce44716e07916fcaefc9ff690f
2fff244c9bafcb71d59512af7748ca6e70186e32
928ddafe4aec72997e37e9ceb68d8726050579b0
b00a9eec0781085c11d4f24a54d2e3482983c40b
bed9a0d40a306800c07112f3fc1faa077e93e7b1
cb65778c1deb223aa6dcdd69064de0543d7b2338
0dfbd8ef8a63a35160c894e93f4f2941427ffcf3
399767aa0060e1a0d077984a841944675811f440

I really appreciate the help here; I am completely open to the idea that I did something wrong with the setup, too :slight_smile:

Hi @evancharlton, this is surely a doozey. I’m seeing a few of those commits on your master branch, but for other commits I’m seeing them either on other branches or being force-pushed over. Would you mind DMing me a screenshot of the master commits off of GitHub?

https://github.com/{organization}/{repo_name}/commits/master I just want to make sure I’m not going crazy.

Sure thing, @tom! Message has been sent – I hope it helps!

Marking as solved as taking to DM