Skip to content

fix(scan): suppress auto-manifest hint when .socket.facts.json exists#1337

Merged
Martin Torp (mtorp) merged 2 commits into
v1.xfrom
martin/detected-manifests-we-could-try-to-regen
May 28, 2026
Merged

fix(scan): suppress auto-manifest hint when .socket.facts.json exists#1337
Martin Torp (mtorp) merged 2 commits into
v1.xfrom
martin/detected-manifests-we-could-try-to-regen

Conversation

@mtorp
Copy link
Copy Markdown
Contributor

@mtorp Martin Torp (mtorp) commented May 28, 2026

Summary

  • socket scan create prints "Detected N manifest targets we could try to generate. Please set the --auto-manifest flag..." whenever detectManifestActions finds a build.sbt, gradlew, MODULE.bazel, or environment.yml in the cwd.
  • That hint is misleading when a .socket.facts.json is already present — it's the output of socket manifest auto (or the --facts mode of the per-ecosystem manifest commands), and handle-create-new-scan.mts already includes it in scanPaths. So the manifest data is in the scan; the suggestion to regenerate it isn't useful.
  • Gate the hint on existsSync(cwd/.socket.facts.json); everything else (the auto-manifest pathway itself, the detector, other callers) is untouched.

Notes / open questions

  • Did not also gate on pom.xml presence (the non---facts output for sbt/gradle), since pom.xml is commonly author-written for Maven projects and isn't a reliable "already generated" marker.

Test plan

  • pnpm build:dist:src && pnpm test:unit src/commands/scan/
  • Manual: in a Gradle-ish repo, run socket manifest gradle --facts, then socket scan create --dry-run — confirm the "Detected N manifest targets..." line is gone.
  • Manual: same repo without the facts file — confirm the hint still prints.

Note

Low Risk
UX-only change to a single log message in cmd-scan-create.mts; no scan upload or manifest generation behavior is modified.

Overview
socket scan create no longer logs the “Detected N manifest targets… use --auto-manifest” hint when .socket.facts.json already exists in the scan working directory.

That file is produced by socket manifest auto (or ecosystem --facts flows) and is already included in scan paths, so the nudge to regenerate manifests was redundant. --auto-manifest, detectManifestActions, and other callers are unchanged—only the informational log is gated.

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

The "Detected N manifest targets we could try to generate" hint in
`socket scan create` nudges users to pass --auto-manifest. Skip it when
a `.socket.facts.json` is already present at cwd — that file is the
output of `socket manifest auto` (or the per-ecosystem `--facts` mode),
the scan already picks it up via handle-create-new-scan, and the
suggestion is misleading in that state.
@mtorp Martin Torp (mtorp) marked this pull request as ready for review May 28, 2026 06:30
@mtorp Martin Torp (mtorp) enabled auto-merge (squash) May 28, 2026 07:11
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@mtorp Martin Torp (mtorp) merged commit f165b8f into v1.x May 28, 2026
12 checks passed
@mtorp Martin Torp (mtorp) deleted the martin/detected-manifests-we-could-try-to-regen branch May 28, 2026 13:20
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.

2 participants