Codecov no longer posting comments to GitLab Merge Requests on private repos

Description

Codecov stopped commenting in our GitLab Merge Requests (CI/CD) in our private projects. In the job log, bash uploader works fine and uploads to codecov.

Commit SHAs

One of the lasts commits that were commented out correctly (part of a MR):
53000c120223173979a8bae686096d8b08162415

Latest commit in my repo (until now), which is not commented out:
51265ebd8996bb3a7d92f2faa03c861149b44ce6

Repository

Private repo, and for proprietary reasons, I won’t be able to make it public.

CI/CD or Build URL

Private job

Uploader

Please provide which uploader you are using and command used to run it (e.g. Bash, Node, Python, GitHub Actions, etc…). If you are not using the bash uploader, we recommend switching to it before opening an issue here.

Codecov Output

Running after script...
$ bash <(curl -s https://codecov.io/bash)
  _____          _
 / ____|        | |
| |     ___   __| | ___  ___ _____   __
| |    / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| |  __/ (_| (_) \ V /
 \_____\___/ \__,_|\___|\___\___/ \_/
                              Bash-1.0.1
==> git version 2.24.3 (Apple Git-128) found
==> curl 7.64.1 (x86_64-apple-darwin20.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.41.0
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets
==> GitLab CI detected.
    project root: .
--> token set from env
    Yaml found at: .codecov.yml
==> Processing Xcode reports via llvm-cov
    DerivedData folder: /Users/cubos/Library/Developer/Xcode/DerivedData
    -> No Swift coverage found
    -> Running gcov for Obj-C
==> 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=59250
==> Appending adjustments
    https://docs.codecov.io/docs/fixing-reports
    + Found adjustments
==> Gzipping contents
         20K	/tmp/codecov.NM1Fsp.gz
==> Uploading reports
    url: https://codecov.io
    query: branch=staging&commit=51265ebd8996bb3a7d92f2faa03c861149b44ce6&build=1187792985&build_url=&name=&tag=&slug=credifit%2Fmobile%2Fconsignado&service=gitlab&flags=&pr=&job=1187792985&cmd_args=
->  Pinging Codecov
https://codecov.io/upload/v4?package=bash-1.0.1&token=secret&branch=staging&commit=51265ebd8996bb3a7d92f2faa03c861149b44ce6&build=1187792985&build_url=&name=&tag=&slug=credifit%2Fmobile%2Fconsignado&service=gitlab&flags=&pr=&job=1187792985&cmd_args=
->  Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-04-16/xxxxxxx
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 18595    0     0  100 18595      0  26949 --:--:-- --:--:-- --:--:-- 26910
    -> Reports have been successfully queued for processing at https://codecov.io/gitlab/credifit:mobile/consignado/commit/51265ebd8996bb3a7d92f2faa03c861149b44ce6

Expected Results

Have comments of codecov directly in GitLab Merge Request.

Actual Results

No comments are added to Merge Request.

Additional Information

January, 28th 2021 was the last MR that was commented by codecov in our 3 private projects that use same codecov settings and are under my username and credentials.

After that, with no changes in our GitLab CI/CD variables, it stopped. Not sure if it’s related to a new version in GitLab or Codecov, but it looks like this date has something to do with it.

Webhook test for Merge Request events works fine:
image
image

@isorensen at first glance, it looks like your bot is not valid. Either the bot no longer has the proper permissions or if a user, is no longer a part of the organization. Can you double-check that the bot is still valid?

Thanks a lot, @tom. I revoked all access tokens in my user integration (GitLab user that was connected), added again, and still nothing. Is there any other suggestion to test my user? Should I use a bot instead? I’m pretty sure “I’m part of the organization”, since I’m the one doing all these tests, with the same user, and I’m the owner of the repos.

Commit SHA of this last MR: 373e44536229c1ffc3990b9fbc29e13a358dbc1a

Screenshot showing that there’s no “external job” in the MR:

Screenshot of codecov saying “Waiting for CI to complete”, even though I set require_ci_to_pass: no and wait_for_ci: no

My .codecov.yaml:

codecov:
  require_ci_to_pass: no
  notify:
    wait_for_ci: no

coverage:
  precision: 2
  round: up
  range: "90...100"

parsers:
  gcov:
    branch_detection:
      conditional: yes
      loop: yes
      method: no
      macro: no

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

@isorensen, sorry if I wasn’t clear, you need to specify the bot in your .codecov.yaml file like

codecov:
  bot: isorensen #the bot username

Thanks @tom . I just did that, in SHA c223b7c486f393e7d7a3108079debcefbd2fbcf7
Can you in your side? It doesn’t seem to have changed in my pipeline (still running, though).

I just pressed this button, and nothing happened.

Is this yaml section supposed to be empty? I have the .codecov.yml in my project, and during CI, it says “codecov.yml found”, but from the frontend, it doesn’t show anything:

Well, let’s see:
I added manually the bot: isorensen directly in codecov frontend, and then pushed the notification, and it finally worked.

My project filename is .codecov.yml . I just renamed it to codecov.yml (without the . ) to check if this is the problem, although codecov docs allow . files.

@tom , it seems that this was the problem. The file needs to be without the . to work properly. Can you check in your side if this is actually a bug? From my side, it seems we can close this issue.

@isorensen, I’m thrilled it’s working for you now, but I’m confused about the resolution. From our side, we actually were seeing your yaml file with and without the dot. But there was an issue with the bot being set. I don’t have the tools to uncover why that was in the past (as it is set up properly now), but I have added more logging on our side in case this happens again.

I can confirm, though, that things look as they should from our side now.

Thanks @tom . In fact, since I applied more than one issue at once, I couldn’t isolate the solution. But thanks, once again, for the effort. Regards, Eduardo

1 Like