Skip to content

fix: surface crawler find_by_purls errors instead of swallowing#55

Open
Wenxin-Jiang wants to merge 1 commit intomainfrom
fix/crawler-error-surfacing
Open

fix: surface crawler find_by_purls errors instead of swallowing#55
Wenxin-Jiang wants to merge 1 commit intomainfrom
fix/crawler-error-surfacing

Conversation

@Wenxin-Jiang
Copy link
Copy Markdown
Contributor

Summary

  • Replaced all 16 instances of if let Ok(packages) = crawler.find_by_purls(...) with match blocks that log warnings to stderr on error.
  • Applies to both find_packages_for_purls (used by apply) and find_packages_for_rollback (used by rollback).
  • Covers all 8 ecosystems: npm, pypi, cargo, gem, golang, maven, composer, nuget.
  • Outer path-discovery errors (e.g., get_node_modules_paths()) were already handled correctly and left unchanged.

Addresses finding HIGH-3 (crawler find_by_purls errors silently swallowed), which feeds into the critical silent-no-op problem when crawler failures reduce the discovered package set to zero.

Test plan

  • cargo check -p socket-patch-cli compiles
  • cargo test -p socket-patch-cli passes
  • Manual: corrupt a package.json in node_modules/, run apply — should see warning about failed scan
  • Manual: same with --silent — warning should be suppressed

🤖 Generated with Claude Code

Replace all `if let Ok(packages) = crawler.find_by_purls(...)` with
`match` blocks that log warnings on Err when not in silent mode.
Previously, per-path crawler failures (corrupt manifests, permission
denied, etc.) were silently dropped, causing packages to vanish from
discovery without any diagnostic output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Wenxin-Jiang
Copy link
Copy Markdown
Contributor Author

@claude review once

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant