Skip to content

feat(python-cli-parity): post and update GitHub scan comments - #1769

Merged
John-David Dalton (jdalton) merged 1 commit into
jdalton/surf-2230-pr-baselinesfrom
jdalton/surf-2236-github-pr-comments
Dec 1, 2026
Merged

John-David Dalton (jdalton) merged 1 commit into
jdalton/surf-2230-pr-baselinesfrom
jdalton/surf-2236-github-pr-comments

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Python CLI behavior

The Python CLI publishes two pull request comments: a dependency overview and a security findings report. On later runs it finds and updates those comments in place instead of adding duplicates, and each comment can be disabled independently. Python comment handling

What this adds to Socket CLI

This PR adds the same comment workflow to Socket CLI's socket ci. It requests Socket-rendered overview and findings text from the diff-scan comments API, then creates or updates the corresponding GitHub pull request comments. It builds on #1766, so the comments and the CI verdict use the same diff scan.

Set SOCKET_CLI_GITHUB_TOKEN, GITHUB_TOKEN, or GH_TOKEN to a GitHub token with pull request write permission. The Socket API token needs full-scans:list, diff-scans:create, and diff-scans:list. Disable either comment independently with SOCKET_CLI_DISABLE_OVERVIEW_COMMENT=true or SOCKET_CLI_DISABLE_SECURITY_COMMENT=true.

Slides

Read scan results on GitHub. See what Socket found right on the pull request. A new run updates the same comments.

Two comments on the pull request. Scan overview. See if the scan passed and how many alerts it found. Security findings. See which problems Socket found.

What happens on the next run?. Socket finds its old comments and edits them in place. Give Socket access. Use a GitHub token that can write pull request comments. Choose which comments to post. Turn off the overview or the list of findings on its own.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Introduces live GitHub Issues API writes on PRs; behavior is narrow (comment upsert only) and covered by tests, but failed or partial API calls could affect CI feedback on pull requests.

Overview
Adds marker-based GitHub PR comment upserts so CI can post two stable comments—a dependency overview and a security findings list—that update in place on reruns instead of spamming new threads.

A new upsertPullRequestComment helper in github.mts paginates existing PR comments, matches by an HTML comment marker in the body, and either updates or creates the comment. publishPullRequestComments wires this for overview and security bodies with independent disableOverview / disableSecurity flags and skips posting when the body is empty. Render helpers turn a ScanReport into markdown for each comment type. Unit tests cover dual publish, per-type suppression, and the empty-body no-op case.

Reviewed by Cursor Bugbot for commit e01bb4f. Configure here.

@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.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit e01bb4f. Configure here.

Comment thread src/commands/ci/publish-pr-comments.mts Resolved
Comment thread src/commands/ci/publish-pr-comments.mts Resolved
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 2 times, most recently from 7054009 to 7cad8f1 Compare November 25, 2026 19:06
@jdalton
John-David Dalton (jdalton) enabled stacked auto-merge (squash) November 25, 2026 19:30
@jdalton John-David Dalton (jdalton) changed the title feat(python-cli-parity): upsert GitHub PR comments feat(python-cli-parity): post and update GitHub scan comments Nov 25, 2026
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 2 times, most recently from 8957478 to 42ae906 Compare November 30, 2026 16:03
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 1bc2743 to 095891f Compare November 30, 2026 22:10
@jdalton
John-David Dalton (jdalton) changed the base branch from v1.x to jdalton/surf-2230-pr-baselines November 30, 2026 22:10
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 2bb3ac4 to 8ba9f2b Compare November 30, 2026 22:39
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 8ba9f2b to 8828610 Compare November 30, 2026 22:50
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 8828610 to 2464a19 Compare November 30, 2026 23:03
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 2464a19 to c25db1e Compare December 1, 2026 16:28
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 4 times, most recently from fc064b8 to 11741b2 Compare December 1, 2026 17:01
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 2 times, most recently from 28ab256 to a57cc18 Compare December 1, 2026 17:16
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from a57cc18 to 9e543dd Compare December 1, 2026 17:33
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 9e543dd to 7cad8f1 Compare December 1, 2026 17:34
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 2 times, most recently from 9e543dd to 7cad8f1 Compare December 1, 2026 17:37
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch 2 times, most recently from 9e543dd to 181392b Compare December 1, 2026 17:45
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 181392b to 8884829 Compare December 1, 2026 18:04
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 8884829 to 0708403 Compare December 1, 2026 18:51
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2236-github-pr-comments branch from 0708403 to 456b90e Compare December 1, 2026 19:13
@jdalton
John-David Dalton (jdalton) merged commit 549a6d7 into v1.x Dec 1, 2026
10 checks passed
@jdalton
John-David Dalton (jdalton) deleted the jdalton/surf-2236-github-pr-comments branch December 1, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants