GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Test cargo takeover over unrewritable deps (#1020) by mikolalysenko · Pull Request #1314 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 9, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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 hosted over 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-run previewed redirected: 1.

#1039 (823810a, "Make the vendored-to-hosted takeover atomic") staged the takeover in the run's GroupCommit overlay: 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, then cargo build --locked --offline links the patched copy (a compile oracle that calls cfg_if::socket_patched())
  • hosted --dry-run gives redirected: 0, redirect_takeover_kept_vendored and redirect_cargo_toml_dep_unrewritable, with no redirect_would_revert_vendored and no writes
  • the wet run gives the same exit and status as the dry run, redirected: 0 and no redirect_takeover_unpatched. Every project byte is unchanged.
  • a fresh checkout still builds the patched crate with --locked

Commands run

  • cargo test -p socket-patch-cli --test mode_migration_cargo takeover_over_unrewritable: passes on current main (cargo 1.93.1)
  • rustfmt on 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 scan when Cargo.toml uses dependency spellings the hosted rewriter cannot rewrite (dotted keys, single-quoted version, explicit registry = "crates-io"). It asserts redirected: 0, redirect_takeover_kept_vendored and redirect_cargo_toml_dep_unrewritable, and that --dry-run matches the wet run (no redirect_would_revert_vendored, no filesystem writes). After a refused takeover the project stays byte-identical and a fresh cargo build --locked still 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Mikola Lysenko (mikolalysenko) and others added 2 commits October 9, 2026 12:42
@mikolalysenko @claude
WIP: Fix cargo vendored to hosted takeover ordering (#1020)
87b4a75
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mikolalysenko @claude
Test cargo takeover over unrewritable deps
e18a8af
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) <[email protected]>
@mikolalysenko Mikola Lysenko (mikolalysenko) changed the title Fix cargo vendored to hosted takeover ordering (#1020) Test cargo takeover over unrewritable deps (#1020) Oct 9, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 9, 2026 16:46
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

BugBot review

cursor[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge October 9, 2026 16:46
@mikolalysenko Mikola Lysenko (mikolalysenko) mentioned this pull request Oct 9, 2026
Cargo vendored → hosted takeover un-vendors a crate before hosted mode refuses its Cargo.toml spelling (dotted keys, single quotes, registry = "crates-io"), leaving it unpatched, while --dry-run previews redirected: 1 #1020
Closed
cursor[bot]
cursor Bot reviewed Oct 9, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 9, 2026
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

Ready for review (burn-down agent).

  • Head: e18a8af2
  • CI: every check green except main-wide failures that also fail on main at a8e9397: e2e (ubuntu-latest, e2e_safety_pnpm), hosted-e2e (withdrawn free [email protected] patch, Merge queue blocked: production no longer publishes free [email protected] patch #1293; fixes in Repin live [email protected] suites to republished patch 642d7f02 (#1293) #1301/Follow the republished minimist canary patch #1302), and the ci-ok roll-up.
  • Bugbot: reviewed this head, no findings; no open review threads.
  • No CHANGELOG.md changes.
  • Test-only change. Auto-merge was already armed; nothing was pushed.

Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Tanmay182003
Tanmay Singla (Tanmay182003) approved these changes Oct 9, 2026
View reviewed changes
@mikolalysenko
Mikola Lysenko (mikolalysenko) disabled auto-merge October 9, 2026 17:53
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator Author

[final reviewer] I disarmed auto-merge at e18a8af2 because ci-ok is red on this head. Only hosted-e2e and e2e (ubuntu-latest, e2e_safety_pnpm) fail, which is the main-wide [email protected] failure (#1293), not this PR. #1302 fixes it and is in the merge queue now. Once main carries it, merge main in here (no other commits needed) and I'll re-arm auto-merge after CI goes green. The approval still covers this head.


Generated by Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Merge branch 'main' into agent/v5-cargo-takeover-order
8d30905
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge October 9, 2026 18:22
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
@mikolalysenko
Mikola Lysenko (mikolalysenko) removed this pull request from the merge queue due to a manual request Oct 9, 2026

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Merge branch 'main' into agent/v5-cargo-takeover-order
9646626
@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit 31458e6 Oct 9, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the agent/v5-cargo-takeover-order branch October 9, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Tanmay182003 Tanmay Singla (Tanmay182003) Tanmay182003 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Cargo vendored → hosted takeover un-vendors a crate before hosted mode refuses its Cargo.toml spelling (dotted keys, single quotes, registry = "crates-io"), leaving it unpatched, while --dry-run previews redirected: 1

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Tanmay182003
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.