Repository navigation
fix(manifest): anchor --exclude-paths at the scan root for every build root - #1679
Merged
Jeppe Fredsgaard Blaabjerg (jfblaa) merged 2 commits intoNov 2, 2026
Merged
Jeppe Fredsgaard Blaabjerg (jfblaa) merged 2 commits into
Jeppe Fredsgaard Blaabjerg (jfblaa) merged 2 commits into
Conversation
…d root Dynamic SBOM inference re-anchored --exclude-paths onto each build root and dropped every pattern outside it, so a module the build reaches outside its own directory (a Maven `<module>../x</module>`, a Gradle project relocated with projectDir) could not be excluded and was resolved and uploaded anyway. Build roots now get scan-root-relative patterns plus the absolute scan root (socket.excludeBase, the build root by default). The Maven extension, Gradle init scripts and sbt plugins relativize each module's canonical directory against it, so a module outside the scan root never matches. New compat smoke tests cover a module outside the build root (Maven, Gradle) and a nested one (sbt, which refuses projects outside its build root).
Martin Torp (mtorp)
approved these changes
Nov 1, 2026
Martin Torp (mtorp)
left a comment
Contributor
There was a problem hiding this comment.
Looks good. The fix does what it says, and the new Gradle smoke test fails against the old init script. I left a few small comments, mostly about the CHANGELOG and the tests. None of them block.
- Treat a module on another Windows drive than the scan root as outside it instead of letting Path.relativize throw, in every JVM exclusion helper. - Normalize `\` separators in the glob compiler, so single-root runs match Windows-style patterns too and callers pass --exclude-paths straight through. - Smoke-check that a module outside the scan root is never excluded, clear stale records between checks and keep build output visible. - Document the narrowed and re-anchored behaviour in the changelog and the --exclude-paths help. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Jeppe Fredsgaard Blaabjerg (jfblaa)
deleted the
jfblaa/exclude-paths-escaping-modules
branch
November 2, 2026 12:26
1 task
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
What
--exclude-pathscould not exclude a module that a build reaches outside its own directory when Socket facts are generated per build root (dynamic SBOM inference,--reachwith it,socket fix):<module>../shared</module>or a Gradle project relocated withprojectDir = file('../shared')was then resolved and uploaded even with--exclude-paths shared. Discovery had already dropped its standalone root, so the exclusion looked like it worked.Now:
socket.excludeBase, the build root by default).-f/-pin the build options moves the build root.sbt refuses projects outside its build root, so for sbt only the anchoring changes.
Testing
socket.excludeBaseproperty, the scan-root patterns given to every build root, and the setup wizard's coverage pass.run-compat.sh):../sharedmodule, excluded by its scan-root path.🤖 Generated with Claude Code
Note
Medium Risk
Touches exclusion logic across recursive manifest orchestration and all three JVM fact producers; wrong anchoring could skip or include the wrong modules, but behavior is heavily tested including cross-version smoke runs.
Overview
Fixes
--exclude-pathsso it applies consistently when Socket facts run per build root (dynamic SBOM inference, recursive manifest flows). Previously each root got patterns re-anchored to its own directory, so globs meant for the scan root could not skip modules the build pulls in outside that directory (Maven<module>../shared</module>, GradleprojectDir = file('../shared')).The CLI now passes every build root the same scan-root-relative patterns plus an
excludeBase(the scan root;projectDirwhen unset).run.mtsforwards this assocket.excludeBaseto Maven, Gradle, and sbt. Each ecosystem matches exclusions by relativizing a module’s canonical directory against that base (not only against the build root), and modules outside the scan root never match.Recursive manifest generation and workspace enumeration stop computing per-root exclude paths; setup coverage uses the same anchoring. Tests cover property wiring, recursive calls, and new Maven/Gradle/sbt compat smoke fixtures.
Reviewed by Cursor Bugbot for commit 04d20d1. Configure here.