Skip to content

Raise on SBOM fetch failure and require socketdev 3.4.2 - #288

Open
lelia wants to merge 1 commit into
mainfrom
lelia/generic-purl-type-parse-bug
Open

Raise on SBOM fetch failure and require socketdev 3.4.2#288
lelia wants to merge 1 commit into
mainfrom
lelia/generic-purl-type-parse-bug

Conversation

@lelia

@lelia lelia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

When the full-scan SBOM stream fetch failed, Core.get_sbom_data logged at debug level and returned {}, so report generation continued and produced empty GitLab dependency-scanning, license, and SARIF output with exit code 0. The most common trigger was SocketDev/socket-sdk-python#101: a single artifact with a purl type the SDK didn't recognize (e.g. generic) failed the whole stream parse.

Changes

  • Core.get_sbom_data now logs at error level and raises APIFailure when the stream fetch fails, so the run goes through the existing API-error handling (exit code 3 by default; --disable-blocking still exits 0) instead of emitting empty reports
  • Bump socketdev floor to 3.4.2, the bundled release containing the missing purl types and per-artifact parse resilience

SDK rollout

Testing

Draft until socketdev 3.4.2 is published to PyPI (same gating as #284).

Remaining steps once 3.4.2 is on PyPI:

  • uv lock --upgrade-package socketdev and commit — uv.lock still pins 3.3.0 and can't be regenerated until the release exists, and the dependency-review jobs run uv sync --locked
  • Re-run CI and mark ready for review

Ref: CE-362


Note

Medium Risk
Changes error handling on a core SBOM fetch path used for reports and full-scan loading; behavior is intentional but affects all consumers of get_sbom_data on stream parse/API failures.

Overview
Fixes CE-362: when the full-scan SBOM stream fetch fails, CI no longer finishes with exit 0 and empty GitLab, license, and SARIF output.

Core.get_sbom_data now logs at error and raises APIFailure when fullscans.stream returns success: false, so the run uses existing API-error handling (exit code 3 by default; --disable-blocking still exits 0) instead of treating the failure as an empty SBOM.

The socketdev floor moves from 3.4.2 (from 3.3.0) to pick up stream parsing fixes (e.g. unrecognized purl types like generic and per-artifact resilience).

A regression test test_get_sbom_data_failure_raises asserts the raise behavior.

Reviewed by Cursor Bugbot for commit 77b18a7. Configure here.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Version Check Failed

Please increment...

@lelia lelia changed the title Raise on SBOM fetch failure and require socketdev 3.4.0 (CE-362) Raise on SBOM fetch failure and require socketdev 3.4.0 Aug 5, 2026
@lelia
lelia marked this pull request as ready for review August 5, 2026 20:50
@lelia
lelia requested a review from a team as a code owner August 5, 2026 20:50
@lelia lelia changed the title Raise on SBOM fetch failure and require socketdev 3.4.0 Raise on SBOM fetch failure and require socketdev 3.4.2 Aug 5, 2026
…ts (CE-362)

get_sbom_data returned {} when the full-scan stream fetch failed, so
report generation continued and produced empty GitLab dependency
scanning, license, and SARIF output with exit code 0. Raise APIFailure
instead so the failure goes through the CLI's existing API-error
handling (exit code 3 by default, still exit 0 with
--disable-blocking).

Bump the socketdev floor to 3.4.2, the bundled release that adds the
missing purl types (e.g. "generic") and per-artifact parse resilience
that caused this failure mode. Merge after socketdev 3.4.2 is on PyPI.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lelia
lelia force-pushed the lelia/generic-purl-type-parse-bug branch from 7ff5db0 to 77b18a7 Compare August 5, 2026 20:52
@lelia

lelia commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

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

Reviewed by Cursor Bugbot for commit 77b18a7. Configure here.

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