Skip to content

feat(python-cli-parity): compare pull request scans with base scans - #1766

Open
John-David Dalton (jdalton) wants to merge 1 commit into
jdalton/surf-2240-ci-pr-context-stackfrom
jdalton/surf-2230-pr-baselines
Open

John-David Dalton (jdalton) wants to merge 1 commit into
jdalton/surf-2240-ci-pr-context-stackfrom
jdalton/surf-2230-pr-baselines

Conversation

@jdalton

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

Copy link
Copy Markdown
Contributor

Summary

See what problems a pull request adds. Socket finds the scan for the commit the change is based on. A commit is a saved version of the code.

  • Socket looks for that commit in the same repo and on the branch the pull request will go into.
  • It uses the Socket diff-scan API to compare that scan with the new one. If a new or changed package has a problem your rules block, the check fails.
  • If Socket has no commit ID or cannot find a matching scan, it stops and says what is missing. If the scan is missing, run one for that commit first.

The Socket API token needs full-scans:list, diff-scans:create, and diff-scans:list for this comparison. This uses the pull request details added in #1772.

Slides

Compare to the right scan. Socket uses the scan for the exact version of the code the pull request is based on.

Which scan does Socket use?. A pull request into main is based on commit A. A newer scan exists for commit B. main at commit A. Socket picks this scan. It matches the saved version the pull request is based on. main at commit B. This scan is newer, but it is for a different saved version of the code.

What the check does. When there is a match. Socket compares the scans. The check fails if a new or changed package has a problem your rules block. When a scan is missing. Socket says which scan it needs. Run a scan for that saved version first.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
New isolated CI helper with tests; no changes to existing CI handlers in this diff.

Overview
Introduces selectBaselineScan and findBaselineScan so CI can pick a baseline full scan by exact commit SHA for a given org, repo, and branch (via fetchOrgFullScanList, newest-first page of up to 100).

Fails closed when the checkout has no commit SHA or when no scan exists for that hash, with messages that tell users to scan the base commit first. Unit tests cover exact-match selection, missing SHA, and missing scan cases. .gitignore is updated so the new files stay tracked.

Reviewed by Cursor Bugbot for commit 78a47bb. Configure here.

@jdalton
John-David Dalton (jdalton) enabled stacked auto-merge (squash) November 25, 2026 18:43

@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 1 potential issue.

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 78a47bb. Configure here.

@jdalton John-David Dalton (jdalton) changed the title feat(ci): select exact PR scan baselines feat(python-cli-parity): select PR scan baselines Nov 25, 2026
@jdalton John-David Dalton (jdalton) changed the title feat(python-cli-parity): select PR scan baselines feat(python-cli-parity): compare PR scans with base scans Nov 25, 2026
@jdalton John-David Dalton (jdalton) changed the title feat(python-cli-parity): compare PR scans with base scans feat(python-cli-parity): compare pull request scans with base scans Nov 25, 2026
@jdalton
John-David Dalton (jdalton) changed the base branch from v1.x to jdalton/surf-2240-ci-pr-context-stack November 25, 2026 22:49

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