Normalize Slack issue severity, and stage the SDK v3.6.0 bump - #331
Draft
lelia wants to merge 1 commit into
Draft
Conversation
Every severity lookup in the Slack reachability formatter is keyed on "medium", but "middle" is what the API sends. A mid-severity finding missed all of them at once: uncounted in the summary, excluded from total_findings so the "and N more" count can go negative, and sorted at the default order of 4 -- below "low" -- so it was truncated out of the message first. Normalized at the point the alert is read rather than by adding a parallel key to each dict, so one canonical spelling flows downstream. The GitLab severity map and the PR comment path already accept both forms; this formatter did not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
socketdev v3.6.0 bump
socketdev v3.6.0 bumpv3.6.0 bump
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.
Draft, because it is staging two things and only one of them can land yet.
Ready now: mid-severity findings were dropped from the Slack summary
Every severity lookup in the Slack reachability formatter is keyed on
medium, butmiddleis what the API sends — it is the value in the OpenAPI spec'sSocketIssueSeverityand in the SDK enum. A mid-severity finding therefore missed all of them at once:severity_countshas nomiddlekey and the increment is guarded byif ... in severity_counts, so the summary always readMedium: 0.total_findings. Sinceomitted_count = total_findings - len(selected_vulnerabilities), a batch of mid-severity findings can drive the "and N more" line negative.low.SEVERITY_ORDER.get(severity, 4)returned the default of 4 againstlow's 3, so mid-severity findings sank to the bottom and were the first truncated at the block limit.The findings themselves were always listed —
purl_groupsdrives that, not the counts — so this is a wrong summary and wrong ordering rather than a missing finding or a false all-clear.Fixed by normalizing to one spelling where the alert is read, rather than adding a parallel
middlekey to four dicts.Messages.map_socket_severity_to_gitlaband the GitLab severity map already accept both forms with a comment callingmiddlethe older format; this formatter never got the same treatment. Worth noting the live spec still listsmiddle, so it is the current value rather than a legacy one.Seven regression tests; five of them fail without the one-line change.
Blocked: the socketdev 3.6.0 bump
Waiting on SocketDev/socket-sdk-python#107 to merge and 3.6.0 to publish. Since the pin is exact,
socketdev==3.6.0cannot land here until the package is actually on PyPI.socketdev==3.5.0→==3.6.0inpyproject.toml, re-runuv lockThat bump needs no other CLI change. Verified by installing the 3.6.0 branch and running this suite: 392 passed, 2 skipped, no failures. The CLI imports none of the SDK's enum types, and every severity lookup already has a default, so the new fallback members cannot reach an unguarded branch. The gain is that ten purl types —
vscode,chrome,edge-extension,firefox-extensionand others — stop being reported asunknown.