Skip to content

feat(scan): add --dynamic-sbom-inference-continue-on-resolution-errors - #1820

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 7 commits into
v1.xfrom
jfblaa/dsi-skip-failed-builds
Open

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 7 commits into
v1.xfrom
jfblaa/dsi-skip-failed-builds

Conversation

@jfblaa

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

Copy link
Copy Markdown
Contributor

Adds --dynamic-sbom-inference-continue-on-resolution-errors to socket scan create, socket scan reach and socket fix (--continue-on-resolution-errors on socket manifest dynamic-sbom-inference), so one project whose build fails no longer aborts --dynamic-sbom-inference for a whole repository. A build root whose failure Coana blames on the project's own build is left out with a warning, along with the build roots it holds back, and every other root still produces Socket facts. Failures of Coana, Socket's backend or the CLI still abort.

Do not merge before Coana releases coana-tech/coana-package-manager#2928 and v1.x pins that release. Until then Coana writes skipEcosystems, so depscan would also skip a left-out root's manifest files. CONTINUE_ON_RESOLUTION_ERRORS_MIN_COANA_VERSION and the changelog entry then move from 15.15.11 (the first release with #2923, which reports what a failed build read) to that release.

What happens to a left-out root
  • socket scan create: the scan reads its manifest files as it does without --dynamic-sbom-inference.
  • socket scan create --reach: the same, but reachability analysis leaves it out.
  • socket scan reach, socket fix: the analysis leaves it out.
  • socket manifest dynamic-sbom-inference: exits successfully when every failure was left out; text output marks the root (left out), JSON outcomes carry blame, reason and skipped.
What a failed build holds back
  • The modules its build tool read of it, as Coana reports them, including modules that ran before it. socket-cli parses no build files.
  • Everything in or under a project whose modules its tool could not read, and the whole directory when Coana reports nothing of what was read.
  • Builds of their own beneath it (Gradle builds with their own settings, sbt builds with their own project directory) still run.
Behaviour
  • Without the flag, a failure aborts as before; when a failure is the project's own, the error names the flag.
  • A build root that fails to load for a socket.json skip carries Coana's blame too, so the flag can leave it out.
  • The flag requires the Coana version above and fails clearly on an older --reach-version.
  • The scan commands point --continue-on-resolution-errors at the prefixed flag, as they do for --ignore-unresolved and --build-timeout.
  • Command line only, not a socket.json setting.
Tests
  • generate-recursive-manifests.test.mts: what a failed reactor holds back for known, unknown and unreported modules, and for a Coana failure, with and without the flag.
  • run-manifest-facts.test.mts: Coana's blame and projects, an empty project list read as unreported, and the minimum Coana version.
  • run-dynamic-sbom-inference.test.mts: the warnings scan create, scan create --reach and scan reach give for a left-out root; handle-manifest-dynamic-sbom-inference.test.mts: skipped failures succeed, others fail and name the flag only for a project's own failure.
  • reject-manifest-only-flags.test.mts: the pointer for --continue-on-resolution-errors and its negation.
  • Help snapshots, inline and native.

A hung build tool could stall --dynamic-sbom-inference indefinitely. Each
build root now has a timeout covering all of its build tool runs together:
--dynamic-sbom-inference-build-timeout on scan create, scan reach and fix,
and --build-timeout on the manifest command. Values use the format of
--reach-analysis-timeout, and 0 turns the timeout off.

Coana applies the timeout. A Coana too old to take one gets no default,
and setting the flag requires the first Coana that applies it.
The default build timeout drops from an hour to 10 minutes per build
root, enough to resolve dependencies on an empty cache while catching a
hung build sooner. A root whose socket.json sets reachability.build to
"compile" gets 20 minutes on a reachability scan, as it also builds the
project. A timeout given on the command line applies to every root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coana 15.15.10 predates the build timeout and rejects the field, so sending it
there would fail every --dynamic-sbom-inference request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The scan commands now name --dynamic-sbom-inference-build-timeout when given
the manifest command's --build-timeout, a timeout too large to send is an input
error, and the help says the compile default applies to reachability scans.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the flag (--continue-on-resolution-errors on socket manifest
dynamic-sbom-inference), a build root whose failure Coana blames on the
project's own build is left out, with the build roots it holds back,
instead of aborting the run; every other root still produces Socket
facts. Failures of Coana, Socket's backend or the CLI still abort.

socket scan create reads a left-out root's manifest files as it does
without --dynamic-sbom-inference; reachability analysis and socket fix
leave the root out.

The flag needs a Coana that reports what a failed build read and that
marks for depscan only the files each build read.
@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) changed the title feat(scan): skip failed builds with --dynamic-sbom-inference feat(scan): add --dynamic-sbom-inference-continue-on-resolution-errors Dec 4, 2026
@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) marked this pull request as ready for review December 4, 2026 10:37
@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes multi-root dynamic SBOM orchestration, exit codes, and scan target selection; behavior depends on Coana 15.15.11+ reporting failed-build projects and blame correctly.

Overview
Adds --dynamic-sbom-inference-continue-on-resolution-errors (and --continue-on-resolution-errors on socket manifest dynamic-sbom-inference) so --dynamic-sbom-inference on socket scan create, socket scan reach, and socket fix can skip a build root whose own tool build failed instead of failing the whole run. Coana/CLI/backend failures still abort; only failures blamed on the project are continuable when the flag is set.

The recursive manifest walker now tracks what each failed root holds back (modules Coana reported, directory-wide fallback, or nested builds of their own that still run), exposes abortedBy / blame / reason / skipped on outcomes, and treats skipped project failures as non-fatal for exit status. Fact generation moves from opaque null failures to generateManifestFacts returning structured ResolutionFailure (project vs other), with minimum Coana 15.15.11 when continuing.

Scan behavior for left-out roots: scan create passes scansManifests: true, so those manifests are still uploaded like a non-DSI scan; reach/fix paths warn that analysis omits them. Error messages when aborting suggest the new flag when a failure was the project's build.

Docs, changelog, CLI help, and extensive tests cover held-back modules, unreported failures, and flag validation/rename rules on scan commands.

Reviewed by Cursor Bugbot for commit 7feb27b. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 7feb27b. Configure here.

// The first Coana that reports what a failed build read, and that marks for
// depscan only the files each build read, so a left-out root's manifest files
// are still scanned.
export const CONTINUE_ON_RESOLUTION_ERRORS_MIN_COANA_VERSION = '15.15.11'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left-out manifests still skipped

High Severity

CONTINUE_ON_RESOLUTION_ERRORS_MIN_COANA_VERSION is 15.15.11, and the changelog says that release still scans a left-out root’s manifest files. That Coana build only reports what the failed build read (#2923). It still writes skipEcosystems, and factsOnlyTypes still includes the failed root’s ecosystem, so depscan drops those manifests while the run also discards their Socket facts. A scan that “continues” can omit that project’s dependencies and still exit successfully.

Fix in Cursor Fix in Web

Triggered by learned rule: Do not flag Coana CLI flag compatibility — @coana-tech/cli version is pinned

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

4 participants