Agent mode in a Bazel workspace whose hub reads the lock says nothing about being unsupported for a Bazel build
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
Hướng nghiên cứu
Start with crates/socket-patch-cli/src/commands/mod.rs and sync_bazelignore, then trace the agent-mode scan, apply, and get paths and how warnings[] reaches human and JSON output. Compare the existing Maven Bazel warning and the hosted or vendored Bazel checks; the issue expects one warning when a hub reads a patched package’s lock in a Bazel workspace, and silence when no hub reads the lock. Verify both output formats and the SOCKET_NO_BAZEL=1 case.
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 a Bazel workspace whose hub reads the project's lock, agent mode runs, exits 0 and prints its usual next steps, with no word that agent mode is not supported for a Bazel build. docs/ecosystems.md ("Bazel workspaces: what is supported") says "Agent mode is not supported for Bazel builds, in any ecosystem" and "Use hosted mode for a package that Bazel builds, or vendored mode where the table lists it", but a person who runs the command never sees that: neither the human output nor warnings[] under --json mentions Bazel's build, hosted mode or vendored mode. Only Maven has a warning of this kind (maven_bazel_hub_unpatched).
This is a friction report (ux), not a broken build. It was seen on files only: this routine's sandbox cannot reach bcr.bazel.build, so no bazel build ran here.
Impact
A person in a Bazel workspace who runs socket-patch scan in agent mode is told Applied 1 patch, Commit .socket/ and go.mod, Nothing left to patch, and vex then says not_affected. Nothing sends them to the two modes the docs support for a Bazel build. For Go the copy does reach a gazelle build today (the go::agent_go_deps leg is green), but the docs promise that for no release, and in the other ecosystems the docs say the patch may not reach the build at all. The run also writes .bazelignore at the Bazel root, so it knows it is in a Bazel workspace.
Repro
The workspace is the repository's own gazelle fixture (crates/socket-patch-cli/tests/fixtures/bazel/gazelle/bzlmod: e9/MODULE.bazel with go_deps.from_file(go_mod = "//:go.mod"), and common/), in a git checkout, with the upstream module in GOMODCACHE and a loopback stand-in for the Socket API, as tests/e2e_bazel_build/go.rs sets one up (Patching::new).
mkdir -p ws/.git && echo 'ref: refs/heads/main' > ws/.git/HEAD
F=crates/socket-patch-cli/tests/fixtures/bazel/gazelle/bzlmod
cp $F/e9/MODULE.bazel $F/common/* ws/ && cd ws
GOMODCACHE=<cache holding example.com/[email protected]> \
socket-patch scan --mode agent --yes --api-url <stand-in> --org test-org --api-token fake-token
Actual output (exit 0), twice in fresh checkouts:
Found 1 package (1 go)
Updated <ws>/.bazelignore: the lines that keep patched Go module copies under .socket out of Bazel's packages
Applied 1 patch.
HIGH example.com/[email protected] CVE-2024-0001, GHSA-test-aaaa-bbbb
Next steps:
1. Commit .socket/ and go.mod (or go.work) to keep the patches.
Patched 1 package, fixing 2 vulnerabilities (2 high).
Saved about 2 hours of engineering time (1 package upgrade at ~2 hours).
Nothing left to patch.
With --json: "status": "success" and no warnings key. socket-patch apply afterwards says (already patched) and nothing else. socket-patch vex says not_affected ("Patched via Socket patch ").
Expected
A warning, once per run, in agent mode (scan in agent mode, apply, get) when the project is in a Bazel workspace and a hub call reads the lock of a patched package: that agent mode is not supported for a Bazel build, and to use scan --mode hosted (or --mode vendored where the table lists it). Human output and warnings[]. A project that Bazel does not build (no hub reads its lock) should stay silent, as SOCKET_NO_BAZEL=1 does.
docs/ecosystems.md, "Bazel workspaces: what is supported": "Agent mode is not supported for Bazel builds, in any ecosystem. ... Use hosted mode for a package that Bazel builds, or vendored mode where the table lists it."
Versions
| Version | Result |
|---|---|
main cfc870f |
silent (Go, gazelle fixture, files only) |
| v5.1.0 | has no Bazel support; not a regression |
Other ecosystems were not run. No code under crates/*/src has a message about agent mode in a Bazel workspace, apart from maven_bazel_hub_unpatched.
Suspect code
crates/socket-patch-cli/src/commands/mod.rs:78 (sync_bazelignore) is where an agent run already finds the Bazel root; the hub readers that vendored and hosted mode use to decline are not asked in agent mode.
Linux only. Nothing here depends on the platform.
Generated by Claude Code
- Ngôn ngữ chính
- Rust
- Star
- 9
- Fork
- 2
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 313
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 arch-audit bug priority:p2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
SocketDev/socket-patch#2306 ·
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 88/100
SocketDev/socket-patch#2296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:needs-human agent:triaged ci-janitor priority:p1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
SocketDev/socket-patch#2270 · 3 bình luận ·
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 82/100
SocketDev/socket-patch#2259 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SocketDev/socket-patch#1860 ·
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ự
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Có thể đã có người làm @iliqiliev đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ajeetdsouza/zoxide#1381 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
kornia/kornia-rs#1416 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
paritytech/revive#749 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
swc-project/swc-next-issues#1043 ·