Repository navigation
Make @SocketSecurity ignore follow Policies - #482
Atakan Solak (mapleleafu) wants to merge 2 commits into
Conversation
On an organization on the new Socket Policies, an ignore comment may pass only Blocks under a "Developers can skip" rule, and never below a Required rule's minimum. The CLI applied every ignore itself, so a No-exceptions or Required Block passed once someone commented. The API now sends actionAfterPullRequestIgnore on each alert. An ignore keeps an alert with error, lowers a Block with warn to Warn, and drops it otherwise. Comment rows the ignore can't remove carry markers without a package, so neither this CLI nor older ones remove them from a comment-triggered run, and on GitLab such a run sets no commit status while a kept Block is listed. An ignore comment that changes nothing gets no +1. Without the field (every other organization) results, comments, reactions and status are as before. Refs WEB-2599 Assisted-by: Claude Code:claude-opus-5-5
Refs WEB-2599 Assisted-by: Claude Code:claude-opus-5-5
PR SummaryMedium Risk Overview Honored ignore commands now remove only alerts the policy allows to pass. Blocks the policy keeps still fail the run and stay in reports; Blocks lowered to Warn are treated as Warn (and count as a successful ignore for exit code, +1 reactions, and telemetry). Orgs without the field behave like 2.15.8. Security comment rows use Docs and changelog describe the behavior; a large integration test suite and comment goldens lock in backward compatibility and policy-aware paths. Reviewed by Cursor Bugbot for commit 53c5fb2. Configure here. |
|
bugbot run |
There was a problem hiding this comment.
✅ 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 53c5fb2. Configure here.
LLM Description written by Claude Code:claude-opus-5-5
Explainer video, covering all three PRs: watch. Walkthrough: https://claude.ai/artifact/77ujJq9pxYd8DMjthjB3Y6
On an organization on the new Socket Policies,
@SocketSecurity ignoreandignore-allnow remove only the alerts the organization's policy lets an ignore pass. A Block the policy keeps still fails the run, and a Block it lowers to a Required Warn is reported as Warn.Why?
On the new Policies an ignore passes only Blocks under a "Developers can skip" rule, and never below a Required rule's minimum. The CLI applies ignores itself, so today a No-exceptions or Required Block passes as soon as someone comments. The API now says per alert what an ignore leaves (
actionAfterPullRequestIgnore, SocketDev/depscan#32287), and the SDK keeps it (SocketDev/socket-sdk-python#138).Without the field, which is every organization today, results, comments, reactions and commit status are byte-identical to 2.15.8.
Merge order: release socket-sdk-python 3.7.0 first, then run
uv lockhere. Until thenuv lock --lockedand the Docker build fail on this branch.Public Changelog
N/A
Refs WEB-2599
Details
Issue.action_after_pull_request_ignoreis set only when the API sends a non-empty string. Without it an Issue's__dict__, equality and JSON are as before. When an alert is seen more than once, the strictest value wins (Dedupe.action_rank).Comments.remove_alerts:errorkeeps the alert.warnon a Block returns a Warn copy. It counts as ignored: +1, telemetryerror.warnon a Warn keeps it.ignore-alltakes the same path.kept-error,lowered-warnorkept-warnmarkers. They contain no@, so no ignore command in this or an older CLI matches them.kept-errorandkept-warnrows show no ignore line. A cut-off table gets a matching truncation marker per kind, soignore-alldoesn't swap in "no alerts".--enable-commit-statusit posts no status while akept-errororlowered-warnmarker is listed, and the next pipeline run sets it. Under--disable-ignorenothing is read and the status is as today.tests/core/test_action_after_pull_request_ignore.py(71 tests). It drives raw API JSON through the real SDK against a local HTTP stub and runs the realsocketcli.cli(). Goldens intests/data/comments/are rendered by main's code: comments, reactions and telemetry for v1 payloads. 1235 passed.ignore,ignore-alland--strict-blocking, plus the streamed fallback, comment-triggered runs, a v1 control, and released 2.15.7 and 2.2.43. Two checkers: 93 runs plus a second pass.successfrom an empty diff when the security note is missing or for ordinary Block rows. That is as on main, for every org.