chore: block new problems from being added to the suppressions files - #10314
cryptodev-2s wants to merge 28 commits into
Conversation
4e4678f to
9cef92a
Compare
fbcb221 to
959ec13
Compare
9cef92a to
9aed625
Compare
959ec13 to
3224682
Compare
9aed625 to
ff0c01f
Compare
bbe7798 to
af34ba8
Compare
d0d8c5a to
8edf3d7
Compare
af34ba8 to
fb002d8
Compare
8edf3d7 to
ca79838
Compare
d69c0e5 to
864c3b4
Compare
fe4bbc3 to
1c75539
Compare
864c3b4 to
c36d921
Compare
1c75539 to
091d75b
Compare
19a71b8 to
6b78531
Compare
64a27e4 to
4c978fd
Compare
6b78531 to
cac109f
Compare
4c978fd to
1038367
Compare
cac109f to
f30ac88
Compare
1038367 to
46b5907
Compare
There was a problem hiding this comment.
We occasionally do need to add new lint suppressions, e.g., when updating the Oxlint configs, in which case we need to be able to bypass this check.
Mark suggested allowing it if the pull request is approved by the Core Platform team, which sounds like a good idea to me.
There was a problem hiding this comment.
Good catch, I forgot we had a discussion about this during last retro
There was a problem hiding this comment.
@Mrtenz as this PR scope already grow do you think I can do a follow up on this ? otherwise is a label enough ?
Node 24 strips types by default, which is what CI runs and what .nvmrc pins.
It read the baseline from the first parent, which is the base only when CI checks the pull request out as a merge commit. Anywhere else that is just the previous commit, so a suppression added earlier on the branch went unnoticed. It now falls back to the merge base with the target branch.
CI checks a pull request out as the merge of the branch into its base, so the first parent is the base. A merge commit made by hand is the other way round, its first parent being the branch, so merging main into a branch locally had the check measure against the branch's own tip and miss what it had added.
Adding a suppression is sometimes the right call, updating the Oxlint configs being the example, so the check can be waived with the allow-new-suppressions label. It still reports what was added either way, leaving the addition in the diff and the waiver in the pull request's history. It now runs on pull requests only, as the merge queue has neither the merge commit nor the label in reach.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 39074d1. Configure here.
A label applied after the check fails was invisible to it: the pull_request trigger does not fire on labeled, and a re-run replays the original event payload. Reading the labels back over the API means applying the label and re-running the job now works.
Reading the waiver label off the event payload means a label applied after the run started is invisible, and a re-run replays the original payload. The other label driven checks here solve that by firing a fresh run on labeled and unlabeled, which needs a trigger of its own. The job used nothing from lint-build-test.yml anyway, so it moves out and picks up the same trigger.
A label anyone can apply is not much of a gate. CODEOWNERS is, so the two suppressions files now need a core platform review to change at all. The label stays as the way to turn CI green, but on its own it no longer gets anything merged.
Reverts the CODEOWNERS change, which would have made removals need a core platform review too, and those are the ones we want to be easy. The failure now just points at core platform instead of telling whoever hits it which label turns the check green.
Running it first only told us what was waived, which the failing run before the label went on already did. Checking the label first reads simpler, and this is all going to be replaced by core approval anyway.
No point checking out and installing just to decide we are not going to run the check.

Explanation
lint:oxlintandlint:tsc:checkstop new problems from landing, but both have an escape hatch: regenerating their suppressions file. That parks a problem instead of fixing it.lint:suppressionscloses it. Measured against the base branch,oxlint-suppressions.jsonandtsc-suppressions.jsonmay only shrink:The comparison is per file and per rule, so deletions never offset an addition.
CI checks a pull request out as the merge into its base, so the baseline is the first parent and there is nothing extra to fetch. Outside CI there is no merge commit, so pass a ref:
yarn lint:suppressions origin/main.Bypass
The
allow-new-suppressionslabel skips the job, for when suppressions genuinely have to be added (a new package, mostly). It needs creating, and longer term this should be a Core Platform approval rather than a label anyone can apply.The Oxlint config change
Tests under
scripts/have toimport { jest } from '@jest/globals', as Jest does not inject it in ESM, andno-shadowflagged every one. Left alone, every new script test would arrive with a fresh suppression and fail this check. Allowing that one name removes 41 lines fromoxlint-suppressions.json.Worth knowing
The check is strict, per file and per rule. A type error that moves between files, or a rename that rewrites paths, reads as an addition in one file and a removal in the other, so it wants fixing rather than re-suppressing.
Checklist
Note
Low Risk
Changes are limited to CI and repo lint tooling; no runtime product behavior, though PRs that legitimately need new suppressions must use the bypass label until approval flows exist.
Overview
Adds a
lint:suppressionscheck (andyarn lint:suppressions) that fails whenoxlint-suppressions.jsonortsc-suppressions.jsongrow relative to the base branch—new file/rule entries or higher per-rule counts are rejected; shrinking or removing suppressions still passes. Baselines come fromHEAD^1in GitHub Actions and fromgit merge-baselocally (defaultorigin/main).A new Lint Suppressions workflow runs that check on pull requests (re-running on label changes) and can be skipped with the
allow-new-suppressionslabel; it also asserts a clean working tree after the job.Oxlint now allows
jestinno-shadowforscripts/**/*.test.ts, which removes a batch of script-test suppressions that would otherwise trip the new gate.lint-tscscripts drop--experimental-strip-types, andSUPPRESSIONS_FILE_NAMEis shared fromtsc-suppressions.tsfor the new checker and tests.Reviewed by Cursor Bugbot for commit 89fa89f. Bugbot is set up for automated code reviews on this repo. Configure here.