Skip to content

Commit a21e008

Browse files
chore: review declarations, skip generated JS tables, comment coverage only on change (#22817)
* chore: review declarations, skip generated JS tables, comment coverage only on change * chore: comment on coverage drops only, tolerate 0.05% project drift * chore: say require_changes gates creating the Codecov comment, not updates * chore: keep timing-dependent profile log branches out of coverage
1 parent e08f0ec commit a21e008

3 files changed

Lines changed: 49 additions & 33 deletions

File tree

‎.coderabbit.yaml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,12 @@ reviews:
7171
path_filters:
7272
# Generated output - never review by hand (see CLAUDE.md "Do not touch")
7373
- "!types.d.ts"
74-
- "!declarations/**"
7574
- "!schemas/**/*.check.js"
7675
- "!schemas/**/*.check.d.ts"
7776
- "!lib/css/data.js"
7877
- "!lib/html/data.js"
78+
- "!lib/javascript/data.js"
79+
- "!lib/javascript/syntax-printer-data.js"
7980
- "!test/**/__snapshots__/**"
8081
- "!yarn.lock"
8182
- "!test/external/**"

‎codecov.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ codecov:
44
# Statuses and the comment wait for `coverage-notify` in test.yml, which
55
# runs once every suite that uploads has finished, not after each upload.
66
manual_trigger: true
7+
# Create the comment only once coverage drops, so a pull request that never
8+
# lowers it (docs, CI config) gets none; a comment once made is kept updated.
9+
comment:
10+
require_changes: "coverage_drop"
711
coverage:
812
precision: 2
913
round: down
@@ -25,6 +29,9 @@ coverage:
2529
- test262-parser
2630
- xmlconf
2731
target: auto
32+
# Timing-dependent lines flip between runs, so a PR that changes no
33+
# code still moves the total by about 0.01%.
34+
threshold: 0.05%
2835
patch:
2936
default:
3037
flags:

‎lib/Compilation.js‎

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3532,20 +3532,24 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
35323532
if (d === 0 || p === 0) continue;
35333533
const t = d / p;
35343534
sum += t;
3535-
if (t <= 10) continue;
3535+
/* istanbul ignore next -- @preserve: only slow (>10ms) modules are logged, timing-dependent */
3536+
if (t > 10) {
3537+
logByValue(
3538+
t,
3539+
` | ${Math.round(t)} ms${
3540+
p >= 1.1 ? ` (parallelism ${Math.round(p * 10) / 10})` : ""
3541+
} ${category} > ${module.readableIdentifier(this.requestShortener)}`
3542+
);
3543+
max = Math.max(max, t);
3544+
}
3545+
}
3546+
/* istanbul ignore next -- @preserve: only slow (>10ms) categories are logged, timing-dependent */
3547+
if (sum > 10) {
35363548
logByValue(
3537-
t,
3538-
` | ${Math.round(t)} ms${
3539-
p >= 1.1 ? ` (parallelism ${Math.round(p * 10) / 10})` : ""
3540-
} ${category} > ${module.readableIdentifier(this.requestShortener)}`
3549+
Math.max(sum / 10, max),
3550+
`${Math.round(sum)} ms ${category}`
35413551
);
3542-
max = Math.max(max, t);
35433552
}
3544-
if (sum <= 10) return;
3545-
logByValue(
3546-
Math.max(sum / 10, max),
3547-
`${Math.round(sum)} ms ${category}`
3548-
);
35493553
};
35503554
/**
35513555
* Log by loaders summary.
@@ -3590,30 +3594,34 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
35903594
}
35913595
}
35923596
sum += innerSum;
3593-
if (innerSum <= 10) continue;
3594-
const idx = key.indexOf("!");
3595-
const loaders = key.slice(idx + 1);
3596-
const moduleType = key.slice(0, idx);
3597-
const t = Math.max(innerSum / 10, innerMax);
3597+
/* istanbul ignore next -- @preserve: only slow (>10ms) loader groups are logged, timing-dependent */
3598+
if (innerSum > 10) {
3599+
const idx = key.indexOf("!");
3600+
const loaders = key.slice(idx + 1);
3601+
const moduleType = key.slice(0, idx);
3602+
const t = Math.max(innerSum / 10, innerMax);
3603+
logByValue(
3604+
t,
3605+
` | ${Math.round(innerSum)} ms ${category} > ${
3606+
loaders
3607+
? `${
3608+
modules.length
3609+
} x ${moduleType} with ${this.requestShortener.shorten(
3610+
loaders
3611+
)}`
3612+
: `${modules.length} x ${moduleType}`
3613+
}`
3614+
);
3615+
max = Math.max(max, t);
3616+
}
3617+
}
3618+
/* istanbul ignore next -- @preserve: only slow (>10ms) categories are logged, timing-dependent */
3619+
if (sum > 10) {
35983620
logByValue(
3599-
t,
3600-
` | ${Math.round(innerSum)} ms ${category} > ${
3601-
loaders
3602-
? `${
3603-
modules.length
3604-
} x ${moduleType} with ${this.requestShortener.shorten(
3605-
loaders
3606-
)}`
3607-
: `${modules.length} x ${moduleType}`
3608-
}`
3621+
Math.max(sum / 10, max),
3622+
`${Math.round(sum)} ms ${category}`
36093623
);
3610-
max = Math.max(max, t);
36113624
}
3612-
if (sum <= 10) return;
3613-
logByValue(
3614-
Math.max(sum / 10, max),
3615-
`${Math.round(sum)} ms ${category}`
3616-
);
36173625
};
36183626
logNormalSummary(
36193627
"resolve to new modules",

0 commit comments

Comments
 (0)