Repository navigation
Fix vendored Maven reactor tests on Maven 4 (#2158) - #2225
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
Refs #2158. Assisted-by: Claude Code:claude-fable-5-2
Three nightly tests failed on the Maven 4.0.0-rc-7 legs. Each asserted something that stopped holding when pins became selection-based, and none of them shows a defect in the CLI. The implicit-subprojects test expected a pin in the root pom of a model 4.1.0 project. A Maven 4 selection is not modelled, so no pin is written there: the root takes the fallback repository only, the run reports selection_undetermined, and the module that declares the base version is rewritten where it stands. Both modules still build the patched jar, warm and from a fresh offline checkout. vex withholds its statement for the same reason, as the contract says, so the test now asserts that outcome instead of not_affected. Two mediation tests asserted that .mvn is gone after a revert. Maven 4 keeps its project-local repository in .mvn/target, which is the build's and which the revert leaves. They now assert that nothing else is left under .mvn, and still that .mvn is gone on Maven 3. Fixes #2158. Assisted-by: Claude Code:claude-fable-5-2
The implicit-subprojects test read warnings[0], which would fail on any unrelated advisory that sorts ahead of the JVM one. Refs #2158. Assisted-by: Claude Code:claude-fable-5-2
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview In In Reviewed by Cursor Bugbot for commit e086671. Configure here. |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit e086671. Configure here.
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2158
Summary
Three nightly tests fail on the two Maven 4.0.0-rc-7 legs. Each asserts
something that stopped holding when vendored pins became selection-based
(#2100). None of them shows a defect in the CLI, so this PR changes two test
files and no product code.
e2e_vendor_jvm_build:maven_reactor_implicit_subprojects_warm_and_offline_build_and_revertvexattestsnot_affectedvexwithholds its statementselection_undetermined, both modules still build the patched jar,vexexits 1 and names the causee2e_vendor_maven_build:mediation::maven_vendored_reactor_pins_each_module_at_the_version_it_selectsandmediation::maven_vendored_parent_pin_goes_when_a_module_moves_on_and_reverts_clean.mvnis gone aftervendor --revert.mvn/target/, which the revert rightly leavestargetis left under.mvn; on Maven 3,.mvnis gone as beforeRoot cause
CLI_CONTRACT.mdsays a selection is not certain on aMaven 4 build (a wrapper that pins Maven 4, or a model 4.1.0 pom) and that
no pin is written where it is not certain. The fixture's root is a model
4.1.0 pom, so the planner writes the fallback repository there and reports
vendor_jvm_degraded/selection_undetermined. Moduleadeclaresthe base version itself and is rewritten where it stands, and
bfollowsa. The test still proves the point of the fixture: the warm build andthe fresh offline checkout both put the patched jar on the classpath of
aandb.vexwithholds. The contract also saysvexattests a vendoredMaven patch only when every module that resolves the base version, or
whose selection cannot be told, is wired. The root and
bcarry neither apin nor a declaration, so the statement is withheld
(
vendor_jvm_shape_unsupported, exit 1). That is a missed attestation,never a false one.
.mvn/target. The other reactor tests ofe2e_vendor_jvm_buildalready clear this directory before they assert; the two mediation tests
added with the selection work did not.
Evidence
Reproduced on
origin/mainwith Maven 4.0.0-rc-7 (installed byscripts/install-maven.sh): the same three tests fail with the samemessages as the nightly run.
With this PR:
cargo test -p socket-patch-cli --test e2e_vendor_jvm_build -- --ignored maven_reactorcargo test -p socket-patch-cli --test e2e_vendor_maven_build -- --ignoredPush CI does not run these legs (they are nightly), so the checks on this PR
do not exercise the change. The next scheduled run does.
rustfmt --checkis clean on both files.cargo clippy --all-targetsfails on
origin/mainin the shared test helpers; the two files report thesame single finding before and after this change. CI's clippy job does not
lint test targets.
Review
/code-review highfound no bug and two nits:warnings[0]; it is now found by its code.not_affectedassertion gone, no real-Maven-4 testshows
vexattesting on a model 4.1.0 reactor. The only shape thatattests there today is one where every module, the aggregator root
included, declares the patched artifact itself, which is not the shape
this fixture is about. See the question below.
For a maintainer to decide
Since the selection work, a vendored model 4.1.0 reactor gets a pin only
where a module declares the base version itself, and
vexcannot attest itunless every module does. A module that reaches the artifact only through
another library stays unpatched (reported as
selection_undetermined).That follows the contract as written and errs on the safe side. If Maven 4
reactors should be pinned and attested again, the selection reader has to
model Maven 4's dependency management; that is a product change and is not
part of this PR.
https://claude.ai/code/session_011f9aeNu6BLYqF4rU1ZmoTb
Generated by Claude Code