Repository navigation
feat(audit): a pull-request preset for chant audit and chant lint, held to a precision bar on a replay (#5118) - #5127
Merged
Merged
Conversation
…ld to a precision bar on a replay (#5118) chant audit and chant lint take --preset pull-request and --baseline <file>. The preset places each rule as merge-blocking, report-only or a tool notice, drops findings below warning, and fails the run on a merge-blocking finding. With --baseline, the same command's JSON or SARIF report on the base, only findings whose identity is not in it are reported. Identities are computed over the whole run before anything is left out, and lint findings carry their identity, gate and the post-synth locator. test/pr-preset-replay holds the replay harness, the labelled corpus of the findings it found on 159 merged changes of a public Kubernetes infrastructure repository, and a unit test that scores the preset against it. On that window the preset keeps all 17 true findings, 17 of 17 merge-blocking, on 3 changes, against 17 of 721 with every rule on. On the six months before it the preset blocks nothing; the merge-blocking list first proposed blocked 8 changes there with no true finding, so GRAF104, GRAF105, WK8203, WK8204, WK8205 and TF002 report and do not block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5118
The last open item of the estate-read work in chant (#5105). It adds a
pull-requestpreset forchant auditandchant lint, held to a precision bar on a replay of real history.What it adds
--preset pull-requestand--baseline <file>onchant auditandchant lint. The baseline is the same command's JSON or SARIF report on the base, and only findings whose identity (audit findings carry no stable identity, so a rename reports every old finding as new #5106) is not in it are reported. A merge-blocking finding fails the run. The floor iswarning. A rule in no set is off, and the source gives each off rule's measured reason (packages/core/src/audit/pull-request-preset.ts).test/pr-preset-replay/replay.ts(just replay-pr-preset <corpus> [work]). On both sides of every change it reruns audit, per-file import with lint, and helm localize, then compares by identity and scores the labelled findings. It exits 1 below the bar, on a lost true finding, when more than 10 changes are blocked, or when a merge-blocking finding has no label.bar.test.tsscores the labelledcorpus.jsonin the unit suite. The corpus holds commit SHAs, paths, rule ids and labels, with no people.replay.e2e.test.tsreruns the whole replay whenCHANT_REPLAY_CORPUSis set.guide/pull-request-check.mdx, with flag rows incli/audit.mdxandcli/lint.mdx, a CHANGELOG entry, and a level-0 exception row.chant lint --format jsongainslocator, and the getting-started golden also picks up theentityfield it was missing.Rule lists, changed from the issue
Six rules the issue lists as merge-blocking (GRAF104, GRAF105, WK8203, WK8204, WK8205, TF002) had no true finding in either window, so they are report-only. The numbers are on #5118.
Done when
score.tsbarFailures; it exited 1 before labelling).Gates on this branch
just buildand coretscare clean.scripts/release-floors.ts --npmagrees.