feat(ignore): adding event logger for ignored comments#178
Open
feat(ignore): adding event logger for ignored comments#178
Conversation
|
🚀 Preview package published! Install with: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple socketsecurity==2.2.80.dev3Docker image: |
0e20dd0 to
09e3172
Compare
Author
|
bugbot run |
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.
POST /v0/orgs/{slug}/telemetrywhen users suppress alerts via@SocketSecurity ignorePR/MR commentseyesemoji reaction as a dedup marker — only unprocessed comments (withouteyes) trigger events; after sending, theeyesreaction is addedsender_name/sender_id(not the webhook sender or first commenter)reactions.eyesfrom API response) and GitLab (lazyhas_eyes_reaction()API call per comment, best-effortpost_eyes_reaction()via Award Emoji API)artifact_input(raw user text) since the ignore command is user input and may not be a valid PURLartifact_purlfrom actual alert objects (always valid PURLs)get_ignore_options—@socketSecurity ignore(lowercase s) now worksChanges
socketsecurity/core/cli_client.pypost_telemetry_events()— sends events individually toPOST /v0/orgs/{slug}/telemetrysocketsecurity/core/scm/github.pypost_eyes_reaction()— postseyesreaction to mark comments as processedsocketsecurity/core/scm/gitlab.pyhas_eyes_reaction()— best-effort check foreyesaward emoji on MR notespost_eyes_reaction()— best-effort addeyesaward emoji withContent-Type: application/jsonsocketsecurity/core/scm_comments.pyget_ignore_options()case-insensitive (fixes@socketSecurityvs@SocketSecurity)socketsecurity/socketcli.py_is_unprocessed()helper — checks inlinereactions.eyesthen falls back toscm.has_eyes_reaction()Event attributes
{ "event_kind": "user-action", "client_action": "ignore_alerts", "event_id": "<uuid>", "event_sender_created_at": "<iso8601>", "vcs_provider": "github|gitlab", "owner": "<repo_owner>", "repo": "<owner/repo>", "pr_number": 123, "ignore_all": true|false, "sender_name": "<comment_author_login>", "sender_id": "<comment_author_id>", "artifact_input": "<raw_user_text>" (comment flow), "artifact_purl": "<valid_purl>" (push flow) }Public Changelog
N/A