Skip to content

Add OTHER category to SocketCategory enum#85

Merged
lelia merged 3 commits into
mainfrom
lelia/ce-225-sdk-add-other-other-to-socketcategory-enum-to-eliminate
Jun 3, 2026
Merged

Add OTHER category to SocketCategory enum#85
lelia merged 3 commits into
mainfrom
lelia/ce-225-sdk-add-other-other-to-socketcategory-enum-to-eliminate

Conversation

@lelia
Copy link
Copy Markdown
Contributor

@lelia lelia commented Jun 2, 2026

Summary

Adds OTHER = "other" to the SocketCategory enum so the backend's "other" alert category is recognized as a first-class value instead of tripping the unknown-category fallback.

Background

The Socket backend returns "other" as a category on some alerts. Since v3.0.33 (065407a, #79) the SDK already tolerates unknown categories via a try/except ValueError fallback in SocketAlert.from_dict — so the original hard crash (ValueError: 'other' is not a valid SocketCategory) is gone. But that path confusingly logs:

Unknown SocketCategory 'other'; falling back to MISCELLANEOUS. Upgrade socketdev to pick up newer categories.

Changes

  • socketdev/fullscans/__init__.py — add OTHER = "other" to SocketCategory. The defensive try/except fallback is retained for any future unknown categories.
  • tests/unit/test_socket_alert_category.py"other" is now a known category, so the fallback/warning regression tests were repointed to a genuinely-unknown value, plus a new test asserting "other"SocketCategory.OTHER.
  • Version bump v3.1.1v3.2.0 (version.py, pyproject.toml) and uv.lock synced (new public enum member = additive/minor).

Testing

python -m unittest tests.unit.test_socket_alert_category — all 6 tests pass.

Follow-up

CLI-side dependency bump (socketdevv3.2.0 in socket-python-cli): draft SocketDev/socket-python-cli#222, blocked on publishing v3.2.0 to PyPI (then uv lock + mark ready).

Fixes: CE-225

⚠️ Note: SocketDev/socket-python-cli#222 will fail until this PR is merged and released as v3.2.0

The Socket backend returns "other" as an alert category. Since v3.0.33
(commit 065407a, #79) the SDK tolerates unknown categories via a
try/except fallback in SocketAlert.from_dict, but that path logs a
warning that confused customers (Anthropic/Buildkite, FINRA/GitLab CI)
into reporting it as a crash.

Add OTHER = "other" so the value is recognized as a first-class category
and the warning no longer fires. The defensive fallback is retained for
any future unknown categories. Bump to 3.2.0 and sync uv.lock.

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
@lelia lelia requested a review from a team as a code owner June 2, 2026 21:20
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

🚀 Preview package published!

Install with:

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

@lelia lelia changed the title feat: add OTHER category to SocketCategory enum (CE-225) Add OTHER category to SocketCategory enum Jun 2, 2026
…other-other-to-socketcategory-enum-to-eliminate

Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>

# Conflicts:
#	pyproject.toml
#	socketdev/version.py
#	uv.lock
@lelia lelia temporarily deployed to socket-firewall June 2, 2026 23:36 — with GitHub Actions Inactive
…other-other-to-socketcategory-enum-to-eliminate
@lelia lelia deployed to socket-firewall June 2, 2026 23:53 — with GitHub Actions Active
@lelia lelia merged commit 8ffef98 into main Jun 3, 2026
11 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.

2 participants