You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stacked on #322 — both touch plugin sources, so this branches from it rather
than racing it. Retarget to main before #322 merges.
Found auditing what actually runs in just check.
Plugin code had no formatting check and no lint. At all.
exclude = ["plugins/*"] puts the ten plugin crates outside cargo fmt --all andcargo clippy --workspace. test-plugins covered their behaviour; their
shape was covered by nothing.
Seven of the ten were unformatted when fmt-check-plugins was first run.
Clippy happened to be clean, which is luck rather than a gate.
Adds fmt-check-plugins, lint-plugins and fmt-plugins, wires the first two
into check and into the CI plugins job, and formats the crates so the gate
can pass.
🚨 test-plugins passed vacuously, and that exact bug has bitten before
A loop over a glob that matches nothing succeeds. Demonstrated by simulating the
rename that already happened once:
$ # glob changed to plugins/sector-*
All plugin tests passed.
EXIT=0 <-- green, having tested nothing
These directories wereplugins/sector-*. The CI wasm job globbed them, went
silently green at the rename, and gained a [ "$built" -gt 0 ] || exit 1 guard
as a result — its comment says so. That guard was never applied to this recipe,
which is the one just check runs.
Every looping plugin gate now counts what it did and fails on zero.
The guards have their own self-test
A guard nobody has watched fail is itself unverified, so plugin-gates-self-test
runs each loop against a glob that matches nothing and requires a non-zero exit.
It is in check and in CI:
ERROR: no plugins matched
ERROR: no plugins matched
ERROR: no plugins matched
Plugin gate guards fail on an empty match, as they must.
The fmt gate was also mutation-tested — ugly code added to one plugin fails it.
build-plugins no longer carries a hand-written list
It named its ten plugins one per line while test-plugins and the CI wasm job
globbed the same directory. An eleventh plugin would have been tested, linted
and never built. Now globbed, with the same count assertion.
Verification
just check green, 1561/1561, plus:
10 plugin crates formatted correctly.
10 plugin crates linted clean.
All 10 plugin test suites passed.
Plugin gate guards fail on an empty match, as they must.
No CHANGELOG entry: nothing here changes a published crate: the plugin diffs are cargo fmt output only.
Rebased onto main now that #322 has landed (delta conserved exactly — same file/line stat before and after), plus one change from reviewing it.
plugin-gates-self-test did not test the recipes
It looped for gate in test fmt-check lint and ran the same inline copy of the guard three times — $gate was never referenced inside the body. So it proved a fact about bash (a counted loop with a guard fails on an empty match), not a fact about test-plugins, fmt-check-plugins or lint-plugins. Delete the guard from any one of them and the self-test stays green.
That is the same vacuous pass this PR exists to eliminate, one level up — and by the PR's own standard ("a guard nobody has watched fail is itself unverified"), a self-test nobody has watched catch a real removal is in the same position.
Fix: the four looping recipes take prefix=PLUGIN_PREFIX (one PLUGIN_PREFIX := "product-group" at the top of the justfile, so the prefix also stops being repeated five times), and the self-test drives the real recipes with a prefix that matches nothing. Each guard fires before the loop body, so no cargo invocation happens and it stays fast. build-plugins is now covered too — it has the same guard and was not in the self-test.
Watched to fail, on the case that matters. Deleting the guard from lint-plugins alone:
SELF-TEST FAILED: lint-plugins passed on an empty match
error: Recipe `plugin-gates-self-test` failed with exit code 1
The old self-test passes that mutation; the new one does not.
just check green, 1564/1564, plus 10 plugin crates formatted correctly / 10 plugin crates linted clean / All 10 plugin test suites passed / Plugin gate guards fail on an empty match, as they must.
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
surface/docs-onlyContained to documentation; no code depends on ittype/defectSomething published or encoded here is wrong or unbackable nowurgency/nextBlocks work already scheduled
1 participant
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.
Stacked on #322 — both touch plugin sources, so this branches from it rather
than racing it. Retarget to
mainbefore #322 merges.Found auditing what actually runs in
just check.Plugin code had no formatting check and no lint. At all.
exclude = ["plugins/*"]puts the ten plugin crates outsidecargo fmt --alland
cargo clippy --workspace.test-pluginscovered their behaviour; theirshape was covered by nothing.
Seven of the ten were unformatted when
fmt-check-pluginswas first run.Clippy happened to be clean, which is luck rather than a gate.
Adds
fmt-check-plugins,lint-pluginsandfmt-plugins, wires the first twointo
checkand into the CIpluginsjob, and formats the crates so the gatecan pass.
🚨
test-pluginspassed vacuously, and that exact bug has bitten beforeA loop over a glob that matches nothing succeeds. Demonstrated by simulating the
rename that already happened once:
These directories were
plugins/sector-*. The CI wasm job globbed them, wentsilently green at the rename, and gained a
[ "$built" -gt 0 ] || exit 1guardas a result — its comment says so. That guard was never applied to this recipe,
which is the one
just checkruns.Every looping plugin gate now counts what it did and fails on zero.
The guards have their own self-test
A guard nobody has watched fail is itself unverified, so
plugin-gates-self-testruns each loop against a glob that matches nothing and requires a non-zero exit.
It is in
checkand in CI:The fmt gate was also mutation-tested — ugly code added to one plugin fails it.
build-pluginsno longer carries a hand-written listIt named its ten plugins one per line while
test-pluginsand the CI wasm jobglobbed the same directory. An eleventh plugin would have been tested, linted
and never built. Now globbed, with the same count assertion.
Verification
just checkgreen, 1561/1561, plus:No CHANGELOG entry: nothing here changes a published crate: the plugin diffs are
cargo fmtoutput only.