Skip to content

feat(python-cli-parity): fall back to scanned PR base ancestors - #1829

Open
John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
jdalton/surf-2221-match-python-cli-scan-comparison-and-gate
Open

John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
jdalton/surf-2221-match-python-cli-scan-comparison-and-gate

Conversation

@jdalton

@jdalton John-David Dalton (jdalton) commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

The Socket Python CLI uses the nearest scanned first-parent ancestor when the exact PR base commit has no persisted scan.

This PR brings that bounded fallback to socket ci, keeping exact base scans first and reporting when no scanned ancestor is available.

@cursor

cursor Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes how CI chooses the comparison baseline and can widen PR diffs when the base commit was never scanned; behavior is bounded but affects gate/comparison outcomes.

Overview
PR baseline selection for socket ci now matches the Python CLI: it still prefers an exact scan for the PR base SHA, but if none exists it walks up to 100 first-parent commits via git rev-list and picks the nearest ancestor with a persisted scan, logging that the comparison diff is wider than the PR base.

The previous single-page lookup (perPage: 1) is replaced with paginated full-scan listing (100 results/page, capped at 100 pages) for both the exact-commit search and ancestor matching. Baselines ignore temporary or invalid scans (tmp, missing id/commit_hash), and pagination fails closed when nextPage does not advance or the page limit is hit.

Tests cover ancestor fallback, unusable scans, API errors during ancestor lookup, and stuck pagination.

Reviewed by Cursor Bugbot for commit 95becc5. 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.

Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can 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 95becc5. Configure here.

@jdalton
John-David Dalton (jdalton) enabled stacked auto-merge (squash) December 4, 2026 05:55
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2221-match-python-cli-scan-comparison-and-gate branch from 95becc5 to 84dd94a Compare December 4, 2026 05:56
@jdalton John-David Dalton (jdalton) changed the title feat(python-cli-parity): use nearest scanned PR base feat(python-cli-parity): fall back to scanned PR base ancestors Dec 4, 2026
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2221-match-python-cli-scan-comparison-and-gate branch from 84dd94a to 073769a Compare December 4, 2026 14:38
@jdalton
John-David Dalton (jdalton) force-pushed the jdalton/surf-2221-match-python-cli-scan-comparison-and-gate branch from 073769a to 546f8ae Compare December 4, 2026 17:34

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