Repository navigation
Fix vendored runs that restore files and say nothing to do (#2471) - #2473
Mikola Lysenko (mikolalysenko) wants to merge 3 commits into
Conversation
A vendored run that restores files under .socket/vendor/ reports nothing to do and names no commit step. Refs #2471. Assisted-by: Claude Code:claude-fable-5-2
A gem that 5.1.0 vendored has no .gitignore or .gitattributes in its uuid dir. The next vendor run or repair writes them, and a clone that lost an ignored file gets the copy downloaded again. Both leave files to commit, and the run must name them and the commit step instead of ending on "nothing to do". The new capstone fails on main at the first vendor re-run. The diff-lcs project setup moves into a helper the existing clone test shares. Refs #2471. Assisted-by: Claude Code:claude-fable-5-2 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeQh6AJCpEkXY9AdWf5
A vendored run over a gem that is already wired can still write under .socket/vendor/: the in-sync path puts back the uuid dir's .gitignore and .gitattributes, and the pre-pass downloads a copy again when files of it are missing. Neither reached the human output. The package was counted as already vendored, the run ended on "nothing to do" and printed no commit step, so the fix for a clone that fails `vendor --check` was never committed. `repair` wrote the same files without naming them or the commit. The gem in-sync path now returns a vendor_git_metadata_written advisory when it wrote either file, and repair records the same one for gem and npm-family entries. The vendor summary counts packages whose files were restored and says so in place of "nothing to do", the redownload prints the line repair prints, and both commands end with a next step that names the commit of .socket/vendor/. Fixes #2471. Assisted-by: Claude Code:claude-fable-5-2 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011f9aeQh6AJCpEkXY9AdWf5
|
bugbot run Generated by Claude Code |
PR SummaryLow Risk Overview Behavior: Introduces Docs/tests: Reviewed by Cursor Bugbot for commit 7d574a1. Configure here. |
LLM Description written by Claude Code:claude-fable-5-2
Fixes #2471
Summary
A project whose gems were vendored by 5.1.0 needs one more commit after
the upgrade: the next
vendor/scan --mode vendoredrun, orrepair,writes
.gitignoreand.gitattributesinto each.socket/vendor/gem/<uuid>/, and in a fresh clone it downloads a copyagain to restore files git left out. Neither command said so.
vendorended on "already vendored; nothing to do." and
repairon "Repaircomplete.", with untracked files in
git statusand no commit step, sothe commit that makes a clone pass
vendor --checkwas a step to guess.Now the run that restores files names them and the commit:
A run that restores nothing prints what it printed before, and a dry run
writes nothing and names no commit. No file that was written before is
written differently: only the output changes.
Root cause
Two writes under
.socket/vendor/happen behind a package the runreports as
already_vendored, and neither reached the human output:and dropped the "I wrote it" result;
matches and recorded only a JSON
rebuiltevent.The summary line and "Next steps:" are built from applied / skipped
counts alone, so both runs read as no-ops.
repairrewrote the samemetadata with no event at all, and printed no commit step after a
redownload either.
The change
vendor/gem.rs,vendor/mod.rs): the gem in-sync pathreturns a
vendor_git_metadata_writtenadvisory when it wrote eitherfile, for a gem's own tree and for platform gems.
vendor/scan --mode vendored(commands/vendor.rs): theadvisory prints as a
Note:; the pre-pass redownload prints theRedownloaded <purl> (<path>)linerepairprints; the tally countsthe packages whose files were restored, the summary says so in place
of "nothing to do" (or as a clause of its own on a mixed run), and a
run that vendored nothing new but restored files ends with a one-step
"Next steps:" naming the commit. A run that vendored something already
names
.socket/vendor/in its commit step.repair(commands/repair.rs,vendored_backend/repair.rs):records the same advisory when it rewrites the metadata of a healthy
gem or npm-family artifact (after git is known to commit it), and ends
with the same commit step after that or after a redownload. Other
rebuiltevents (a stray file swept from a JVM tree, a Bun workspacecopy) do not trigger it.
CLI_CONTRACT.md(the new code, the redownload paragraph)and
docs/ecosystems.md("Ruby gems: vendored gems and.gitignore").The npm, PyPI and gem wrappers pass output through and need no change.
Evidence
e2e_vendor_gem_build::gem_vendor_and_repair_name_the_files_they_restore_and_the_commit(real Bundler, real git)vendorandrepair, metadata-only and redownload,--json, the in-sync and dry runs that must stay quiet, and a clone of the named commit passingvendor --check. Fails onmainat the firstvendorre-run ("the vendor re-run names …/.gitignore"); passes here.vendor::gemunit tests (the_uuid_dir_metadata_is_put_back_by_a_rerun_and_by_restore,a_shipped_gitignore_an_earlier_release_kept_is_reported_once,a_lost_platform_tree_is_rebuilt_by_a_rerun_and_by_restore)commands::vendor::ui_format_tests(vendor_summary_names_restored_files_instead_of_nothing_to_do,tally_counts_each_package_with_restored_files_once,git_metadata_written_prints_as_a_note)commands::repair::tests::restored_vendor_files_reads_rebuilds_and_written_metadatarepair's commit stepCommands run locally (Ruby 3.3.6, Bundler 4.0.18):
cargo test -p socket-patch-cli --test e2e_vendor_gem_build -- --include-ignored: 24 passed.cargo test -p socket-patch-core: all targets pass (9,010 lib tests).cargo test -p socket-patch-cli --liband thevendor*,in_process_vendor*,scan*,repair,in_process_gem_multi_platform,in_process_remove_repair_lifecycleandin_process_rollback_vendoredtargets: pass, except tworepairtests (repair_cleanup_failure_is_reported_in_json_and_silent_modes,repair_exits_zero_and_stays_quiet_when_lock_file_unremovable) that make a directory read-only and cannot fail a write in a sandbox that runs as root. CI runs them unprivileged.cargo clippy --locked --workspace --all-features -- -D warnings(the CI form): clean. With--all-targets, this toolchain reports lints in test code across the workspace; none is on a line this PR adds.rustfmton the touched files.Review
/code-review highran on the diff. Fixed from it: two stale core testexpectations, the
repaircommit step firing onrebuiltevents thatrestore nothing, the summary attaching restored files to the "already
vendored" clause when the package had then failed, the advisory being
recorded before the git-commit check in
repair, and a detail thatclaimed both files were written when one was.
Not fixed here, on purpose: the same silent metadata restore exists on
the in-sync
vendorpaths of the npm family and PyPI. Those have hadtheir metadata for many releases, so no upgrade path hits them now; the
advisory code and the CLI handling are generic, so each is a small
follow-up at its backend.
https://claude.ai/code/session_011f9aeQh6AJCpEkXY9AdWf5
Generated by Claude Code