Skip to content

feat(python-cli-parity): centralize pull request context - #1771

Open
John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
refactor/ci-pr-context
Open

John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
refactor/ci-pr-context

Conversation

@jdalton

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

Copy link
Copy Markdown
Contributor

CI scan setup needs one consistent source for pull-request identity and baseline metadata. This extracts GitHub PR number, base branch, and base commit SHA detection into a shared context used by socket ci, including the event-payload fallback for the base SHA.

Stacked follow-ups: SocketDev/socket-cli#1772 and SocketDev/socket-cli#1766.

@cursor

cursor Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Refactor of CI env parsing with equivalent PR-number behavior for scans; new async file read only runs on GitHub PR workflows when base SHA env is absent.

Overview
Introduces detectCiPullRequestContext as the single place to read GitHub Actions PR metadata: PR number from GITHUB_REF, optional base branch (GITHUB_BASE_REF), and base commit SHA (GITHUB_BASE_SHA, with a fallback that parses GITHUB_EVENT_PATH when the SHA env var is missing).

handle-ci drops the inlined detectCiPullRequestNumber helper and awaits the new detector; behavior for scan creation is unchanged today because only number is still passed through as pullRequest. The expanded fields are positioned for follow-up PRs that will consume baseline metadata.

Tests now target the full CiPullRequestContext shape and restore all relevant GitHub env vars between cases. .gitignore is updated to track the new module.

Reviewed by Cursor Bugbot for commit 6a86193. Configure here.

@jdalton John-David Dalton (jdalton) changed the title refactor(ci): centralize pull request context feat(python-cli-parity): centralize pull request context Nov 25, 2026

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