Skip to content

feat(manifest): add socket.json reachability settings for the build tools - #1728

Open
Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
jfblaa/facts-3-delete-scriptsfrom
jfblaa/facts-4-reachability-settings
Open

Jeppe Fredsgaard Blaabjerg (jfblaa) wants to merge 1 commit into
jfblaa/facts-3-delete-scriptsfrom
jfblaa/facts-4-reachability-settings

Conversation

@jfblaa

@jfblaa Jeppe Fredsgaard Blaabjerg (jfblaa) commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Heads up, reviewer

Reachability analysis can use different settings than sbom generation, e.g. analyse against a different java/dotnet runtime.
Additionally, customers may want to build their projects for reachability analysis, but not when just generating sboms.
This PR adds reachability settings to socket.json to help configure such properties.


LLM Description written by Claude Code:claude-opus-5-5

A build tool's socket.json section, and a build's own builds entry, take a reachability object that reachability scans send to Coana with each build root's request: whether to compile the project before the analysis, and the JDK or .NET runtime the analysis assumes.

Merges with the stack; the release gates and the expected e2e failures are in #1725.

Settings
  • build: "compile" builds the project first, and a failed build fails the scan; "none" or unset analyses it unbuilt.
  • javaHome (Maven, Gradle, sbt): the JDK the analysis takes the program to run on, passed as written; unset, the build's own JDK.
  • runtimeVersion (.NET): the runtime a framework-dependent build's analysis starts on; major.minor takes its latest installed patch, major.minor.patch[-prerelease] exactly that runtime.
Cascade and validation
  • Each field cascades on its own, a build's builds entry last; null clears an inherited value.
  • Only reachability scans that generate facts read them, for the build tools they run, so an invalid value never stops another command.
  • An invalid value or a field the tool doesn't take fails the scan before any build runs, naming the socket.json and setting.
Stack
  1. fix: keep the API token and settings socket-cli passes Coana out of the build tools it runs #1725: Keep the Socket API token out of the tools Coana runs
  2. feat(manifest): generate Socket facts with Coana #1726: Generate Socket facts with Coana
  3. refactor(manifest): delete socket-cli's build-tool scripts and facts assembly #1727: Delete socket-cli's build-tool scripts and facts assembly (internal)
  4. feat(manifest): add socket.json reachability settings for the build tools #1728: socket.json reachability settings for the build tools (this PR)
  5. feat(manifest): ask for the reachability settings in the setup wizards #1729: Reachability settings in the setup wizards
  6. refactor: follow-ups to generating Socket facts with Coana #1733: Follow-ups (draft)

Changelog

In CHANGELOG.md under [Unreleased]:

Added

  • Tune reachability per build tool in socket.json: reachability.build compiles the project before the analysis, reachability.javaHome (Maven, Gradle, sbt) sets the JDK the analysis assumes, and reachability.runtimeVersion (.NET) sets the runtime it starts on.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes reachability scan behavior and Coana request payloads; misconfiguration can fail scans early or alter analysis JDK/runtime/compile behavior, but scope is manifest configuration rather than auth or data handling.

Overview
Adds reachability blocks on each JVM/.NET manifest tool section and per-builds entry so reachability scans can differ from plain SBOM generation: whether Coana compiles first (build: "compile" vs "none"), which JDK the analysis assumes (javaHome for Maven/Gradle/sbt), and which .NET runtime to start on (runtimeVersion).

Settings cascade field-by-field (with null clearing inherited values); mergeBuildToolDefaults merges nested reachability when chaining socket.json files. Resolution and validation run in build-root-config (tool-specific fields, .NET SemVer-style runtime strings) and fail the scan before any build when invalid, naming the offending socket.json or build entry.

Only reachability scans (workDir.withFiles) read and forward these values through generateRecursiveManifests, generateAutoManifest, and convertDotnetToFacts into the Coana generate-socket-facts request (run-manifest-facts). Skipped tools (disabled, Gradle/sbt facts: false) are not validated. Docs and changelog describe the new fields.

Reviewed by Cursor Bugbot for commit 4e3d59e. Configure here.

A build tool's socket.json section takes a `reachability` object, which
reachability scans send to Coana with each build root's request:

- `build`: "compile" builds the project before the analysis, "none" or
  unset analyses it unbuilt;
- `javaHome`, Maven, Gradle and sbt: the JDK the analysis takes the
  program to run on, as written;
- `runtimeVersion`, .NET: the runtime a framework-dependent build's
  analysis starts on, as major.minor or major.minor.patch[-prerelease].

Each field cascades on its own, a build's own `builds` entry last, and
null clears an inherited one. Only a reachability scan reads them, for the
build tools it runs, so an invalid value never stops another command. It
checks them before any build runs and fails naming the socket.json and
setting, including a field the build tool does not take.

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