Skip to content

feat(scan): add --dynamic-sbom-inference-ignore-unresolved - #1818

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
jfblaa/dsi-no-build-root-noopfrom
jfblaa/dsi-settings-flags
Open

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
jfblaa/dsi-no-build-root-noopfrom
jfblaa/dsi-settings-flags

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Adds --dynamic-sbom-inference-ignore-unresolved to socket scan create, socket scan reach and socket fix, so many repositories can be scanned with --dynamic-sbom-inference without a socket.json in each. It tolerates unresolved dependencies in every build and overrides ignoreUnresolved from socket.json, builds entries included.

The scan commands now reject --ignore-unresolved, --exclude-configs, --include-configs and --verbose. They never declared them, so each silently took the next argument, which can be the scan target, as its value. The error names the flag or the socket.json setting to use instead.

Why only this setting

It is the only build setting that is the same across unrelated repositories. Java homes, build tool binaries, options and configurations are per repository and stay in socket.json.

Implementation notes
  • DynamicSbomInference = { ignoreUnresolved, purlTypes } replaces the bare purl type list passed from the commands to facts generation, so later options join it as fields.
  • The flags shared by the three commands are dynamicSbomInferenceFlags; giving one without --dynamic-sbom-inference is an input error.
Tests
  • reachability-flags.test.mts: parsing, and the requires---dynamic-sbom-inference error.
  • reject-manifest-only-flags.test.mts: each rejected flag and its message.
  • run-dynamic-sbom-inference.test.mts, generate-recursive-manifests.test.mts: the override reaches every build, builds entries included.
  • Help snapshots, inline and native.

Scanning many repositories with --dynamic-sbom-inference needed a
socket.json in each to tolerate unresolved dependencies. The new flag on
scan create, scan reach and fix applies to every build and overrides
socket.json, as --ignore-unresolved does on the manifest command.

The scan commands do not declare --ignore-unresolved, --exclude-configs,
--include-configs or --verbose, so each could take the scan target as its
value. They are now rejected with a pointer to the flag or socket.json
setting to use instead.

DynamicSbomInference now carries the selected ecosystems and the
ignore-unresolved override together.
@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes unresolved-dependency behavior for dynamic SBOM scans and breaks scripts that passed manifest-only flags to scan commands; scan targeting mistakes become hard errors instead of silent mis-parsing.

Overview
Adds --dynamic-sbom-inference-ignore-unresolved (with --dynamic-sbom-inference) on socket scan create, socket scan reach, and socket fix, so CI can scan many repos without per-build socket.json. The flag warns instead of failing on unresolved JVM/.NET deps and overrides every ignoreUnresolved in socket.json, including per-build builds entries.

Dynamic SBOM options are now a DynamicSbomInference object (ignoreUnresolved + purlTypes) instead of a bare ecosystem list, threaded through facts generation and fix flows.

socket scan create and socket scan reach error on undeclared flags --ignore-unresolved, --exclude-configs, --include-configs, and --verbose (replacing silent warnings), because unknown flags could consume the scan target. Scan users get --dynamic-sbom-inference-ignore-unresolved instead of --ignore-unresolved; other manifest-only settings stay in socket.json.

Reviewed by Cursor Bugbot for commit 3ac31b0. Configure here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant