GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(scan): warn when Maven/NuGet discovery is gated off by mikolalysenko · Pull Request #161 · SocketDev/socket-patch

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Aug 12, 2026 •
edited by cursor Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Problem

scan --mode vendored / --mode hosted discovers installed packages through crawl_all_ecosystems (crates/socket-patch-cli/src/ecosystem_dispatch.rs). That function gates Maven and NuGet behind the SOCKET_EXPERIMENTAL_MAVEN / SOCKET_EXPERIMENTAL_NUGET runtime flags and, when the flag is off, skips them silently (old lines 452-461).

The user-facing warn_maven_disabled / warn_nuget_disabled warnings only fire on the partitioned-apply path in dispatch_find — NOT on this crawl/discovery gate. So a Maven pom.xml project (or a .NET project) scanned in vendored/hosted mode with the flag off exits 0 with "scannedPackages": 0 and zero Maven/NuGet-related stderr. Confirmed against real prod: same command with SOCKET_EXPERIMENTAL_MAVEN=1 reports scannedPackages: 173 (NuGet 0 vs 1). The docs call the vendored/hosted wiring "ungated", but it is unreachable because discovery is gated, and the user gets no signal.

Fix

In crawl_all_ecosystems (crates/socket-patch-cli/src/ecosystem_dispatch.rs:466-482), when the experimental flag is off, check whether the crawler would have found sources and, if so, emit a one-time warning:

  • maven_discovery_gated_off / nuget_discovery_gated_off (ecosystem_dispatch.rs:64-96) — true only when the runtime flag is OFF and the crawler's own get_maven_repo_paths / get_nuget_package_paths returns a non-empty set. Reusing the crawler's discovery means the signal matches exactly what an opted-in scan would crawl, and it never fires on non-Maven/non-.NET projects (guards against noise; fires at most once per run).
  • warn_maven_discovery_gated / warn_nuget_discovery_gated (ecosystem_dispatch.rs:37-46 / 66-75) — discovery-path wording naming SOCKET_EXPERIMENTAL_MAVEN=1 / SOCKET_EXPERIMENTAL_NUGET=1.

The gate itself is unchanged — Maven/NuGet remain opt-in and are NOT enabled by default; only the previously-silent skip is surfaced. No crawl_all_ecosystems signature change, so no churn at the scan/get call sites.

Test

Four hermetic unit tests in ecosystem_dispatch::tests (crates/socket-patch-cli/src/ecosystem_dispatch.rs), matching the neighboring crawl_all_gates_* gate tests (same #[serial_test::serial(experimental_gate_env)] group):

  • maven_discovery_gated_off_warns_for_pom_project_when_flag_off — a pom.xml project + existing local repo: gated (warns) with the flag off, NOT gated (crawled) with the flag on.
  • maven_discovery_not_gated_without_java_project — no marker: never warns (noise guard).
  • nuget_discovery_gated_off_warns_for_dotnet_project_when_flag_off — .csproj + existing cache: same flag on/off assertions.
  • nuget_discovery_not_gated_without_dotnet_project — noise guard.

cargo test -p socket-patch-cli --lib ecosystem_dispatch::tests → 37 passed, 0 failed. cargo build -p socket-patch-cli clean.

Scope

Touches only crates/socket-patch-cli/src/ecosystem_dispatch.rs. No cross-dependencies with other in-flight fixes. Warning goes to stderr, so JSON on stdout is unaffected. Note: crawl_all_ecosystems has no silent param, so the one-time stderr warning is emitted regardless of --silent/--json; kept out of scope to avoid a signature change touching scan/get call sites.

🤖 Generated with Claude Code


Note

Low Risk
User-visible stderr messaging only; experimental crawl gates and JSON stdout are unchanged aside from possible warning text on stderr.

Overview
Vendored/hosted scans no longer skip Maven and NuGet discovery silently when SOCKET_EXPERIMENTAL_MAVEN / SOCKET_EXPERIMENTAL_NUGET are unset. Apply-time warnings only run on the partitioned-apply path; crawl_all_ecosystems used to omit those ecosystems with no stderr, so users could see scannedPackages: 0 with no explanation.

When the experimental flag is off, crawl_all_ecosystems now checks whether the Maven/NuGet crawlers would have found sources (via the same get_maven_repo_paths / get_nuget_package_paths discovery used for an opted-in crawl). If so, it prints a one-time stderr warning naming the env var to enable discovery. Gating behavior is unchanged — Maven/NuGet are still not crawled without opt-in.

Four hermetic tests cover flag on/off and “no project marker” cases so warnings fire only when something was actually skipped.

Reviewed by Cursor Bugbot for commit e20edca. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mikolalysenko
Mikola Lysenko (mikolalysenko) enabled auto-merge (squash) August 12, 2026 23:39
cursor[bot]
cursor Bot reviewed Aug 12, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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 ON. A cloud agent has been kicked off to fix the reported issue.

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

Reviewed by Cursor Bugbot for commit e20edca. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread crates/socket-patch-cli/src/ecosystem_dispatch.rs Resolved

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko
Mikola Lysenko (mikolalysenko) force-pushed the fix/warn-maven-nuget-gated-discovery branch from e20edca to fb5057e Compare August 13, 2026 17:38
Mikola Lysenko (mikolalysenko) and others added 2 commits August 13, 2026 11:44
@mikolalysenko @claude
fix(scan): warn when Maven/NuGet discovery is gated off
3ab9591
`scan --mode vendored`/`hosted` discovers packages through
`crawl_all_ecosystems`, which silently skips Maven/NuGet when
`SOCKET_EXPERIMENTAL_MAVEN` / `SOCKET_EXPERIMENTAL_NUGET` is off. The
existing `warn_maven_disabled` / `warn_nuget_disabled` warnings only
fire on the partitioned-apply path, so a Maven/NuGet project scanned in
vendored/hosted mode with the flag off reported `scannedPackages: 0` and
success with zero explanation.

Add discovery-path warnings that fire once per run, only when a
Maven/NuGet project is actually present on disk (reusing the crawler's
own `get_maven_repo_paths` / `get_nuget_package_paths` discovery so the
signal matches exactly what an opted-in scan would crawl). The gate
itself is unchanged — Maven/NuGet remain opt-in; only the silent skip is
surfaced.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mikolalysenko @claude
fix(scan): suppress gated-off Maven/NuGet warning in global scans
0bbdddf
`maven_discovery_gated_off` / `nuget_discovery_gated_off` treated any
non-empty `get_maven_repo_paths` / `get_nuget_package_paths` result as
"a local project was detected". But in `--global` / `--global-prefix`
mode those helpers return the shared cache path with NO project-marker
check (`global_prefix` skips even the `is_dir` check), so an ordinary
global scan emitted a false "Maven/NuGet project detected but gated"
warning for a project that was never there.

Return early (never gated) in global / global-prefix mode, matching how
the crawlers themselves only apply the project-marker gate on the local
path. Local project scans (a real `pom.xml` / `.csproj` with the flag
off) still warn. The experimental gate itself is unchanged.

Adds hermetic unit tests asserting the decision stays FALSE in global
and global-prefix mode even with a populated cache present.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@mikolalysenko
Mikola Lysenko (mikolalysenko) force-pushed the fix/warn-maven-nuget-gated-discovery branch from fb5057e to 0bbdddf Compare August 13, 2026 18:44
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Aug 13, 2026
View reviewed changes
Wenxin-Jiang
Wenxin Jiang (Wenxin-Jiang) approved these changes Aug 13, 2026
View reviewed changes
@mikolalysenko

Mikola Lysenko (mikolalysenko) commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Closing — superseded by #170 ("promote maven and nuget to fully available — retire the SOCKET_EXPERIMENTAL_* gates").

This PR added a discovery-path warning for when the SOCKET_EXPERIMENTAL_MAVEN/SOCKET_EXPERIMENTAL_NUGET gate was off, so a maven/nuget scan wouldn't silently report 0 packages. #170 removed those gates entirely — maven/nuget are now always crawled — so that silent-0 scenario can no longer occur, and this PR's warnings would point users at an env var that no longer exists. Obsolete; no rebase needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikolalysenko Mikola Lysenko (mikolalysenko) closed this Aug 13, 2026
auto-merge was automatically disabled August 13, 2026 21:52

Pull request was closed

@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the fix/warn-maven-nuget-gated-discovery branch August 13, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@Wenxin-Jiang Wenxin Jiang (Wenxin-Jiang) Wenxin-Jiang approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@mikolalysenko @Wenxin-Jiang
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.