Repository navigation
feat(scan): scan Bazel targets with --bazel - #1788
Conversation
Scans only the Bazel targets the patterns after `--` name, from the workspace root, in place of manifest discovery. Coana resolves the patterns as `bazel build` takes them and generates the Socket facts; reachability analyses the JVM, Python and JavaScript targets. Facts generation passes Coana the run's `--purpose`, as every other build does, and a reachability run compiles the targets.
PR SummaryMedium Risk Overview Bazel facts path: New Bazel binary resolution: Reviewed by Cursor Bugbot for commit 8cf7dae. Configure here. |
Refuse a --bazel workspace root outside the working directory, as --reach does for its target, and point at --cwd. The repeat-command hint now names the org with --org and includes --bazel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--bazel is hidden, so the release notes leave it out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # src/commands/scan/handle-create-new-scan.mts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4cc885d
into
v1.x
Heads up, reviewer
Add internal command for experimenting with bazel support.
Claude Code · claude-opus-5-5
socket scan create <root> --bazel -- <patterns>scans only the Bazel targets the patterns match, from the workspace root, instead of discovering manifests. Coana resolves the patterns asbazel builddoes and generates one Socket facts file for those targets. With--reach, it analyses the JVM, Python and JavaScript targets.--bazelis hidden.Behaviour
--, as on Bazel's own command line, so a negative pattern such as-//app/legacy/...is no flag. A pattern before--, or any short flag the command does not declare, is refused with a message saying to move it.--: the workspace root, the directory holdingMODULE.bazel,REPO.bazel,WORKSPACEorWORKSPACE.bazel, inside the working directory (--cwdselects one outside it).--bazelis refused with--auto-manifest,--dynamic-sbom-inference,--uv-membersand--exclude-paths.SOCKET_CLI_BAZEL_PATH, else bazelisk or bazel on PATH.socket manifest bazelnow also takesSOCKET_CLI_BAZEL_PATHahead of--bazel, in every build, as Gradle, Maven and sbt take theirs.--purpose, as every other build does, and a reachability run compiles the targets.Not in this PR
socket.json(binary, flags, bazelrc). A Bazel scan takes none yet.socket manifest bazeland auto-detection, which do not knowREPO.bazel.socket fixfor Bazel builds (REA-1372).Tests
cmd-scan-create.test.mts: the accepted forms, and each refusal, including a pattern before--; a declared short flag with an attached value is accepted.handle-create-new-scan.test.mts: a Bazel scan uploads the facts file alone and narrows reachability to its targets' ecosystems.bin-detect.test.mts:SOCKET_CLI_BAZEL_PATHahead of--bazel; a scan's error names onlySOCKET_CLI_BAZEL_PATH._.templatewas reachable frommain.js, and the packages it never calls were unreachable.Closes REA-1247
Closes REA-1249
Closes REA-1250
Closes REA-1251
Closes REA-1303
🤖 Generated with Claude Code