Repository navigation
feat(scan): scan Bazel targets with --bazel - #1788
Draft
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
Draft
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
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.
This branch has not been deployed
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.
Heads up, reviewer
[Edit me, human!]
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.This needs a Coana release with coana-tech/coana-package-manager#2890, so it stays a draft until that release is pinned.
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.--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 (changelog entry included).--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