Codecov not posting comments to GitLab Merge Requests

Please check the troubleshooting guide before creating a ticket.
All fields below are required.

Description

Despite creating a new codecov.yaml file specifically for the repo, updating my .gitlab-ci.yaml file with the required script to enable the coverage file to be pushed, and creating a webhook for GitLab within Codecov, I am not getting any comments being pushed to any of my merge requests.

Testing the webhook reveals that it is getting a 500 error for merge request events:

I can provide information pertaining to how the webhook is configured, if required.

I’ve also noticed that all of my commits show " Waiting for CI to complete" at the top of the screen, and clicking the “Push notifications now” link results in a notification stating “Notification job queued.”

It’s worth noting that the GitLab Pipeline starts successfully when expected, and I am able to view the coverage reports at codecov.io.

Am I missing something somewhere?

Commit SHAs

13443790feb20b57cf6e940402841aab207fac6c

Repository


CI/CD or Build URL

image: cirrusci/flutter

before_script:
  - sudo apt-get update -y
  - sudo apt-get upgrade -y
  - sudo apt-get install -y sqlite3 libsqlite3-dev

after_script:
  - bash <(curl -s https://codecov.io/bash)

stages:
  - test

flutter_test:
  stage: test
  script:
    - flutter test --coverage
    - lcov --list coverage/lcov.info
    - genhtml coverage/lcov.info --output=coverage
  artifacts:
    paths:
      - coverage
  rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event' || $CI_COMMIT_BRANCH == 'unit-tests' || $CI_COMMIT_BRANCH == 'master'
      when: on_success
  tags:
    - docker

Uploader

Bash uploader:

codecov:
  bot: "amkuchta"
  require_ci_to_pass: no

coverage:
  precision: 2
  round: down
  range: "40...100"

comment:
  layout: "diff, files"
  behavior: new
  require_changes: false
  require_base: no # [yes :: must have a base report to post]
  require_head: no # [yes :: must have a head report to post]

Codecov Output

Running after script...
$ bash <(curl -s https://codecov.io/bash)
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20201106-81372f2
==> GitLab CI detected.
    project root: .
--> token set from env
    Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage/lcov.info bytes=27630
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
==> Uploading reports
    url: https://codecov.io
    query: branch=routineNoteDao-test&commit=13443790feb20b57cf6e940402841aab207fac6c&build=846907259&build_url=&name=&tag=&slug=singularis-technologies%2Fstronk&service=gitlab&flags=&pr=&job=846907259&cmd_args=
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-20201106-81372f2&token=secret&branch=routineNoteDao-test&commit=13443790feb20b57cf6e940402841aab207fac6c&build=846907259&build_url=&name=&tag=&slug=singularis-technologies%2Fstronk&service=gitlab&flags=&pr=&job=846907259&cmd_args=
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-11-13/869B7E21B47FA220BE898881172E6005/13443790feb20b57cf6e940402841aab207fac6c/da7eb3eb-4dd0-4028-9d9b-afb9ae961ec8.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20201113%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20201113T005038Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=a6f6b2c503cc368d0c5799e25cbd78facc652611abe9032f550c903d7ce52890
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9578    0     0  100  9578      0  43735 --:--:-- --:--:-- --:--:-- 43735
    -> View reports at https://codecov.io/gitlab/singularis-technologies/stronk/commit/13443790feb20b57cf6e940402841aab207fac6c

Expected Results

Comments should be generated on merge requests.

Actual Results

Coverage results are uploaded to codecov.io and pipeline succeeds, but no comment is generated.

Additional Information

N/A

@moderators any chance anyone has seen this issue before?

@amkuchta, would you be able to supply a newer SHA here? Apologies on the delay.

@tom no worries, thank you for the response!

As requested, a new commit SHA: 697b2fd33d8893889fea6a6beff15289f4a27838

I’ll also add the updated output from the latest pipeline run:

Running after script...
$ bash <(curl -s https://codecov.io/bash)
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-20201123-d0fed5f
==> GitLab CI detected.
    project root: .
--> token set from env
    Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
    -> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
    + ./coverage/lcov.info bytes=27911
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
==> Uploading reports
    url: https://codecov.io
    query: branch=workoutRoutineDao_test&commit=697b2fd33d8893889fea6a6beff15289f4a27838&build=868222161&build_url=&name=&tag=&slug=singularis-technologies%2Fstronk&service=gitlab&flags=&pr=&job=868222161&cmd_args=
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-20201123-d0fed5f&token=secret&branch=workoutRoutineDao_test&commit=697b2fd33d8893889fea6a6beff15289f4a27838&build=868222161&build_url=&name=&tag=&slug=singularis-technologies%2Fstronk&service=gitlab&flags=&pr=&job=868222161&cmd_args=
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2020-11-24/869B7E21B47FA220BE898881172E6005/697b2fd33d8893889fea6a6beff15289f4a27838/17e6501b-4bd2-4c42-89c1-dd732a013355.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQX6OZVJGHKK3633AAFGLBUCOOATRACRQRQF6HMSMLYUP6EAD6XSWAAY%2F20201124%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20201124T010204Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=0fe9884067871906c3fd3b0ceb34533e6caedae4ad342accf3609b0677b65ed7
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  9874    0     0  100  9874      0  43307 --:--:-- --:--:-- --:--:-- 43307
    -> View reports at https://codecov.io/gitlab/singularis-technologies/stronk/commit/697b2fd33d8893889fea6a6beff15289f4a27838

Anything you can do to help would be great!

@amkuchta, I’m seeing some 403 errors when trying to hit GitLab public endpoints like

https://gitlab.com/api/v4/projects/21557982/merge_requests/10

Do you know why this might be, some GitLab specific permissions?

@tom I’m not seeing anything on my end - the project is public. I haev the repo (and merge requests) locked down to “Only Project Members”, but since I am a project member (and my account is set as the bot), I don’t think this would be a problem.

@tom I verified this by temporarily swapping permissions over to “Everyone with access” and testing the webhook again - still getting a 500 response.

@amkuchta, sorry I meant this as specific to GitLab. In order to get merge request information, we have to hit GitLab’s API (https://gitlab.com/api/v4/projects/21557982/merge_requests/10), but that is showing a 403 forbidden. Do you know why this might be?

@tom I updated my repo to be wide open to the public - can you try hitting the API again?

@amkuchta, it doesn’t seem that way. I’m going to open a ticket with GitLab to see why this might be.

@amkuchta, I have an idea. Would you be able to log out of codecov.io, clear your cookies, and log back in again? And then create another PR to see if comments appear?

@tom I logged into a brand new computer, created a new PR, and submitted. I noticed that the CI build is showing as passing now, but it doesn’t recognize that I am the user who made the commits (“Unknown”, “Somebody”):

@tom I am also still not getting comments…

Hi @amkuchta, are you using the same git user settings (email and name) on this computer? That would explain the Unknown. I am still seeing a permissions issue. I don’t THINK it will change anything, but just to humor me, would you go through the cookies step?

@tom I went through the cookies step, and still no joy on the comments… I did notice, however, that I am still getting a ‘CI Passed’ in Codecov.

And I didn’t check my git settings on the other system, but that could have very well been the issue.

@tom did you ever get a chance to open the ticket with GitLab? If yes, can you please share the link to it so that I can monitor?

@amkuchta, apologies, that particular endpoint is authenticated, so it makes sense that we cannot access it directly as such. We made a small change on our end, and I’m curious to see if it’s helped things. Would you be able to push up a new commit and share the SHA?

@tom new year, new commit!

1a192a4e3633c9d01c15e4ea7e2f20e9c6b4c2aa

Let me know if that helps. It’s worth mentioning that it looks like it still is not posting the comment on the merge request.

Hi @amkuchta, sorry for the delay here, we’re still investigating. I’ll reach out in case we need one more SHA, but hopefully not.

Sorry but where did you get information on how to set this up? Docs don’t say anything about getting comments to work with gitlab and the page on comments doesn’t mention webhooks at all. What am I missing?