-
-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathcodecov.yml
More file actions
135 lines (131 loc) · 8.22 KB
/
Copy pathcodecov.yml
File metadata and controls
135 lines (131 loc) · 8.22 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Codecov configuration.
#
# The real coverage gate is `patch`: changed lines and branches in a PR must be
# >=99% covered. Patch coverage depends only on the PR's own diff, so merging
# one PR can never push another below the bar -- this is what kills the cross-PR
# churn the old global vitest threshold caused.
#
# `project` (whole-repo total) is informational only: it is reported as a trend
# but never blocks a merge. vitest keeps a loose 90% local backstop separately.
codecov:
# Don't post a verdict until the CI run that produced the report has finished.
require_ci_to_pass: true
notify:
# Hold every status and comment until CI says the uploads are done, rather than guessing from a
# count (#9801). `after_n_builds` fires on the Nth upload to ARRIVE, and arrival order does not
# match importance: validate-code's rees / control-plane / engine reports land in ~2 minutes while
# validate-tests is still running the backend lcov that covers most of src/**. So the verdict was
# computed from a partial report -- codecov/patch went pass, then fail, while validate-tests was
# still pending, with Codecov's own comment printing `backend | BASE 1 | HEAD 0`.
#
# That is not cosmetic here: the gate closes a contributor PR on ANY red check, codecov/patch
# included, so a transient partial-report red can close a PR that has no defect.
#
# Raising the count cannot fix it -- see the reasoning preserved on after_n_builds below -- because
# a count cannot express "wait for the backend upload specifically". manual_trigger can: Codecov
# sends nothing until `codecovcli send-notifications` runs, and the codecov-notify job in
# .github/workflows/ci.yml runs that once, after every uploading job has finished.
#
# Failure mode if the trigger never runs: codecov/patch simply never posts, so the gate sees an
# incomplete check set and waits. That is fail-safe -- it cannot merge unreviewed and cannot
# false-close -- which is the whole point of the change.
manual_trigger: true
# Inert while manual_trigger is true, and kept deliberately so removing manual_trigger restores the
# correct value rather than the default. The count that ALWAYS lands whenever validate-tests runs:
# since the 2026-07-24 unsharding, the backend suite produces ONE whole-suite lcov upload
# (flags: backend) instead of the former 3 shard uploads this threshold was sized for. It must stay
# 1, not 2, even though review-enrichment / control-plane add their own flag uploads on PRs that
# touch them -- those uploads only exist on such PRs, and a floor above the guaranteed minimum would
# leave codecov/patch permanently un-posted on every other PR.
after_n_builds: 1
coverage:
status:
patch:
default:
target: 99%
threshold: 0%
# Keep the patch status in error if the upstream CI run failed.
if_ci_failed: error
# Suppress codecov/patch on main pushes; uploads still maintain history.
only_pulls: true
project:
default:
informational: true
# review-enrichment ships its coverage under its own flag (produced + uploaded by validate-code, ci.yml).
# Scoping the flag to review-enrichment/ keeps its project trend honest, and carryforward keeps that trend
# stable on PRs that don't re-run REES (its coverage is unchanged then, so nothing re-uploads under this flag).
# Patch gating (codecov/patch above) is unaffected by carryforward -- patch is computed on the PR's own diff,
# so a review-enrichment/** change is gated against this flag's fresh upload for that PR.
flags:
rees:
paths:
- review-enrichment/
carryforward: true
control-plane:
paths:
- control-plane/
carryforward: true
# @loopover/engine's real behavior suite is its own node:test suite (packages/loopover-engine/test/**),
# not vitest's root test/** -- that suite was invisible to Codecov entirely until now (#9064), even
# though packages/loopover-engine/src/** is already in vitest's coverage.include and counted by the
# unflagged `backend` upload for whatever a root test/** import happens to exercise. This flag is
# additive to that: both reports' hits are unioned for the same lines, so a PR touching engine source
# now gets credit from the suite that actually behavior-tests it, not just an incidental vitest import.
engine:
paths:
- packages/loopover-engine/src/
carryforward: true
comment:
layout: "condensed_header, diff, flags, files"
require_changes: false
# Coverage is collected by vitest (v8) over src/**, packages/loopover-engine/src/**,
# packages/loopover-miner/{lib,bin}/**, packages/loopover-mcp/{lib,bin}/**, and
# packages/discovery-index/src/** (plus review-enrichment/src/** via the standalone `rees` flag, c8 over
# its built dist remapped through source maps); mirror vitest's exclusions here so the Codecov total
# matches the local report.
ignore:
- "src/env.d.ts"
# Type-ONLY declaration modules (#9810): zero runtime statements, so v8 instruments nothing and the whole
# file reports 0% — the same artifact src/env.d.ts is ignored for above. Adding a single field to one of
# these otherwise fails codecov/patch on lines that can never execute. Guarded, not trusted: the
# "codecov ignore list stays honest" test in test/unit/codecov-ignore-type-only.test.ts fails if any path
# listed here ever gains a runtime declaration, so an ignore can never quietly start hiding real code.
- "packages/loopover-engine/src/types/manifest-deps-types.ts"
- "packages/loopover-engine/src/types/predicted-gate-types.ts"
- "packages/loopover-engine/src/types/reward-risk-types.ts"
- "apps/**"
- "test/**"
- "scripts/**"
# Self-host process entry + build-time stubs: exercised by the Docker build+boot smoke test
# (.github/workflows/selfhost.yml), not unit-coverable without booting a server/subprocess.
- "src/server.ts"
# review-enrichment's process entrypoint (#1473) -- same "Docker build+boot, not unit-coverable" reasoning
# as src/server.ts above; module-scope serve() binds a real port as a side effect of importing this file,
# so it's never imported by test/**. Pre-existing gap: this entry was missing even though
# discovery-index/src/server.ts's own header comment already claimed review-enrichment/src/server.ts got
# "the same treatment" -- surfaced by #8290 finally touching enough of this file's lines to trip
# codecov/patch on it.
- "review-enrichment/src/server.ts"
- "src/selfhost/cf-workers-shim.ts"
- "src/selfhost/stubs/**"
# Postgres runtime adapters: validated by the real-Postgres integration test (test/integration/selfhost-pg.ts,
# gated on PG_TEST_URL) + the real-PG boot. The dialect translation itself IS unit-tested (pg-dialect.ts).
- "src/selfhost/pg-adapter.ts"
- "src/selfhost/pg-queue.ts"
# discovery-index's process entrypoint (#7164) -- same "Docker build+boot, not unit-coverable" reasoning
# as src/server.ts above; app.ts (everything it wires together) is what tests actually import.
- "packages/discovery-index/src/server.ts"
# discovery-index's Cloudflare Container/Durable Object entry point (#7167) -- pure infra glue exercised
# only by real Cloudflare Containers infrastructure, same reasoning as server.ts above.
- "packages/discovery-index/src/worker.ts"
- "packages/discovery-index/src/env.d.ts"
- "packages/discovery-index/worker-configuration.d.ts"
# NOTE: packages/loopover-miner/bin/loopover-miner.ts and (once #7291 migrates it)
# packages/loopover-mcp/bin/loopover-mcp.ts are plain CLI dispatchers (no exports, terminate via
# process.exit()) exercised only via real subprocess spawn (test/unit/support/{miner,mcp}-cli-harness.ts),
# which v8 coverage can't instrument -- the same shape as src/server.ts above. They are deliberately NOT
# listed here: test/unit/codecov-policy.test.ts (#4864) requires packages/loopover-miner to never get a
# blanket ignore-list exemption, precisely so a change to the dispatcher forces either real coverage or a
# testable-export refactor (the path bin/loopover-miner-mcp.ts's createMinerMcpServer already took)
# instead of a silent pass. Both files are still in vitest.config.ts's coverage.include (so a PR that
# touches one now genuinely needs to satisfy codecov/patch on it, not skip grading entirely).