Repository navigation
Touch no file for a Maven dependency that is not wired, and say what the run did - #2165
Mikola Lysenko (mikolalysenko) wants to merge 4 commits into
Conversation
`formats/maven/mod.rs` declared `mirror` above `declared_maven`, the order a merge left them in. `cargo fmt --all -- --check` fails on it. CI does not run fmt, so nothing was red; the tree is formatted again. No behaviour changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two things that landed side by side meet in one scan: the mirror gate holds a dependency back when a mirror of the machine's settings would take its Socket repository, and the heal respells a `.mvn/maven.config` line an earlier release wrote. The heal is tied to no dependency, because that line stops Maven 3.9.2 to 3.9.8 from starting with `-f` from outside the project whatever the run redirects. The new test pins how they compose: a project an earlier release wired, scanned behind a mirror that captures its repository, gets the mirror's warning for the dependency and the heal for the config. Nothing else is written, and the dependency is recorded as decided and not confirmed, as the gate records every dependency it holds back. No behaviour changes: the test passes on main as it stands. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Two warnings spoke for more than the dependency they are about. The mirror gate said `pom.xml and .mvn/ were left as they are`; the reactor planner's refusal said `the poms and .mvn/ were left as they are`; and the contract said under both, and under two more reason codes, that `.mvn/` stays byte-identical. That stopped being always true when the heal of a `.mvn/maven.config` an earlier release wrote landed: every hosted scan that reads such a file respells its Trusted Checksums directory line, whatever the run redirects, and so also a run whose only Maven patch is gated or refused. Both texts now say what was meant: nothing was written for the dependency (no pin in a pom, no line in `.mvn/`). `CLI_CONTRACT.md` and `docs/ecosystems.md` say the same under the four reason codes, and the section on mirrors names the respelling as the one thing such a run may still write, with the edit it is reported under. The test of the heal asserts the refusal's wording in the run where the old wording was false (a reactor root refused whole, its config healed), and the test of the mirror gate does the same for the gate's. Outcome change: the wording of two warning details. No file a scan writes changes, no reason code, no exit status. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The warnings for a dependency that is not wired say that nothing was written for it. Three things made that less than true. A grant whose hash is malformed drops the checksum lines an earlier release wrote for its suffixed version, and those drops were queued before the rewriter decided anything about the dependency. So a dependency the reactor planner refused, or one skipped because the build selects another version or because the selection cannot be read, could still have `.mvn/checksums/checksums.sha256` rewritten. The drops now wait for the decision: they are queued when the pin lands this run, or when an earlier run's pin is in place, and not otherwise. A dependency that is refused or skipped has no file touched for it, which is what the mirror gate already did for the dependencies it holds back. The mirror gate's warning read as a statement about the files, "no pin in pom.xml", and it is also shown when the poms already hold the wiring an earlier run wrote. It now says what this run did. Where the earlier wiring is in place it says so, says that a build behind the mirror fails on it, and names the command that takes it out beside the ways to make it resolve. The clause was spelled twice, with "pom.xml" in one warning and "a pom" in the other and in the contract. It is one constant now, used by the mirror gate and by the reactor planner's refusal. The contract and the ecosystem notes use one phrase for every Maven reason code, "the run writes nothing for the dep", and say once what it covers. The row for a selection that cannot be read no longer opens with a claim that its own reactor case contradicts. Outcome changes: a hosted scan no longer rewrites the checksums file for a dependency it refuses or skips; the wording of two warning details. No reason code and no exit status changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Warning text is unified via
Reviewed by Cursor Bugbot for commit 0e29562. Configure here. |
Follow-up to #2135 (the Maven mirror guard), which merged while these items were still local. Draft.
What was wrong
redirect_maven_mirror_captures_repository(Do not wire a hosted Maven pin behind a mirror that would take its repository #2135) saidpom.xml and .mvn/ were left as they are. The reactor planner's refusal (Patch Maven reactors and ${property} versions in hosted mode #2114:redirect_maven_multimodule_unsupportedand the other codes a refused plan is reported under) saidthe poms and .mvn/ were left as they are.CLI_CONTRACT.mdsaid of both, and of other Maven reason codes, that.mvn/stays byte-identical or that nothing is written. Two things made that false:.mvn/maven.configan earlier release wrote respells its Trusted Checksums directory line, whatever the run redirects..mvn/checksums/checksums.sha256rewritten.cargo fmt --all -- --checkfails onmain.formats/maven/mod.rsdeclaresmirrorabovedeclared_maven, the order a merge left them in. CI does not run fmt, so nothing was red.What changes
MAVEN_WROTE_NOTHING), used by the mirror gate and the reactor planner's refusal:this run wrote nothing for it (no pin in a pom, no line or file under .mvn/).socket-patch rollback <purl>), beside the ways to make it resolve.CLI_CONTRACT.mdanddocs/ecosystems.mduse one phrase under every hosted Maven reason code, "the run writes nothing for the dep", and the contract says once what it covers and what it does not (wiring an earlier run left, the one respelled config line). The row forredirect_maven_selection_undeterminedno longer opens with a claim its own reactor case contradicts.modlines are sorted.Outcome changes
.mvn/checksums/checksums.sha256for a dependency it refuses or skips. The stale line of a malformed grant still goes when the pin lands or is in place.No reason code is added or removed and no exit status changes.
Tests
maven_dep_that_is_refused_or_skipped_touches_no_file: a grant with a malformed hash and a stale checksum line, through each way out of the rewriter: the reactor planner's refusal, a version the build does not select (a single pom, and a reactor), a pom that names another version, and a selection that cannot be read. In each, no file and no edit. It fails with the drops queued before the decision (checked:refused: [".mvn/checksums/checksums.sha256"]).maven_mirror_gate_touches_no_file_of_a_gated_depasserts the wording with no earlier wiring;maven_mirror_gate_does_not_hold_back_the_heal_of_an_earlier_configasserts it with the earlier wiring in place (left in place, the build fails on it, the rollback command), and that the gate and the heal compose: the mirror's warning for the dep, the heal for the config, nothing else written, the dep decided and not confirmed.maven_checksums_block_is_healed_whatever_the_run_redirectsasserts the refusal's clause in the run where the old wording was false (a reactor root refused whole, its config healed).Golden fixtures
None changed: the fixtures pin warning codes, not their prose, and no case has a malformed grant hash beside a refused dep.
What I ran
On macOS, head
0e2956254(four commits onmainat40ac5a7c8):cargo fmt --all -- --check: clean (it fails onmain).cargo clippy --locked --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --tests --no-fail-fast: 8752 passed, 0 failed, 1 ignored (the discovery golden regenerated first, with no change).common_selftests,spawn_env_hygiene, and the tests ofe2e_bazel_buildthat need no Bazel): all pass.e2e_redirect_maven_buildwith real Maven, required and not skipped: 8 passed on each of 3.6.3, 3.9.4, 3.9.16 and 4.0.0-rc-7.Not run: Linux and Windows (CI), the rest of the CLI suites, the Maven production legs (no code they drive changed beyond the two texts and the drop order).
Review findings
/code-review highon4d6f4da92returned eight. Each was confirmed against the code first.maven_dep_that_is_refused_or_skipped_touches_no_fileredirect_maven_selection_undeterminedrow opened with an absolute its reactor case contradictsdocs/ecosystems.mdstill had the reactor as its subject, on a line of 103 columnswired_by_an_earlier_release, used by bothReview findings not fixed
None.
🤖 Generated with Claude Code