Skip to content

fix(scan): scan without facts when no build root is found - #1817

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
v1.xfrom
jfblaa/dsi-no-build-root-noop
Open

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
v1.xfrom
jfblaa/dsi-no-build-root-noop

Conversation

@jfblaa

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

Copy link
Copy Markdown
Contributor

--dynamic-sbom-inference no longer fails a repository without a .NET, Gradle, Maven or sbt build. socket scan create, socket scan reach and socket fix log that no build root was found and carry on as without the flag, and socket manifest dynamic-sbom-inference reports it and exits successfully. The flag can now be passed to every repository a pipeline scans.

Behaviour
  • Scans: no facts files, no facts-only purl types sent to Coana, so the manifest files are scanned and analysed as they are.
  • socket fix: no --socket-facts-sidecar and no facts-only flag reach Coana; the fix runs exactly as without the flag.
  • A repository with build roots that all fail, or that produce no facts for reachability, still fails as before.
Tests
  • run-dynamic-sbom-inference.test.mts: no build root returns no facts and no facts-only types.
  • generated-socket-facts.test.mts, coana-fix-dynamic-sbom-inference.test.mts: fix generates nothing and runs Coana as without the flag.
  • handle-create-new-scan.test.mts, handle-manifest-dynamic-sbom-inference.test.mts: the scan goes on without facts; the manifest command succeeds with its message.

`--dynamic-sbom-inference` failed scan create, scan reach and fix when a
repository had no .NET, Gradle, Maven or sbt build, so the flag could not
be passed to every repository. They now log that no build root was found
and continue as without the flag, and `socket manifest
dynamic-sbom-inference` reports it and exits successfully.
@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) changed the title jfblaa/dsi no build root noop fix(scan): scan without facts when no build root is found Dec 2, 2026
@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) marked this pull request as ready for review December 2, 2026 23:53
@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes exit codes and scan/fix behavior for repos without JVM or .NET builds when --dynamic-sbom-inference is set globally in CI, though real failures and reachability-without-facts cases still abort as before.

Overview
--dynamic-sbom-inference no longer errors when a repo has no Gradle, Maven, sbt, or .NET build roots. The flag can be enabled uniformly in pipelines: matching projects still get Socket facts and facts-only Coana behavior, while others log that no build root was found and continue like a normal scan.

runDynamicSbomInference now returns empty paths and factsOnlyTypes: undefined instead of throwing InputError. socket fix --dynamic-sbom-inference follows the same path—generateSocketFactsForFix may return undefined, so Coana is not given --use-only-socket-facts-artifacts or --socket-facts-sidecar. socket manifest dynamic-sbom-inference reports the no-build-root message and exits successfully (ok: true), with the message shown in text/markdown output.

Unchanged: runs still fail when a discovered build root fails to generate facts, or when reachability is requested but no build produced facts (empty/skipped roots).

Reviewed by Cursor Bugbot for commit c8985b4. 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