Repository navigation
ci(drift): wire the lint entry point's test and shrink the budget - #1937
Merged
Merged
Conversation
`ci/test_lint_entrypoint.py` guards the root `lint` script -- the developer-facing `uv run --script lint` entry point that runs rustfmt, Clippy and the pinned custom Dylints (the RUST-033 rule, #1793) -- while nothing executed it, so the contract could drift silently: a `lint` that stopped running Dylint, or that returned 0 after a red Clippy, would ship green. Wire it into `DRIFT_UNITTEST_MODULES` (which propagates to `ci/local_gate.py`) and the drift step, drop it from `KNOWN_UNWIRED`, and lower `MAX_UNWIRED` 3 -> 2. Promoting it exposed the same seam as #1934/#1935/#1936: the three existing tests only asserted the all-green path, so the exit code was effectively unguarded. Add five: a failing policy precheck stops the run before any Rust step, a formatting failure skips Clippy and Dylint, a Clippy failure is propagated and skips Dylint, a Dylint failure is propagated, and a missing file fails before running anything.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
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.
What
Wires
ci/test_lint_entrypoint.pyinto the hosted drift registry and lowers the decorative-guard budget.ci/test_lint_entrypoint.pyguards the rootlintscript — the developer-facinguv run --script lintentry point that runsrustfmt --check,soldr cargo clippy --workspace --all-targets -- -D warningsand thenpython -m ci.run_dylint(the mandatory local Clippy + Dylint rule of RUST-033, #1793). Nothing executed the test: it was one of the three entries left inKNOWN_UNWIRED, so alintthat silently stopped running Dylint, or that returned 0 after a red Clippy, would keep passing review.ci/local_suites.py: addedci.test_lint_entrypointtoDRIFT_UNITTEST_MODULES(the single source of truth for both the drift workflow andci/local_gate.py), dropped it fromKNOWN_UNWIRED,MAX_UNWIRED3 -> 2..github/workflows/ci-workflow-drift.yml: added the module token to the drift unit-test step (the guard compares the registry and the workflow sequence).Guard hardening (the
main()seam again)The three existing tests only asserted the all-green path, so the exit code — the only thing that makes
uv run lintfail — was untested. Added five:test_policy_precheck_failure_blocks_every_rust_stepcheck_rust_toolchain_pins.py/enforce_platform_boundary.pystops the run before any Rust tooltest_format_failure_skips_clippy_and_dylintfmt --checkfailure returns 1 and runs neithertest_clippy_failure_skips_dylint_and_is_propagatedtest_dylint_failure_is_propagatedtest_missing_file_fails_before_running_anything.rsargument returns 1 with zero subprocessesReal output
RED proofs (each mutation kills exactly its own test,
lintrestored from a copy — nevergit checkout):return rc if rc else run_dylint()->return run_dylint():test_clippy_failure_skips_dylint_and_is_propagatedfails.return rc->continue:test_policy_precheck_failure_blocks_every_rust_stepfails.File not foundreturn 1:test_missing_file_fails_before_running_anythingfails.test_drift_workflow_step_matches_registry(sequence mismatch).test_every_ci_test_module_is_executed_somewhere("a ci/test_*.py file that nothing runs is a decorative guard").KNOWN_UNWIRED: both stale-entry and3 not less than or equal to 2.After this PR,
KNOWN_UNWIREDistest_run_dylintandtest_select_boards. No production code touched;~/dev/fbuilduntouched.