Raise failure on SBOM fetch errors - #288
Open
lelia wants to merge 12 commits into
Open
Conversation
lelia
marked this pull request as ready for review
August 5, 2026 20:50
socketdev 3.4.2
…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
force-pushed
the
lelia/generic-purl-type-parse-bug
branch
from
August 5, 2026 20:52
7ff5db0 to
77b18a7
Compare
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ 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.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ailure The e2e-reachability job intermittently fails with 'no components with alerts in .socket.facts.json': the tier-1 reachability backend can return empty results while the CLI reports success (ENG-5093), and the same flake has hit unrelated PRs. - Add a retry-probe hook to the e2e matrix: entries that define it get up to 3 scan attempts, retrying only when the probe says the output looks incomplete. Persistent failures still fail via the validate step. Each retry emits a warning annotation and a step-summary line so flake frequency stays visible. - Add tests/e2e/reach-facts-probe.sh: exits 0 when the facts file has alerted components, non-zero (retry) when empty or missing. - Upload /tmp/e2e-output.log, SARIF/GitLab outputs, and facts files as artifacts when any e2e job fails, so flakes are diagnosable without a re-run. Also bump version to 2.6.2 (2.6.0 and 2.6.1 are being released ahead of this PR). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…Dev/socket-python-cli into lelia/generic-purl-type-parse-bug
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ 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 d0c5648. Configure here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
socketdev 3.4.2socketdev 3.5.0
… in the changelog Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
The e2e retry hardening ships with the dependency pinning PR instead, so its changelog entry moves there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
…pe-parse-bug # Conflicts: # .github/workflows/e2e-test.yml # CHANGELOG.md # pyproject.toml # socketsecurity/__init__.py # uv.lock
…Dev/socket-python-cli into lelia/generic-purl-type-parse-bug # Conflicts: # CHANGELOG.md
socketdev 3.5.0
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ 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 f9a4831. Configure here.
Douglas (dacoburn)
approved these changes
Aug 6, 2026
…pe-parse-bug # Conflicts: # CHANGELOG.md # pyproject.toml # socketsecurity/__init__.py # uv.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When the full-scan SBOM stream fetch failed,
Core.get_sbom_datalogged 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. That parse fix shipped insocketdev3.4.2 and is covered by thesocketdev==3.5.0pin already onmain; this PR fixes the CLI-side failure handling.Changes
Core.get_sbom_datanow logs at error level and raisesAPIFailurewhen the stream fetch fails, so the run goes through the existing API-error handling (exit code 3 by default;--disable-blockingstill exits 0) instead of emitting empty reportsTesting
test_get_sbom_data_failure_raisespytest tests/unit tests/coreagainst socketdev 3.5.0: 421 passed, 2 skipped (pre-existing)Core.get_sbom_data, a stream containing agenericartifact flowing through package processing with alerts intact, and the failure path raising instead of writing empty reportsFixes CE-362
Refs CE-360
Note
Low Risk
Narrow change to error handling on an already-failed SBOM fetch; success paths unchanged and behavior improves CI signal by avoiding silent empty reports.
Overview
SBOM stream failures now fail the run instead of writing empty reports. When
Core.get_sbom_datagetssuccess: falsefrom the full-scan stream API, it logs at error and raisesAPIFailureinstead of returning{}. Report generation no longer continues with blank GitLab dependency-scanning, license, and SARIF output and exit code 0; the failure follows existing CLI API-error handling (default exit 3,--disable-blockingstill exits 0).Release 2.6.2 updates version metadata and changelog. A regression test asserts the raise path. The changelog notes the common parse failure (e.g. unrecognized
genericpurls) is addressed insocketdev3.4.2+, already pinned at 3.5.0 on main—this PR is the CLI-side handling fix.Reviewed by Cursor Bugbot for commit f9a4831. Configure here.