Repository navigation
Test cargo takeover over unrewritable deps (#1020) - #1314
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 9, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A vendored cargo crate whose Cargo.toml spelling the hosted rewriter refuses (dotted keys, a single-quoted literal, registry = "crates-io") must stay vendored when scan --mode hosted runs over it, and the dry run must preview that refusal instead of a takeover. The atomic takeover from #1039 already does this; pin it with a real-cargo e2e so the crate can never again land in neither mode (#1020). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 9, 2026 16:46
Collaborator
Author
|
BugBot review |
Mikola Lysenko (mikolalysenko)
enabled auto-merge
October 9, 2026 16:46
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 e18a8af. Configure here.
Collaborator
Author
|
Ready for review (burn-down agent).
Generated by Claude Code |
Tanmay Singla (Tanmay182003)
approved these changes
Oct 9, 2026
Mikola Lysenko (mikolalysenko)
disabled auto-merge
October 9, 2026 17:53
Collaborator
Author
|
[final reviewer] I disarmed auto-merge at Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
enabled auto-merge
October 9, 2026 18:22
Mikola Lysenko (mikolalysenko)
removed this pull request from the merge queue due to a manual request
Oct 9, 2026
Mikola Lysenko (mikolalysenko)
deleted the
agent/v5-cargo-takeover-order
branch
October 9, 2026 21:49
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.
LLM Description written by Claude Code:claude-opus-5-5
Refs #1020 (closed as already fixed on main by #1039; this PR adds the regression test).
Summary
#1020 reported that
scan --mode hostedover a vendored cargo crate reverted the vendored wiring before the hosted Cargo.toml rewriter refused the dependency spelling (dotted keys,cfg-if = '1.0',registry = "crates-io"), leaving the crate in neither mode, while--dry-runpreviewedredirected: 1.#1039 (823810a, "Make the vendored-to-hosted takeover atomic") staged the takeover in the run's
GroupCommitoverlay: a staged purl the hosted rewrite does not pin is retracted (Takeover::retract), so the purl stays vendored byte for byte and the dry run runs the same steps. That fixes #1020 on main. Nothing pinned that cargo behavior, so this PR adds a real-cargo e2e.Test
crates/socket-patch-cli/tests/mode_migration_cargo.rs::takeover_over_unrewritable_spelling_keeps_vendored. It runs once for each of the three spellings:vendor --offline, thencargo build --locked --offlinelinks the patched copy (a compile oracle that callscfg_if::socket_patched())--dry-rungivesredirected: 0,redirect_takeover_kept_vendoredandredirect_cargo_toml_dep_unrewritable, with noredirect_would_revert_vendoredand no writesredirected: 0and noredirect_takeover_unpatched. Every project byte is unchanged.--lockedCommands run
cargo test -p socket-patch-cli --test mode_migration_cargo takeover_over_unrewritable: passes on current main (cargo 1.93.1)rustfmton the changed file🤖 Generated with Claude Code
Note
Low Risk
Test-only change; no runtime or CLI behavior is modified.
Overview
Adds a regression e2e test for issue #1020 in
mode_migration_cargo.rs:takeover_over_unrewritable_spelling_keeps_vendored.The test runs vendored → hosted
scanwhenCargo.tomluses dependency spellings the hosted rewriter cannot rewrite (dotted keys, single-quoted version, explicitregistry = "crates-io"). It assertsredirected: 0,redirect_takeover_kept_vendoredandredirect_cargo_toml_dep_unrewritable, and that--dry-runmatches the wet run (noredirect_would_revert_vendored, no filesystem writes). After a refused takeover the project stays byte-identical and a freshcargo build --lockedstill links the vendored patched crate.No production code changes—only pins behavior already fixed on main (#1039).
Reviewed by Cursor Bugbot for commit e18a8af. Configure here.
Generated by Claude Code