Add OTHER category to SocketCategory enum#85
Merged
lelia merged 3 commits intoJun 3, 2026
Merged
Conversation
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>
|
🚀 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 |
OTHER category to SocketCategory enum
4 tasks
Eric Hibbs (flowstate)
approved these changes
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
…other-other-to-socketcategory-enum-to-eliminate
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
Adds
OTHER = "other"to theSocketCategoryenum 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 atry/except ValueErrorfallback inSocketAlert.from_dict— so the original hard crash (ValueError: 'other' is not a valid SocketCategory) is gone. But that path confusingly logs:Changes
socketdev/fullscans/__init__.py— addOTHER = "other"toSocketCategory. The defensivetry/exceptfallback 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.v3.1.1→v3.2.0(version.py,pyproject.toml) anduv.locksynced (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 (
socketdev→v3.2.0in socket-python-cli): draft SocketDev/socket-python-cli#222, blocked on publishing v3.2.0 to PyPI (thenuv lock+ mark ready).Fixes: CE-225
v3.2.0