Repository navigation
[Chore] Add conservative change-based CI validation with audit gates - #2325
zoomote2[bot] wants to merge 4 commits into
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
|
No code issues found in the latest update. See session
Reviewed df28bfb |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Mark the PR ready. Required CI must pass before CodeRabbit starts. Review-state labels are managed by this workflow; do not edit them manually. |
e80a305 to
d13547d
Compare
687f848 to
df28bfb
Compare
|
Closing. A historical sample found one docs-only change in 500 first-parent commits. The runner time saved is small. The classifier, audit gates, and overrides add more maintenance cost than that saving. See #2291. |
Related GitHub Issue
Closes: #2291
Description
Documentation-only pull requests currently run expensive validation that does not depend on those files. This PR adds a conservative classifier and an always-running audit gate to
code-qa,codeql,e2e,mutation-testing, andvisual-regression.Only a successful
docs-onlyclassification on apull_requestevent can reduce validation. The classifier uses the complete merge-base range, NUL-delimited paths, and rename detection. It checks both sides of a rename. Unknown paths or statuses, empty ranges, policy changes, and missing history select full validation or trigger the full-validation fallback.The allowlist contains four root guides and policies, Markdown under
docs/, and Markdown under.github/. Fixture, test, example, snapshot, and generated directories stay excluded. RootREADME.mdstays outside the allowlist because the extension build packages it. Formatting, Knip, and invisible-character checks always run. Dependency review retains its PR-only condition.The required
compileand bothplatform-unit-testjobs start for documentation-only changes. Their expensive steps readRUN_VALIDATION. The requiredcompilejob also fails unless the always-running formatting and classifier/gate tests passed. This preserves the existing required check names without a ruleset update.Each audit gate replays classification and checks the outcomes of its watched jobs. The gate reports mismatches and records job outcomes and best-effort runner-minute metrics. It cannot inspect the step-level conditions inside
compileorunit-test; workflow tests pin those conditions. Replay detects accidental drift, not hostile changes to PR-controlled validation code.The
ci:full-validationlabel forces full validation. Adding or removing labels starts new runs. The repository variableZOO_CODE_REQUIRE_FULL_VALIDATION=trueforces full validation on subsequent runs. Existing event and draft conditions still apply. Non-PR events never receive classification-based skips. CodeQL does not currently run formerge_groupevents.Test Procedure
Run these commands from the repository root:
pnpm test:change-gate pnpm test:mutation-ci pnpm test:code-qa-ci pnpm exec prettier --check docs/ci-change-based-validation.mdThe four script suites passed 215 tests at
687f8489d. Coverage includes classifier results, independent replay-field mismatches, CLI override precedence, required check names, exact step-gating expressions, unusual real git paths, shallow history, renames, summary escaping, and gate CLI inputs. Two clean baselines passed and all 12 targeted mutation probes were caught. These probes are not broader Stryker coverage.The five validation workflows passed for
687f8489d. The full-validation run confirms existing code validation, but it does not prove docs-only matrix check reporting. A separate docs-only PR must target this PR branch to test the new workflows before merge. Verifycompileand both platform check contexts, skipped expensive steps, and all audit gates. Then addci:full-validationand check the full-validation override.Pre-Submission Checklist
docs/ci-change-based-validation.mdexplains behavior and limits.Visual Snapshots
Not applicable. This change affects CI tooling.
Videos
Not applicable.
Documentation Updates
The CI document covers the allowlist, dependency audit, failure behavior, overrides, rollback, and open verification.
CONTRIBUTING.mdlinks to it. No product documentation changes are needed.Additional Notes
format-checkandvalidation-gateare not required checks in the current ruleset. Requiredcompilecarries formatting and policy-test failures. Audit-gate failures only block directly after a maintainer updates the ruleset.validation-gate (code-qa)after live verification. Do not require the CodeQL gate for merge-queue entries until it handlesmerge_group.