-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcodecov.yml
More file actions
60 lines (56 loc) · 2.4 KB
/
Copy pathcodecov.yml
File metadata and controls
60 lines (56 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Codecov configuration.
#
# Background: during the Codecov -> Harness migration the patch/diff line
# attribution became unreliable for this repo — Codecov reported lines as
# uncovered (e.g. the whole of Gate::classify_upgrader_effect() and
# Sudo_Session::set_pending_login_token()) that are demonstrably executed by
# passing unit tests, including a covered caller (Plugin::capture_login_session_token)
# invoking a callee Codecov marked uncovered. Codecov's own report flagged the
# cause: base and head commits had a different number of coverage uploads
# (base 2, head 1), because the coverage job runs on both `push` (base, on
# main) and `pull_request` (head), so a merged SHA is built twice.
#
# This config has two goals:
# 1. Make the status checks tolerant of that measurement noise so they do not
# block on false-negative diffs.
# 2. Make per-commit upload counts deterministic so base/head comparisons are
# apples-to-apples and the "different number of uploads" warning stops.
codecov:
require_ci_to_pass: true
notify:
# Coverage is produced by exactly one job ("Unit Tests (Coverage)" in
# phpunit.yml, flag: unit). Treat a commit's report as complete after a
# single upload instead of waiting for — or merging in — a second build of
# the same SHA. This is the fix for the base(2)/head(1) upload mismatch.
after_n_builds: 1
wait_for_ci: true
coverage:
status:
project:
default:
# Compare to the base commit, but tolerate small drops so measurement
# noise (and the genuinely near-unreachable defensive branches) cannot
# fail the check on an otherwise-improving PR.
target: auto
threshold: 1%
patch:
default:
# Keep a meaningful floor for new code, but report-only: patch line
# attribution is the part Codecov gets wrong here, so it must not block
# a merge on its own. Revisit (drop `informational`) once the
# Codecov/Harness upload pipeline is stable.
target: 80%
threshold: 5%
informational: true
flags:
unit:
# The single coverage upload covers the whole production tree; with one
# deterministic upload per commit there is nothing to carry forward, and
# disabling it avoids stale fills polluting the diff.
carryforward: false
paths:
- includes/
comment:
layout: "reach, diff, flags, files"
require_changes: true
after_n_builds: 1