Skip to content

fix: bump Socket SDK version, handle missing diff scores#193

Merged
lelia merged 3 commits intomainfrom
lelia/sdk-bump-and-null-score-handling
Apr 24, 2026
Merged

fix: bump Socket SDK version, handle missing diff scores#193
lelia merged 3 commits intomainfrom
lelia/sdk-bump-and-null-score-handling

Conversation

@lelia
Copy link
Copy Markdown
Contributor

@lelia lelia commented Apr 24, 2026

Summary

Bump the CLI to socketdev>=3.0.33,<4.0.0 to pick up the SDK fix for unknown alert categories, and harden dependency overview rendering so PR comments no longer crash when diff artifacts have missing or null score data.

Problem

  1. The SDK could crash while deserializing diff alerts when the API returned an unknown category like "other". That is fixed in socketdev 3.0.33, so the CLI needs to consume that release.
  2. The CLI could crash while generating the dependency overview comment when a diff artifact had score / scores set to None. The comment renderer assumed added.scores was always a dict and called .get(...) on it.

Fix

  • bump the CLI dependency to socketdev>=3.0.33,<4.0.0
  • bump CLI version to 2.2.86 to prepare for new release
  • normalize diff artifacts with score=None to an empty score map in the CLI model layer
  • make dependency overview badge rendering tolerate missing, null, or partial score data
  • default missing badge values to a valid 100% fallback instead of producing invalid badge URLs

Test plan

  • uv run --refresh --extra test pytest tests/unit/test_dependency_overview.py tests/core/test_package_and_alerts.py -q

Added regression coverage for:

  • Package.from_diff_artifact(...) normalizing score=None
  • dependency overview comment generation succeeding when package scores are missing or partially null
  • valid fallback badge output for missing scores

Also fixes: SocketDev/socket-sdk-python#78

lelia added 3 commits April 24, 2026 13:11
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia lelia requested a review from a team as a code owner April 24, 2026 17:16
@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 socketsecurity==2.2.86.dev1

Docker image: socketdev/cli:pr-193

@lelia lelia changed the title fix: bump socketdev to 3.0.33 and handle missing diff scores fix: bump Socket SDK version, handle missing diff scores Apr 24, 2026
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpypi/​socketdev@​3.0.32 ⏵ 3.0.3398 +1100100100100

View full report

Copy link
Copy Markdown

@johnsonch Chris Johnson (johnsonch) left a comment

Choose a reason for hiding this comment

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

Thank you for doing this!

Copy link
Copy Markdown
Contributor

@dc-larsen David Larsen (dc-larsen) left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@dc-larsen David Larsen (dc-larsen) left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@dc-larsen David Larsen (dc-larsen) left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@dc-larsen David Larsen (dc-larsen) left a comment

Choose a reason for hiding this comment

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

LGTM

@lelia lelia merged commit 206efe9 into main Apr 24, 2026
15 checks passed
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.

ValueError: 'other' is not a valid SocketCategory when parsing stream_diff response

4 participants