coverage:
status:
default_rules:
flag_coverage_not_uploaded_behavior: exclude
project:
default: off
client:
target: auto
threshold: 0.1%
flags:
- client
backend:
target: auto
threshold: 0.1%
flags:
- backend
flags:
backend:
paths:
- server/
carryforward: true
client:
paths:
- client/
carryforward: true
comment:
layout: 'reach, diff, flags, files'
behavior: new
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
github_checks:
annotations: true
Description
codecov detects when coverage is dropped below the threshold but does not block a PR from being merged.
CI/CD or Build URL
Github Actions
Uploader
Bash.
Expected Results
The required check to fail and the PR from being blocked from emerging.
Actual Results
The client flag check is not started and the server flag is not available when setting branch protection rules.
My repo is private so idk how a SHA will help you. I was about to send over logs from the CI run when I noticed they have an error message. The checkout’s fetch is already set to 0. Should I try changing the fetch depth?
I played around with the fetch depth. No errors when running the codecov bash, but in a PR that ads 16k lines of code, it measure the coverage differance as 0%.
@tom I was able to narrow down the source of this problem further. The incorrect calculations were caused by jest being misconfigured. PRs are now blocked if the coverage drops in my client project. However I’m still having issues with the server projects. I’m unable to add it as a required check in the PR. The client is available (and I’ve already added it), but server is not.
What is patch and why is codecov/project/server missing?
coverage:
status:
default_rules:
flag_coverage_not_uploaded_behavior: exclude
project:
default: off
client:
target: auto
threshold: 0.1%
flags:
- client
backend:
target: auto
threshold: 0.1%
flags:
- backend
flags:
backend:
paths:
- server/
carryforward: true
client:
paths:
- client/
carryforward: true
comment:
layout: 'reach, diff, flags, files'
behavior: new
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
github_checks:
annotations: true
The logs from the bash uploader on a PR where coverage for the server project is uploaded. In this commit, there’s a 30% drop in coverage.
==> git version 2.31.1 found
==> curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3
Release-Date: 2020-01-08
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets
==> GitHub Actions detected.
Env vars used:
-> GITHUB_ACTIONS: true
-> GITHUB_HEAD_REF: del-tests
-> GITHUB_REF: refs/pull/1744/merge
-> GITHUB_REPOSITORY: remo-co/remo-conference
-> GITHUB_RUN_ID: 872211434
-> GITHUB_SHA: 869fa3d9cdb0ae9c3b836e363d6af239139fbefd
-> GITHUB_WORKFLOW: Run Tests
Fixing merge commit SHA 869fa3d9cdb0ae9c3b836e363d6af239139fbefd -> 34fef86e49c852258c1f1933e766c960908a89c2
project root: /home/runner/work/remo-conference/remo-conference
Yaml found at: codecov.yml
==> Running gcov in /home/runner/work/remo-conference/remo-conference (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ /home/runner/work/remo-conference/remo-conference
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ /home/runner/work/remo-conference/remo-conference/coverage/coverage-final.json bytes=1137592
==> Appending adjustments
https://docs.codecov.io/docs/fixing-reports
+ Found adjustments
==> Gzipping contents
148K /tmp/codecov.Et74tO.gz
==> Uploading reports
url: https://codecov.io
query: branch=del-tests&commit=34fef86e49c852258c1f1933e766c960908a89c2&build=872211434&build_url=http%3A%2F%2Fgithub.com%2Fremo-co%2Fremo-conference%2Factions%2Fruns%2F872211434&name=&tag=&slug=remo-co%2Fremo-conference&service=github-actions&flags=server&pr=1744&job=Run%20Tests&cmd_args=t,c,F
-> Pinging Codecov
https://codecov.io/upload/v4?package=bash-1.0.3&token=secret&branch=del-tests&commit=34fef86e49c852258c1f1933e766c960908a89c2&build=872211434&build_url=http%3A%2F%2Fgithub.com%2Fremo-co%2Fremo-conference%2Factions%2Fruns%2F872211434&name=&tag=&slug=remo-co%2Fremo-conference&service=github-actions&flags=server&pr=1744&job=Run%20Tests&cmd_args=t,c,F
-> Uploading to
https://storage.googleapis.com/codecov/v4/raw/2021-05-24/7322BE1301D351472BD266A98261C4C5/34fef86e49c852258c1f1933e766c960908a89c2/b2deea6e-10e5-4304-a62d-5559d1052e29.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=GOOG1EQM3VGPYSAFECJRMNAFIPCV2R3P2BOORCJC7NM537NPJQSFLHUDNIDWA%2F20210524%2FUS%2Fs3%2Faws4_request&X-Amz-Date=20210524T174830Z&X-Amz-Expires=10&X-Amz-SignedHeaders=host&X-Amz-Signature=82b6a219b6a4d4409fb37f73f2059786c9325459c20f5fbbf1e280a989a4292a
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 145k 0 0 100 145k 0 478k --:--:-- --:--:-- --:--:-- 478k
-> Reports have been successfully queued for processing at https://codecov.io/github/remo-co/remo-conference/commit/34fef86e49c852258c1f1933e766c960908a89c2
0
@boris, have you uploaded a coverage report with the backend (I think you meant backend, there is no server status in your yaml) flag? If that has never happened, it might explain why GitHub is unaware of the status check.
The patch check deals with coverage on new code changes detailed here (as opposed to project which is meant to encompass the entire repository).
It was starting me in the face and I still didn’t see it. Once I renamed the flag from backend to server everything started working correctly. Thank you Tom!