Coverage not updated on "merge --ff-only"


When developing our software, we use the common approach of working in a ‘development’ branch, and merging that branch into master once we push for a new release.
We usually merge into master with a ‘fast-forward’ approach, so no new ‘merge’ commit gets created.

However, this creates issues for codecov.
When looking at our CI pipeline, the codecov part says: “remained the same compared to hash-of-commit”.
On the codecov website, the master branch does not get updated either, resulting in a wrong coverage badge…

This is really frustrating, as I do not want to create merge requests etc. for the sole purpose of getting codecov to work! I feel codecov should see that the master branch pointer has moved and use the correct report.


Hi @0phoff

This should work. Can you share a recent PR number and commit SHA so we can check our logs?


If you take a look at my codecov branch page, you will see that the master branch has not been updated for 6 months and is supposedly still on commit c42eff6.
However, my master branch is currently at commit cf704dae, and this link shows the CI job that should have pushed a new coverage report. This link shows the entire CI pipeline for that commit on the master branch.

Thanks a lot for looking into this!

Kind regards

Commit cf704dae9bbc7603a6c8fa41d8591006b39a8212 is showing as branch develop in our database

Even though you clearly uploaded it as branch master. I think this may be an issue where we don’t always update the branch if the same commit is uploaded from different branches.

Is there a chance you uploaded this same commit on develop, prior?

Yes, I push to develop whilst developing the code and once I want to push a new release I checkout master and do:

git merge --ff-only develop
git push

So every commit first comes in the development branch prior to reaching master

Oh, you merge on the command line, not via a PR and a CI process? Do you upload the reports again after merging to master? Otherwise, Codecov has no way of knowing the branch changes for that commit.

I have the same problem. I do

git checkout master
git merge develop
git push

This does trigger a new travis build, which does upload a new codecov report, but the statistics for the master branch are not updated.

For example, here’s the travis build for our master branch:

The report however only mentions the develop branch:

And our dashboard doesn’t show the latest commit for the master branch:

Hi @schuemie, it looks like you are using covr to do coverage. Unfortunately, we are not very familiar with the R language. Are you able to use the bash uploader here?

Thanks for the quick response!

I dove into the covr package, and arrived at the POST statement used to upload the report. I’m now able to manually post the same report over http, with the same commit ID, but different branches, and it seems that the change in branch is ignored: (Note I’m using a different repo than before)

httr::content(httr::POST(url = "", 
                         query = codecov_query, 
                         body = coverage_json, 
                         encode = "json"))

# Returns a reference to

codecov_query$branch <- "master"

httr::content(httr::POST(url = "", 
                         query = codecov_query, 
                         body = coverage_json,
                         encode = "json"))

# Returns the same URL, and the content hasn't been updated to reflect the change in branch.

Contents of codecov_query object created by covr:

[1] "develop"

[1] "d2c95bd93641dd42577c07ea5777502ffca345a1"

[1] "--removed--"

Contents of coverage_json:


Hi @schuemie, I took a deeper look on the Codecov side and it looks like this might be a permissions issue. Would you be able to use the GitHub integration? This will solve that part of the issue.

1 Like

Not sure I understand why, but that did it!

Thanks @tom!

1 Like