Skip to content

Add missing purl types and per-artifact parse resilience to full-scan stream - #101

Merged
lelia merged 3 commits into
mainfrom
lelia/ce-362-generic-purl-type
Aug 5, 2026
Merged

Add missing purl types and per-artifact parse resilience to full-scan stream#101
lelia merged 3 commits into
mainfrom
lelia/ce-362-generic-purl-type

Conversation

@lelia

@lelialelia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

SocketPURL_Type only defined unknown, npm, pypi, and golang. When a full-scan stream includes an artifact with any other purl type (e.g. generic), FullScanStreamResponse.from_dict raised a ValueError and FullScans.stream() returned success=False with no artifacts, so consumers ended up with zero packages and alerts for a scan that succeeded server-side.

Changes

  • Add the standard purl types (generic, maven, gem, nuget, cargo, etc.) to SocketPURL_Type
  • Add a _missing_ fallback that resolves unrecognized purl types to UNKNOWN with a warning, following the same forward-compat approach SocketCategory uses (#78)
  • Parse artifacts individually in FullScanStreamResponse.from_dict, skipping (with a warning) any artifact that fails to parse rather than failing the whole response
  • Bump version to 3.4.2 for the bundled 3.4.x release

Testing

  • New unit tests in tests/unit/test_socket_purl_type.py covering enum resolution, the UNKNOWN fallback, and per-artifact skip behavior
  • pytest tests/unit: 130 passed, 1 skipped (pre-existing)

Note: touches version.py/pyproject.toml like #99, so whichever merges second will need a trivial rebase.

Linear: CE-362

🤖 Generated with Claude Code

…facts (CE-362)
The full-scan stream can include artifacts whose purl type is not in
SocketPURL_Type (e.g. "generic"), and a single such artifact failed the
entire FullScanStreamResponse parse, leaving consumers with zero
packages and alerts for an otherwise-successful scan.
- Add the standard purl types (generic, maven, gem, nuget, cargo, ...)
to SocketPURL_Type
- Fall back to UNKNOWN with a warning for unrecognized purl types, the
same forward-compat approach SocketCategory uses (#78)
- Skip individual artifacts that fail to parse in
FullScanStreamResponse.from_dict instead of discarding the response
- Bump version to 3.4.0
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🚀 Preview package published!

Install with:

pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketdev==3.4.0.dev8

@lelialelia changed the title Add missing purl types and per-artifact parse resilience to full-scan stream (CE-362)Add missing purl types and per-artifact parse resilience to full-scan streamAug 5, 2026
@lelia
leliatemporarily deployed to socket-firewall August 5, 2026 19:15 — with GitHub Actions Inactive
@lelia
leliatemporarily deployed to socket-firewall August 5, 2026 19:22 — with GitHub Actions Inactive
@lelia
lelia merged commit d5a7f51 into mainAug 5, 2026
12 checks passed
Sign up for freeto 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.

2 participants

@lelia@flowstate