Skip to content

Update PR comments after alert has been triaged#43

Draft
bergenhem wants to merge 16 commits intomainfrom
carl/update-pr-comments-with-triaged-alerts
Draft

Update PR comments after alert has been triaged#43
bergenhem wants to merge 16 commits intomainfrom
carl/update-pr-comments-with-triaged-alerts

Conversation

@bergenhem
Copy link

Summary

This PR adds the ability for Socket Basics to update an existing Socket Basics PR comment after alerts have been triaged in the Socket dashboard.

The problem

When a user triages any Socket Basics alert in the Socket Dashboard the PR(s) that include a Socket Basics comment including the alerts are not updated (even when the Socket Basics workflow is re-run).

This means as a developer working in a repository where Socket is adding comments I will not be updated if the discovered issue has been triaged to ignore.

Fixes CE-81

bergenhem and others added 16 commits February 25, 2026 09:58
Fetch triage entries from Socket API after scan submission, remove
alerts with ignore/monitor state from results, regenerate connector
notifications with filtered components, and inject a triage count
summary into GitHub PR comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Log an info-level message instead of an error traceback when the
Socket API token lacks triage permissions, and skip filtering so
the scan completes normally with all findings intact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Always replace results['notifications'] after triage filtering so
pre-filter content is never forwarded to notifiers. Skip PR comment
API calls when content is unchanged. Add info-level logging for
triaged/remaining finding counts and connector regeneration details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The triage API returns opaque alert_key hashes, not human-readable
identifiers. This rewrites the matching logic to stream the full scan
via sdk.fullscans.stream(), cross-reference Socket alert keys against
triage entries, and map back to local components by artifact ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetch triage entries from Socket API after scan submission, remove
alerts with ignore/monitor state from results, regenerate connector
notifications with filtered components, and inject a triage count
summary into GitHub PR comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Log an info-level message instead of an error traceback when the
Socket API token lacks triage permissions, and skip filtering so
the scan completes normally with all findings intact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Always replace results['notifications'] after triage filtering so
pre-filter content is never forwarded to notifiers. Skip PR comment
API calls when content is unchanged. Add info-level logging for
triaged/remaining finding counts and connector regeneration details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The triage API returns opaque alert_key hashes, not human-readable
identifiers. This rewrites the matching logic to stream the full scan
via sdk.fullscans.stream(), cross-reference Socket alert keys against
triage entries, and map back to local components by artifact ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fetch triage entries from Socket API after scan submission, remove
alerts with ignore/monitor state from results, regenerate connector
notifications with filtered components, and inject a triage count
summary into GitHub PR comments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Log an info-level message instead of an error traceback when the
Socket API token lacks triage permissions, and skip filtering so
the scan completes normally with all findings intact.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Always replace results['notifications'] after triage filtering so
pre-filter content is never forwarded to notifiers. Skip PR comment
API calls when content is unchanged. Add info-level logging for
triaged/remaining finding counts and connector regeneration details.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The triage API returns opaque alert_key hashes, not human-readable
identifiers. This rewrites the matching logic to stream the full scan
via sdk.fullscans.stream(), cross-reference Socket alert keys against
triage entries, and map back to local components by artifact ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The CreateFullScanREsponse object is used here and `id` and `html_url` are actually nested in the `data` field, not on the root of the object. `html_url` should also be `html_report_url`
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