Skip to content

Keep what a PR ignore leaves on each alert - #138

Draft
Atakan Solak (mapleleafu) wants to merge 1 commit into
mainfrom
atakan/web-2599-action-after-pr-ignore
Draft

Atakan Solak (mapleleafu) wants to merge 1 commit into
mainfrom
atakan/web-2599-action-after-pr-ignore

Conversation

@mapleleafu

@mapleleafu Atakan Solak (mapleleafu) commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

LLM Description written by Claude Code:claude-opus-5-5

Explainer video, covering all three PRs: watch. Walkthrough: https://claude.ai/artifact/77ujJq9pxYd8DMjthjB3Y6

SocketAlert gains actionAfterPullRequestIgnore: the action an alert keeps when a pull request comment ignores its package (error, warn or monitor), or None when the ignore removes it. When Dedupe merges sightings of one alert on the full-scan stream, it keeps the strictest value.

Why?

For orgs on the new Policies, the API now sends this key on GET diff-scans/{id}, GET full-scans/diff and GET full-scans/{id} (SocketDev/depscan#32287). The Python CLI needs it to stop an @SocketSecurity ignore from passing a Block the org's policy keeps. Today SocketAlert.from_dict drops undeclared keys, so the CLI never sees it.

For orgs not on the new Policies the API sends no key, and the field is None.

Public Changelog

N/A


Refs WEB-2599

Details
  • The field is last in the dataclass, so positional construction is unchanged. There is no to_dict override: parents serialize with asdict, so the key appears as None when absent (noted in the changelog).
  • Dedupe copies the key from the first sighting that has it. On a merge it keeps the higher Dedupe.action_rank; an absent or unknown value ranks lowest.
  • The version goes to 3.7.0, which socket-python-cli's change pins.
  • Tests: test_socket_alert_action_after_pull_request_ignore.py (raw JSON through DiffArtifacts.from_dict), test_dedupe.py (merge order) and test_full_scan_cached_polling_http.py (stream fixture). 211 unit tests pass.
  • Released CLIs 2.15.7 and 2.2.43 run with this build against the new server, with the same results as before.

The API now sends actionAfterPullRequestIgnore on alerts for orgs on
the new Policies: the action an alert keeps when a pull request
comment ignores its package, or no key when the ignore removes it.
SocketAlert drops keys it doesn't declare, and the stream dedupe
merges sightings, so the Python CLI never saw it.

SocketAlert gains the field (None when absent). When Dedupe merges
sightings of one alert, it keeps the strictest value.

Refs WEB-2599

Assisted-by: Claude Code:claude-opus-5-5
@cursor

cursor Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Additive SDK field and dedupe merge logic with broad test coverage; behavior unchanged when the API omits the key.

Overview
3.7.0 adds SocketAlert.actionAfterPullRequestIgnore, surfacing the API field that says whether a PR/MR package ignore leaves the alert as error, warn, or monitor, or removes it when absent/None (orgs on new Socket Policies).

SocketAlert.from_dict / serialization now round-trip the field on diff and full-scan payloads (DiffArtifacts, typed alerts). Dedupe copies it when consolidating alerts and, on merge across release sightings, keeps the strictest post-ignore action (same ranking as action); missing values rank lowest and are omitted from raw deduped dicts when never present.

Unit tests cover diff parsing, stream dedupe merge behavior, and HTTP stream fixtures.

Reviewed by Cursor Bugbot for commit 15d5192. Configure here.

@mapleleafu

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 15d5192. Configure here.

This branch has not been deployed

No deployments
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.

1 participant