Repository navigation
feat(scan): add a build timeout to --dynamic-sbom-inference - #1819
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 3 commits into
Conversation
`--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.
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.
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.
PR SummaryMedium Risk Overview socket-cli tracks elapsed time across all Coana runs for one root (listing + facts generation) and sends Reviewed by Cursor Bugbot for commit 68edae1. Configure here. |
Bounds the build tool runs of each
--dynamic-sbom-inferencebuild root by a timeout, so a hung build fails with a message instead of stalling the scan. It defaults to 3600 seconds;--dynamic-sbom-inference-build-timeoutonsocket scan create,socket scan reachandsocket fix, and--build-timeoutonsocket manifest dynamic-sbom-inference, set it in seconds (e.g.1800) or turn it off with0.Draft until Coana 15.15.10 is released and pinned: Coana applies the timeout (coana-tech/coana-package-manager#2922), and its request schema rejects the new field before that version.
Behaviour
--reach-versionkeeps working without a timeout. A timeout given on the command line requires Coana 15.15.10 and fails clearly on an older one.--reach-analysis-timeouttakes: a whole number of seconds, optionally withs,morh.socket.jsonsetting.Tests
reachability-flags.test.mts: parsing, defaults,0, invalid values, and the requires---dynamic-sbom-inferenceerror.run-manifest-facts.test.mts: the request carries the timeout and time spent only on a Coana that takes them; the minimum Coana version for a user-set timeout.