Coverage status on commits and pull requests is not working

Description

Hello,

We are using drone CI with the codecov bash uploader, to upload coverage reports for our react frontend project.

However so far we are not getting the github commit status neither the coverage changes report as github comments.

Find attached screenshots with these issues.

Initially we tried without any codecov.yml, and now we tried to fix by customizing the yaml file but nothing changes.

What could be the problem?

The coverage informed for master branch is also wrong in the badge.
It is showing 9% but it is actually 3%, 9% is the coverage for the open PR #21 (https://github.com/kaefer-cit/dpms-react/pull/21)

Repository

https://github.com/kaefer-cit/dpms-react

Additional Information

Pull request open without status -> https://github.com/kaefer-cit/dpms-react/pull/21
COMMIT SHA without status -> https://github.com/kaefer-cit/dpms-react/pull/21/commits/f09a686c857aebbcb63f0ed30000097cd2311a61

Current YAML:

codecov:
notify:
require_ci_to_pass: no

comment:
layout: “reach, diff, flags, files”
behavior: default
require_changes: false # if true: only post the comment if coverage changes
require_base: no # [yes :: must have a base report to post]
require_head: no # [yes :: must have a head report to post]

Hi @niltonvasques

I’m can’t find f09a686c857aebbcb63f0ed30000097cd2311a61 in the logs, when was this commit uploaded? Do you have one within the past 2-3 days that I can take a look at, if this one is older then a week?

Hi @drazisil,

I just recorded a video here to show you that the build for commit f09a686c857aebbcb63f0ed30000097cd2311a61 happened 20 hours ago, however seems that the codecov bash uploader send the reports to the wrong commit. See the gif below with this behavior:

Sorry, my last gif was not showing the upload report link to codecov:

It is uploading to this link -> https://codecov.io/github/kaefer-cit/dpms-react/commit/7f98f82d05da8cbd4ccde6262ee6e3eac3e110e3

WRONG SHA -> 7f98f82d05da8cbd4ccde6262ee6e3eac3e110e3

while it should upload to SHA -> f09a686c857aebbcb63f0ed30000097cd2311a61

Merge commits are a pain, because is most cases they never get pushed to the repo and thus can’t be used.

It looks like we use $VCS_COMMIT_ID to fetch the commit, the rest of the Drone CI detection code is here:

Suggestions or PRs for improvement welcome.

Hello @drazisil,

After read your comment I find a way to solve this issue by passing the COMMIT_ID directly to the codecov uploader. Like that:

bash -c "bash <(curl -s https://codecov.io/bash) -C $DRONE_COMMIT"

1 Like