GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — Fix vendored requirements.txt re-vendor to a superseding patch (#765) by mikolalysenko · Pull Request #766 · SocketDev/socket-patch Conversation
|
| Issue | Test | Before fix | After |
|---|---|---|---|
| #765 (CLI end to end) | crates/socket-patch-cli/tests/mode_migration_pypi.rs::requirements_vendored_revendors_superseding_patch: vendor A, switch the manifest to B (different patched bytes), vendor, then re-run (in sync), then vendor --revert. Covers an unhashed tree and a hashed tree with a marker and a \ continuation |
FAIL: exit 1 partialFailure / pypi_requirements_already_vendored |
pass: exit 0, line on B, A's dir removed (vendor_stale_artifact_removed), ledger on B, revert restores the original bytes |
| #765 (core, every shape) | vendor::pypi::tests::requirements_superseding_uuid_revendors_in_place: unhashed; hashed + marker + continuation + CRLF; a pin in a -r include; an appended transitive line. Checks that originals carry over and that revert of the new entry is byte-exact |
FAIL: Refused { pypi_requirements_already_vendored } |
pass |
| guard | vendor::pypi::tests::requirements_superseding_uuid_without_ledger_refuses (replaces requirements_stale_uuid_vendor_line_refuses) |
– | pass: still refused, nothing written |
| guard | vendor::pypi::tests::requirements_superseding_uuid_drifted_line_refuses |
– | pass: refused, nothing written |
Local runs:
cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test --workspace --all-features --no-fail-fast: 9727 passed, 12 failed, 253 ignored. All 12 failures are chmod-denial tests that cannot fail under root, which is what this sandbox runs as: *_write_failure_*, *unremovable*, relax_loop_must_not_traverse_symlinked_root, wire_failure_rolls_back_already_written_files and others. Re-run as the unprivileged nobody user, every one of them passes. That includes the requirements write-unwind test that write_plan now serves.mode_migration_pypi: 13/13.🤖 Generated with Claude Code
Note
Medium Risk
Touches PyPI requirements vendoring and on-disk requirements edits with ledger-driven revert semantics; mistakes could break pins or revert, but scope is limited to requirements.txt and guarded by preflight checks plus broad new tests.
Overview
Fixes #765 for requirements.txt vendoring: when the manifest moves a package from patch A to patch B, vendor (and vendored-mode flows that call the same backend) now re-wires existing socket vendor lines in place instead of failing with pypi_requirements_already_vendored.
Preflight in pypi_requirements gains RequirementsTarget::Rewire: if the tree still points at an older patch uuid but the vendor ledger has exactly one matching pypi entry, it plans an in-place swap via new rewire_requirements / plan_rewire, preserving markers, hash mode, -r includes, and pre-vendor original bytes so vendor --revert on the new entry still restores the user’s pins. Shared file writes go through write_plan.
Re-vendor is still refused (unchanged error family) when the ledger is missing, lines drifted from what was recorded, or live vendor lines don’t match the ledger.
The PyPI orchestrator adds WiringPlan::RequirementsRewire; stale patch A artifacts continue to be reclaimed (vendor_stale_artifact_removed). CHANGELOG documents the behavior. uv / Poetry / PDM / Pipenv superseding-patch re-vendor is explicitly out of scope here.
Tests: CLI requirements_vendored_revendors_superseding_patch and core cases for multiple requirement shapes, drift, and missing ledger.
Reviewed by Cursor Bugbot for commit 2fad4d0. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A requirements.txt project vendored with one patch could not move to a newer patch for the same package: vendor, get --mode vendored and scan --mode vendored failed with pypi_requirements_already_vendored and pip kept installing the old patch, while --dry-run previewed a re-vendor. The requirements pre-flight now re-wires the vendor lines the older patch's ledger entry recorded, in place, to the new wheel. Each line keeps its marker, hash mode and transitive note, and each record keeps the pre-vendor original, so vendor --revert still restores the user's pin. Without that ledger entry, or when a recorded line has drifted, the re-vendor is still refused before anything is written. (#765) Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
The previous commit ran rustfmt across the whole workspace and reformatted 129 files that the requirements.txt re-vendor fix does not touch. That churn hides the real change from reviewers and conflicts with nearly every other open PR. Restore those files to main so the PR only carries the fix: CHANGELOG, vendor/pypi.rs, vendor/pypi_requirements.rs and the mode_migration_pypi test. Co-Authored-By: Claude <[email protected]>
|
bugbot run Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem 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 2fad4d0. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Release notes are written when a release is cut, from the merged PR log and the code, so PRs no longer edit CHANGELOG.md. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Resolve the stage_manifest_with doc comment conflict in mode_migration_pypi.rs: #766 added the same helper on main, so keep main's wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VSXCFoPbraq7rNKJpXEP2n
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Vendored requirements.txt never picks up a superseding patch: the re-vendor to a new uuid fails with pypi_requirements_already_vendored (exit 1), though--dry-run previews would_revendor and the contract says it re-vendors automatically
There was an error while loading. Please reload this page.