Skip to content

feat(python-cli-parity): publish GitLab commit status - #1812

Open
John-David Dalton (jdalton) wants to merge 1 commit into
feat/gitlab-mr-notesfrom
feat/gitlab-commit-status
Open

John-David Dalton (jdalton) wants to merge 1 commit into
feat/gitlab-mr-notesfrom
feat/gitlab-commit-status

Conversation

@jdalton

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

Copy link
Copy Markdown
Contributor

The Socket Python CLI marks the scanned commit in GitLab so reviewers can see if it passed or failed. This PR adds that status and a link to the scan to socket ci. Set SOCKET_CLI_ENABLE_GITLAB_COMMIT_STATUS=true to turn it on.

Builds on #1810.

@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes CI behavior on GitLab by writing commit statuses and optionally altering project merge settings via API; mistakes could mis-report gate status or flip merge policy, though status failures are isolated from scan exit codes.

Overview
Adds opt-in GitLab commit status for socket ci merge request pipelines (SOCKET_CLI_ENABLE_GITLAB_COMMIT_STATUS=true). After the diff scan, the CLI posts a socket-security-commit-status on the pipeline’s CI_PROJECT_ID / CI_COMMIT_SHA with pass/fail, a short description (clean, blocking, incomplete, or scan failure), and an optional link to the diff report. Context handling covers fork MRs, merge trains, and merged-result pipelines; API errors are logged and do not alter the scan exit code. Early failures (e.g. org slug lookup) can still publish a failed status via reportGitLabCommitStatusFailure.

A second opt-in (SOCKET_CLI_ENABLE_GITLAB_MERGE_PIPELINE_CHECK) can set the target project’s only_allow_merge_if_pipeline_succeeds (Maintainer token required), independent of status posting.

The diff-scan path now exposes a shared getDiffScanVerdict (blocking, incomplete, html_url) used by onDiffReport and refactored blocking logic in output-diff-scan. handle-ci wraps the scan in withGitLabCommitStatus and forwards the verdict from onDiffReport. Docs in docs/commands/ci.md describe both env vars and token expectations.

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

@jdalton John-David Dalton (jdalton) changed the title feat(ci): publish GitLab commit status feat(python-cli-parity): publish GitLab commit status Dec 2, 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