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

**URL:** https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903
**Category:** Support
**Created:** [January 17, 2020, 8:54am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903 "2020-01-17T08:54:55Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![0phoff](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/0phoff/32/483_2.png) [@0phoff](https://community.codecov.com/u/0phoff)
#### Post date: [January 17, 2020, 8:54am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/1 "2020-01-17T08:54:55Z")

</div>

### Description

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.

### Repository

> **[EAVISE / brambox · GitLab](https://gitlab.com/EAVISE/brambox)**
>
> Basic Requisites for Algorithms on iMages toolBOX

---

<div class="post-metadata">

### Author: ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)
#### Post date: [January 17, 2020, 3:45pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/2 "2020-01-17T15:45:13Z")

</div>

Hi @0phoff

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

---

<div class="post-metadata">

### Author: ![0phoff](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/0phoff/32/483_2.png) [@0phoff](https://community.codecov.com/u/0phoff)
#### Post date: [January 17, 2020, 4:05pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/3 "2020-01-17T16:05:31Z")

</div>

Hey,

If you take a look at [my codecov branch page](https://codecov.io/gl/EAVISE/brambox/branches), 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](https://gitlab.com/EAVISE/brambox/-/jobs/406507441) shows the CI job that should have pushed a new coverage report. [This link](https://gitlab.com/EAVISE/brambox/pipelines/110137332) shows the entire CI pipeline for that commit on the master branch.

Thanks a lot for looking into this!

Kind regards

---

<div class="post-metadata">

### Author: ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)
#### Post date: [January 17, 2020, 5:45pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/4 "2020-01-17T17:45:52Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![0phoff](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/0phoff/32/483_2.png) [@0phoff](https://community.codecov.com/u/0phoff)
#### Post date: [January 19, 2020, 4:32pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/5 "2020-01-19T16:32:03Z")

</div>

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

```bash
git merge --ff-only develop
git push

```

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

---

<div class="post-metadata">

### Author: ![drazisil](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/drazisil/32/496_2.png) [@drazisil](https://community.codecov.com/u/drazisil)
#### Post date: [January 23, 2020, 2:12pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/6 "2020-01-23T14:12:08Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://community.codecov.com/u/schuemie)
#### Post date: [June 16, 2020, 6:23am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/7 "2020-06-16T06:23:43Z")

</div>

I have the same problem. I do

```plaintext
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: [Travis CI - Test and Deploy Your Code with Confidence](https://travis-ci.org/github/OHDSI/CohortMethod/builds/695891372#L1008)

The report however only mentions the develop branch: [https://codecov.io/github/OHDSI/CohortMethod/commit/ee2dd72d6940c539dca351b93da247fdffd69034](https://codecov.io/github/OHDSI/CohortMethod/commit/ee2dd72d6940c539dca351b93da247fdffd69034)

And our dashboard doesn’t show the latest commit for the master branch: [https://codecov.io/gh/OHDSI/CohortMethod/branch/master](https://codecov.io/gh/OHDSI/CohortMethod/branch/master)

---

<div class="post-metadata">

### Author: ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)
#### Post date: [June 18, 2020, 2:49am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/8 "2020-06-18T02:49:00Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://community.codecov.com/u/schuemie)
#### Post date: [June 18, 2020, 7:24am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/9 "2020-06-18T07:24:36Z")

</div>

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)

```auto
httr::content(httr::POST(url = "https://codecov.io/upload/v2", 
                         query = codecov_query, 
                         body = coverage_json, 
                         encode = "json"))

# Returns a reference to https://codecov.io/github/OHDSI/OhdsiSharing/commit/d2c95bd93641dd42577c07ea5777502ffca345a1

codecov_query$branch <- "master"

httr::content(httr::POST(url = "https://codecov.io/upload/v2", 
                         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:

```auto
$branch
[1] "develop"

$commit
[1] "d2c95bd93641dd42577c07ea5777502ffca345a1"

$token
[1] "--removed--"

```

Contents of coverage\_json:

```auto
{"files":[{"name":"R/Sftp.R","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,null,0,0,0,0,0,null,null,null,null,null,null,null,null,null,0,0,0,0,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,null,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,0,0,0,0,0,null,0,0,0,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,null,null,null,null,null,null,null,null,null,null,0,0,0,null,null,null,null,null,null,null,null,null,null,0,0,0,null,null,null,null,null,null,null,null,null,null,0,0,0,null,null,null,null,null,null,null,null,null,null,0,0,0,0,null,null,null,null,null,null,null,null,null,null,null,null,0,0,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,null,0,0,0,0,0,null,0,0,null]},{"name":"R/Encryption.R","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null]},{"name":"R/HelperFunctions.R","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,0,null,null,null,null,null,0,0,0,0,0,0,null,0,null,null,0,null,null,null]},{"name":"R/OhdsiSharing.R","coverage":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,0,null]}],"uploader":"R"} 

```

---

<div class="post-metadata">

### Author: ![tom](https://yyz1.discourse-cdn.com/flex029/user_avatar/community.codecov.com/tom/32/8_2.png) [@tom](https://community.codecov.com/u/tom)
#### Post date: [June 18, 2020, 4:06pm UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/10 "2020-06-18T16:06:05Z")

</div>

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](https://github.com/apps/codecov)? This will solve that part of the issue.

---

<div class="post-metadata">

### Author: ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://community.codecov.com/u/schuemie)
#### Post date: [June 19, 2020, 5:14am UTC](https://community.codecov.com/t/coverage-not-updated-on-merge-ff-only/903/11 "2020-06-19T05:14:02Z")

</div>

Not sure I understand why, but that did it!

Thanks @tom!
