Repository navigation
Fix vendored npm tarballs captured by Git LFS (#1541) - #1559
Merged
Mikola Lysenko (mikolalysenko) merged 4 commits intoOct 15, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A repo that LFS-tracks *.tgz committed every vendored npm-family tarball (and each bun.lockb member mirror) as an LFS pointer, so any checkout without LFS smudging failed its frozen install while the vendored scan reported success. The per-uuid .gitattributes only unset `text`. It now also unsets `filter`, `ident` and `working-tree-encoding`, so no parent rule can change the committed bytes. Files written by older releases still count as ours on revert and are rewritten by the next vendored run. Fixes #1541 Assisted-by: Claude Code:claude-opus-5-5
End-to-end check for #1541: with `*.tgz filter=lfs` in the project's .gitattributes, vendor, commit, clone with GIT_LFS_SKIP_SMUDGE=1 and run `bun install --frozen-lockfile`. The tarball must not be an LFS object and the clone must install the patched bytes. Skips when git-lfs is not installed. Assisted-by: Claude Code:claude-opus-5-5
Review follow-ups: a Bun workspace mirror's uuid dir only reads the .gitignore and .gitattributes it may remove, not every sibling file. Docs note how to fix a tarball an older release already committed as an LFS pointer (git add --renormalize after the next vendored run). Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 15, 2026 03:11
Collaborator
Author
|
BugBot review Generated by Claude Code |
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 e87daa4. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 15, 2026
Collaborator
Author
|
Ready for review — head
Slack announcement not sent this run (Slack send unavailable); next run will retry. Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
agent/fix-vendor-gitattributes-lfs
branch
October 15, 2026 05:58
This was referenced Oct 15, 2026
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
Fixes #1541
Summary
A repo whose
.gitattributeshands*.tgzto Git LFS committed every vendored npm-family tarball (and eachbun.lockbworkspace mirror) as an LFS pointer. Any checkout that doesn't smudge LFS (actions/checkoutdefaults, no git-lfs,GIT_LFS_SKIP_SMUDGE=1, air-gapped builds) then failed the frozen install, while the vendored scan reportedsuccess.Root cause
All npm-family vendored flavors (npm, pnpm, yarn classic/berry, bun text and
bun.lockb, vlt) write.socket/vendor/npm/<uuid>/.gitattributesfrom one constant,npm_dir::UUID_GITATTRIBUTES. It held* -text, which turns off EOL conversion but leaves a parentfilter=lfsrule in force.Fix
UUID_GITATTRIBUTESis now* -text -filter -ident -working-tree-encoding: every attribute that lets git store or check out bytes other than the artifact's is unset at the uuid level, which beats any.gitattributesabove it.* -textfile still counts as ours (is_uuid_gitattributes), so a Bun workspace mirror's metadata is still removed on revert. An in-sync vendored re-run already passes throughrestore_uuid_metadata(viastage_patch_pack→keep_pack_committable) for all six tarball flavors, so existing trees are upgraded on their next run.mirror_metadatanow checks the file name before reading a sibling.docs/ecosystems.mddescribe the new attributes, plus thegit add --renormalize .socket/vendor/npmstep for a tarball an older release already committed as a pointer.Tests (red → green)
*.tgz filter=lfs/*.js ident working-tree-encodingrule no longer applies under the uuid dirnpm_dir::tests::the_uuid_gitattributes_overrides_repository_lfs_rules(core, needs only git)filter: lfs)GIT_LFS_SKIP_SMUDGE=1clone →bun install --frozen-lockfileinstalls patched bytese2e_vendor_bun_build::bun_vendor_tarball_is_not_committed_to_git_lfsnpm_dir::tests::legacy_uuid_gitattributes_is_upgradedbun_binary::rebuild_tests::a_tgz_rule_still_commits_every_workspace_mirror(extended).socketnot pruned)Local runs:
cargo fmt --all -- --checkok;cargo clippy --workspace --all-features -- -D warningsok;SOCKET_PATCH_BUN_REQUIRED=1 cargo test -p socket-patch-cli --all-features --test e2e_vendor_bun_build40/40 ok.cargo test --workspace --all-features --no-fail-fast: 241 binaries ok, 10 failures, none in code this PR touches. Nine are permission-denial tests (unwritable/unremovable files), which can't fail as intended because the sandbox runs as root. The tenth ise2e_bun_lockb::binary_shared_bundled_record_hosted_pin_is_managed, a hosted rollback that needspatches-api.socket.dev, which the sandbox proxy blocks. CI is the arbiter for these.Review notes (/code-review high)
mirror_metadataread every sibling before checking its name; the doc comment overstated what can outrank the uuid file.check-attrtest covers the mechanism on every runner..gitattributesemits no event. It's a one-time metadata rewrite of a file that isn't part of the artifact, the same as today's restore of an edited file.Follow-ups (not in this PR)
vendor/jvm/mod.rsTREE_GITATTRIBUTES,redownload.rs) and the Gradle redirect still write* -text, so*.jar filter=lfsrepos are likely affected the same way (p3, separate ownership checks).git cat-filepointer probe with a warning could replace the documented--renormalizestep..git/info/attributes, and a.gitattributesshipped inside a vlt directory payload, can still override the uuid file.🤖 Generated with Claude Code
https://claude.ai/code/session_01WdaShef4vyGWjbTSpLbh9E
Generated by Claude Code