Skip to content

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

Open
John-David Dalton (jdalton) wants to merge 1 commit into
jdalton/surf-2230-pr-baselinesfrom
jdalton/surf-2236-github-pr-comments
Open

John-David Dalton (jdalton) wants to merge 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

Summary

GitHub reviewers can see Socket's dependency overview and security findings directly on the pull request. socket ci requests both comments from Socket's diff-scan comments API and updates them on reruns. This builds on #1766 so the comments and the CI verdict use the same diff.

Use a GitHub token with pull request write permission in SOCKET_CLI_GITHUB_TOKEN, GITHUB_TOKEN, or GH_TOKEN. You can turn off each comment independently.

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

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

Development

Successfully merging this pull request may close these issues.

1 participant