A vendored NuGet scan under a rules_csharp hub appends a block to MODULE.bazel and its next step does not name the file
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Đọc crates/socket-patch-cli/src/commands/vendor.rs quanh commit_hint ở dòng 4958 và so sánh cách xử lý Maven hub của Bazel với trường hợp vendored của rules_csharp. Kiểm tra các bài kiểm thử hiện có cho thông báo về NuGet vendored và Bazel hub. Công việc hoàn tất khi hướng dẫn commit liệt kê mọi tệp đã thay đổi, bao gồm MODULE.bazel và nuget.config, trong lần chạy rules_csharp.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[agent] Found by the scheduled Bazel bug-hunt routine (ledger #2262).
Summary
In the root of a Bazel workspace whose rules_csharp nuget.from_lock reads the project's lock, scan --mode vendored --yes writes four things: the package under .socket/vendor/nuget/<uuid>/, the re-pinned packages.lock.json, a folder source in nuget.config, and a managed block at the end of MODULE.bazel. The run names none of the last two. Its next step reads:
Next steps:
1. Commit .socket/vendor/ and the updated lockfiles to make the patches portable.
Nothing on stdout or stderr, and nothing in the --json envelope, says that MODULE.bazel was changed. The same code names the files for a Maven hub (MODULE.bazel, .bazelignore), and hosted mode in the same workspace names both of its files ("Commit nuget.config and packages.lock.json").
Impact
A person who commits what the message lists (.socket/vendor/ and packages.lock.json) and leaves MODULE.bazel or nuget.config out pushes a checkout whose Bazel build fails for everyone else. docs/ecosystems.md ("Vendored mode under a rules_csharp hub") says why: without the block the hub reads the folder source of nuget.config as a URL (Bad URL: .socket/vendor/nuget/... on Bazel 8.8.2 and 7.7.2, a crash of the module extension on 9.3.2), and without the nuget.config change it downloads the upstream package and refuses it over the re-pinned contentHash. The docs ask for exactly this commit: "Commit .socket/vendor, nuget.config, the lock and MODULE.bazel together." The command does not.
Not built here: this sandbox cannot reach the Bazel registry, so the build failure is quoted from the docs and was not reproduced. What reproduces is the message and the files written.
Repro
Files only, no Bazel needed. A checkout of crates/socket-patch-cli/tests/fixtures/bazel/rules_csharp/bzlmod (common and e9 in one directory, @RUN@ replaced), with .bazelversion holding 9.3.2, a MODULE.bazel.lock that selects rules_csharp 0.5.0, the two packages restored into NuGet's global packages folder, and the loopback stand-in of tests/e2e_bazel_build/nuget.rs (registry, grant, service_route) for the Socket API and the patch host. It is the setup of nuget::vendored_mode_keeps_the_block_or_declines.
git init -q . && git add -A && git commit -qm init
socket-patch scan --mode vendored --yes --patch-server-url "$STANDIN" \
--api-url "$STANDIN" --org test-org --api-token fake-token
git status --porcelain
Actual
Vendored 1 package.
HIGH [email protected] CVE-2024-0001, GHSA-test-aaaa-bbbb
Next steps:
1. Commit .socket/vendor/ and the updated lockfiles to make the patches portable.
2. Reinstall from the updated lockfile, then run `socket-patch vex` to verify the installed patches.
M MODULE.bazel
M nuget.config
M packages.lock.json
?? .socket/
stderr holds the Found 2 packages line and the warning about NuGet's global packages folder, and no word about MODULE.bazel. With --json the envelope has no entry for the file either.
Expected
The next step names every file the run wrote that has to be committed, as it does for a Maven hub and in hosted mode: MODULE.bazel, nuget.config, packages.lock.json and .socket/vendor/. docs/ecosystems.md, "Vendored mode under a rules_csharp hub": "Commit .socket/vendor, nuget.config, the lock and MODULE.bazel together."
Versions
| Result | |
|---|---|
main cfc870f, fixture workspace (rules_csharp 0.5.0, .bazelversion 9.3.2) |
reproduces, 3 runs; also with MODULE.bazel in CRLF and without a final newline |
| v5.1.0 | does not apply: it writes no block (MODULE.bazel is untouched) |
The same for .bazelignore
Two earlier runs of this routine saw the same message after a vendored scan under a gazelle go_deps hub (2026-11-27) and under a rules_rust crate hub (2026-11-29), where the run adds two lines to the root .bazelignore. There an Updated <path> line follows on stderr, so the file is at least named once; the next step still says only "the updated lockfiles". What a commit without .bazelignore costs there was not measured.
Suspect code
crates/socket-patch-cli/src/commands/vendor.rs:4958 (commit_hint): the Bazel files are added to the list only for HUB_FLAVOR and HUB_BESIDE, the two flavors of a Maven hub. A run that wrote the NuGet block or the .bazelignore pair falls through to ".socket/vendor/ and the updated lockfiles" at line 4964.
Generated by Claude Code
- Ngôn ngữ chính
- Rust
- Star
- 9
- Fork
- 2
- Merge trung bình
- 1 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 232
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SocketDev/socket-patch
-
agent:triaged bug bughunt pm:vlt priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
SocketDev/socket-patch#2374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
SocketDev/socket-patch#2364 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit bug priority:p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
SocketDev/socket-patch#2346 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged bug bughunt pm:bundler priority:p1 ux
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SocketDev/socket-patch#2326 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The unit test for "every jar copy must be patched" passes when VEX checks only the first copyĐang mởagent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
SocketDev/socket-patch#2319 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-patch
Issue tương tự
-
Heading anchor links have no icon: AnchorJS is initialised with an empty `icon`Có thể đã có người làm @cscheid đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
quarto-dev/q2#1419 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
pbakaus/impeccable#1718 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Uncaught index-out-of-bounds panic in `minijinja::value::ops::slice` on `{{ ''[::-1] }}` (v2.24.0)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Fix All + Enforce overwrites unsaved edits to .editorconfig / Directory.Build.props / sharplsp.tomlĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Nimblesite/SharpLsp#644 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày