Skip to content

feat(python-cli-parity): detect pull requests in GitLab and Azure - #1768

Merged
John-David Dalton (jdalton) merged 1 commit into
refactor/ci-pr-contextfrom
jdalton/surf-2240-ci-pr-context
Nov 25, 2026
Merged

John-David Dalton (jdalton) merged 1 commit into
refactor/ci-pr-contextfrom
jdalton/surf-2240-ci-pr-context

Conversation

@jdalton

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

Copy link
Copy Markdown
Contributor

GitLab and Azure Pipelines users can run socket ci without manually translating their pull-request environment variables. Detection extends the shared provider and baseline context from SocketDev/socket-cli#1771, while preserving GitHub Actions detection.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Isolated CI env-var parsing with additive GitLab/Azure support; GitHub path is refactored but behavior-preserving and covered by existing and new tests.

Overview
Extends socket ci so scans can pick up a pull/merge request number outside GitHub Actions. Detection is centralized in detectCiPullRequestContext, which returns both the PR number and a provider (github, gitlab, or azure).

GitHub behavior is unchanged: the number still comes from GITHUB_REF (refs/pull/<n>/…). GitLab uses CI_MERGE_REQUEST_IID; Azure Pipelines uses SYSTEM_PULLREQUEST_PULLREQUESTNUMBER with a fallback to SYSTEM_PULLREQUEST_PULLREQUESTID. Invalid or zero values yield { number: 0, provider: undefined }.

handle-ci.mts wires the detected number into handleCreateNewScan via pullRequest, and detectCiPullRequestNumber remains a thin wrapper over the new helper. Unit tests cover all three providers plus malformed env values; .gitignore is updated so the new CI files are tracked.

Reviewed by Cursor Bugbot for commit 27bb633. 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 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 27bb633. Configure here.

@jdalton John-David Dalton (jdalton) changed the title feat(python-cli-parity): detect GitLab and Azure PR context feat(python-cli-parity): detect pull requests in GitLab and Azure Nov 25, 2026
@jdalton
John-David Dalton (jdalton) changed the base branch from v1.x to refactor/ci-pr-context November 25, 2026 22:42
@jdalton
John-David Dalton (jdalton) merged commit a240b76 into refactor/ci-pr-context Nov 25, 2026
9 of 21 checks passed
@jdalton
John-David Dalton (jdalton) deleted the jdalton/surf-2240-ci-pr-context branch November 25, 2026 22:42
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