Repository navigation
feat(manifest): build every POM a scan uploads with --dynamic-sbom-inference - #1660
Conversation
…ference Maven build roots are discovered with the API's supported-file pattern for POMs, case-insensitively as the upload matches it, instead of only pom.xml. Each POM is its own build root: a non-default POM runs with `--file`, and coverage by a parent build is judged per file. Discovery also applies socket.yml's projectIgnorePaths, as the upload does, so a POM a scan would not upload is not built either. --exclude-paths and .gitignore matching stay case-sensitive. The recursive setup wizard asks once per directory holding several POMs, and no longer disables a whole directory when --exclude-paths matches only one of its POMs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oskar Haarklou Veileborg (BarrensZeppelin)
left a comment
There was a problem hiding this comment.
Simplification pass, no correctness findings. Comments are suggestions; none block.
- Match build markers in the glob filter, POMs case-insensitively, instead of case-folding the pattern. - Pass the POM to build as ManifestScriptOptions.entryFile; invokeMaven adds --file, and progress and failure messages name the POM. - Resolve socket.yml once per caller and pass it to discovery. - One table for file-addressed tools; one shared depth-then-path sort. - Group setup-wizard candidates by directory: one prompt and one summary count per directory, each of its POMs enumerated unless already covered, including POMs at cwd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oskar Haarklou Veileborg (BarrensZeppelin)
left a comment
There was a problem hiding this comment.
Second simplification pass, on f7ae575. Most of the first round is addressed, thanks.
One correction first: in the last review I said moving discovery to **/* with a filter "shouldn't get slower". That was wrong. See the comment on the glob call. Directories walked are the same, but per-file matching cost goes up.
Outside this PR, for later: scanBuildRoots runs discovery twice even with no --exclude-paths. globWithGitIgnore could run filter before the !-pattern chain check. The scriptOpts builders in run-manifest-facts.mts and enumerate-workspaces.mts duplicate each other.
… config - Move build-file names, the POM pattern and its case rule into one BUILD_FILES record; discovery walks narrow globs again and matches after. - Build every discovered POM with its own --file; a user -f/--file in mavenOpts is dropped with a warning during config resolution. - Resolve DSI and wizard settings once per directory. - Require socketConfig for discovery, loaded through loadSocketConfig. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oskar Haarklou Veileborg (BarrensZeppelin)
left a comment
There was a problem hiding this comment.
LGTM ✅
LLM Description written by Claude Code:claude-opus-5-5
--dynamic-sbom-inferenceonly discovered Maven builds through files named exactlypom.xml. A scan uploads more POMs than that: depscan's supported-file pattern for POMs is{*-*.,}pom{.xml,}, matched case-insensitively. Those other POMs were uploaded without a facts build. Discovery now follows the upload rules..gitignoreand now alsoprojectIgnorePathsinsocket.yml, as the upload does. A POM a scan would not upload is not built either.pom.xmlruns withmvn --file <pom>, and its facts file is named after it (<pom>.socket.facts.json). Coverage by a parent build is judged per file, so a covered POM doesn't hide an uncovered sibling.--exclude-pathsunchanged: it stays case-sensitive; only the POM name match ignores case.socket manifest setup --recursive): asks once per directory holding several POMs. It no longer disables a whole directory when--exclude-pathsmatches only one of its POMs, and warns instead.Things to be aware of:
<artifactId>-<version>.pom) are now built too, because depscan accepts them. An in-tree Maven repository (e.g. a project-local.m2/repository) is skipped when gitignored or listed inprojectIgnorePaths; otherwise use--exclude-paths. A POM that fails to build still stops the remaining Maven builds in the run, as before.socket manifestruns without the API.Tested:
.gitignore,projectIgnorePaths,--exclude-paths), per-POM runs and coverage, and the wizard.pom.xml,app-dev.pom.xml, a barepomand a gitignored.m2artifact POM produced three facts files, each from its own POM.🤖 Generated with Claude Code
Note
Medium Risk
Changes Maven discovery and how many
mvninvocations run (including vendored/artifact POMs), which can increase build time or fail the whole Maven walk on a bad POM; behavior is well-covered by tests but may surprise repos that previously only builtpom.xml.Overview
--dynamic-sbom-inferencenow treats Maven like a scan upload: discovery uses the same POM filename pattern (pom.xml,*.pom,*.pom.xml, barepom, case-insensitive) and skips paths ignored by.gitignoreorsocket.ymlprojectIgnorePaths.Build discovery returns
BuildRootobjects (dir+ optionalentryFile) instead of directories only. Each matching POM is a separate Maven build; non-default files run withmvn --file, and reactor coverage is per POM file so one covered sibling does not hide another in the same folder.The recursive manifest generator, DSI output, and
socket manifest setup --recursivefollow the same model:withEntryFileOptsprepends--file, partial--exclude-pathsno longer disables an entire directory when another POM there stays included (with a warning), and the setup wizard prompts once per directory for multiple POMs.Reviewed by Cursor Bugbot for commit 386e1a7. Configure here.