Skip to content

feat(manifest): ask for the reachability settings in the setup wizards - #1729

Merged
Jeppe Fredsgaard Blaabjerg (jfblaa) merged 10 commits into
v1.xfrom
jfblaa/facts-5-wizards
Nov 27, 2026
Merged

Jeppe Fredsgaard Blaabjerg (jfblaa) merged 10 commits into
v1.xfrom
jfblaa/facts-5-wizards

Conversation

@jfblaa

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

Copy link
Copy Markdown
Contributor

Heads up, reviewer

Update wizard to configure reachability settings 🧙‍♂️


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

socket manifest setup --dynamic-sbom-inference asks for #1728's reachability settings for each build and directory default it configures, so they can be set without editing socket.json by hand. Plain socket manifest setup doesn't ask, as only dynamic SBOM inference reads them.

Merges with the stack. The Coana release it needs is pinned on v1.x since #1762.

Questions
  • Whether to build before reachability analysis; a no writes "none" only to override an inherited "compile".
  • Maven, Gradle and sbt: whether to use a different JDK for the analysis, showing the one in effect and whether it is inherited.
  • .NET: whether to start a framework-dependent build's analysis on a given runtime.
  • Like every other setting, only answers that differ from what the build inherits are written.
  • The wizard runs even when a reachability value is invalid: it replaces one of its own with the answers, and names an inherited one to be fixed in the socket.json that sets it.
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 (merged)
  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
  5. feat(manifest): ask for the reachability settings in the setup wizards #1729: Reachability settings in the setup wizards (this PR)
  6. refactor: follow-ups to generating Socket facts with Coana #1733: Follow-ups (draft)

Changelog

In CHANGELOG.md under [Unreleased]:

Added

  • socket manifest setup --dynamic-sbom-inference asks for the reachability settings, so there is no need to edit socket.json by hand.

🤖 Generated with Claude Code

@cursor

cursor Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Interactive configuration and socket.json write logic only; no change to scan/reachability execution paths beyond what users opt into via the wizard.

Overview
socket manifest setup and the dynamic-sbom-inference recursive wizard now walk through defaults.manifest.*.reachability for .NET, Gradle, Maven, and sbt when Socket facts generation is in play, so users do not have to edit socket.json by hand.

The wizards ask whether to compile before reachability (reachability.build: compile vs overriding an inherited compile with none), whether to set a separate JDK for JVM tools (reachability.javaHome, distinct from build javaHome), and for .NET whether to pin reachability.runtimeVersion. Defaults and “no” labels reflect the effective value, including settings inherited from parent socket.json files; clearing with a blank answer writes null so a parent value is not silently kept.

Invalid or tool-incompatible reachability values are warned and stripped before prompting. Gradle/sbt in pom mode skip the reachability step. The recursive setup passes inherited reachability into each wizard and only persists fields that differ from the cascade (including nested reachability keys).

Changelog and broad unit/integration tests cover inheritance, overrides, validation, and write behavior.

Reviewed by Cursor Bugbot for commit 78fadc7. Configure here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[agent] The inline comments are simplification opportunities in the wizard code; none of them is a correctness issue. The comments on the tool === 'dotnet' choice, validReachability and effectiveValue amount to one change: drive the step from #1728's field table and one parse. The comment on configureBuild's call is the change that touches both wizards.

Checked and dropped:

  • Speed: the ancestor socket.json lookup runs once per run, and the draftCascade call in setupRootDefaults's loop runs at most once per tool.
  • confirm and askYesNo can't replace the new selects, because they can't show the inherited value in each choice's description.
  • cascadedReachability can't replace inheritedReachabilityOf: it throws on invalid values and drops nulls, but the wizard needs the raw values.

@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) force-pushed the jfblaa/facts-5-wizards branch 2 times, most recently from b7963a3 to fc3ea0d Compare November 27, 2026 10:14
Base automatically changed from jfblaa/facts-4-reachability-settings to v1.x November 27, 2026 10:32
`socket manifest setup` and `socket manifest setup
--dynamic-sbom-inference` ask, for each build tool that generates facts:

- whether to build the project before reachability analysis. A no writes
  "none" only to override an inherited "compile", and otherwise leaves the
  setting unset;
- Maven, Gradle and sbt: whether to use a different JDK for the analysis,
  showing the one in effect, inherited or not;
- .NET: whether to start a framework-dependent build's analysis on a given
  runtime, taking major.minor or major.minor.patch[-prerelease].

The wizards read socket.json as written, so they run under an invalid
reachability value: they warn about what a build tool cannot take and
replace it with the answers, and ignore an invalid inherited value for
their defaults.
`socket manifest setup --dynamic-sbom-inference` wrote every accepted
default of a directory's section into its socket.json, so accepting an
inherited reachability value pinned it there. It now keeps only the fields
that differ from what the directory inherits, as it does for a build.
Answering no to a different JDK in a directory under a socket.json that
sets one writes nothing, and the scan there reads the parent's JDK;
answering yes with a blank JDK writes null, and the scan reads none.
The step asks about each field the tool takes, from the table the scan
checks, and reads both its own and the inherited value through the same
parse, so it no longer filters them twice. The value in effect is the
merge a scan makes. A blank answer writes null only when there is a value
to clear, and the .NET runtime version format is written once.
The parent of / is / itself, so the cascade a socket.json there was compared against held its own settings, and the wizard dropped every field it kept as inherited.
The warning takes the parse's problems, the step's options keep one local type, and what a directory inherits is its chain without its own socket.json, which needs no case for the filesystem root.
Only dynamic SBOM inference scans read them, so plain `socket manifest
setup` no longer asks. The recursive wizard runs the step after each build
tool's questions with the settings in effect and what they inherit, and
writes only what differs from the inherited value, for directory defaults
as for builds. A value that equals the inherited one is labelled as
inherited, and an invalid inherited value is named, to be fixed in the
socket.json that sets it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM ✅

@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) merged commit 083021a into v1.x Nov 27, 2026
22 checks passed
@jfblaa
Jeppe Fredsgaard Blaabjerg (jfblaa) deleted the jfblaa/facts-5-wizards branch November 27, 2026 11:08
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.

3 participants