Skip to content

feat(python-cli-parity): publish GitLab merge request notes - #1810

Open
John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
feat/gitlab-mr-notes
Open

John-David Dalton (jdalton) wants to merge 1 commit into
v1.xfrom
feat/gitlab-mr-notes

Conversation

@jdalton

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

Copy link
Copy Markdown
Contributor

The Socket Python CLI posts notes on GitLab merge requests so reviewers can see package changes and security risks. This PR adds those notes to socket ci. Set SOCKET_CLI_ENABLE_GITLAB_MR_NOTES=true to turn them on. When the job runs again, it updates its notes.

@cursor

cursor Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
New CI path writes to GitLab MRs using long-lived tokens and validates URLs/origins; misconfiguration could leak tokens in fork pipelines or post to the wrong project.

Overview
Adds opt-in GitLab merge request notes to socket ci when SOCKET_CLI_ENABLE_GITLAB_MR_NOTES=true, mirroring the existing GitHub overview and security comments. After a diff scan, handle-ci calls the new publishGitLabMergeRequestNotes, which fetches rendered content from the Socket API (via shared fetchRenderedPullRequestComments) and upserts tagged notes on the target project MR—including fork MRs—using a new gitlab.mts helper (PRIVATE-TOKEN, pagination, origin checks, no CI_JOB_TOKEN for writes).

apiFetch gains rejectRedirects for safer GitLab API calls. Docs in ci.md describe env vars, token requirements, and duplicate-note avoidance. Vitest coverage exercises create/update/clear, pagination, auth errors, and per-note disable flags.

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

Comment thread src/commands/ci/handle-ci.mts Resolved
@jdalton John-David Dalton (jdalton) changed the title feat(ci): publish GitLab merge request notes feat(python-cli-parity): publish GitLab merge request notes Dec 2, 2026
@jdalton
John-David Dalton (jdalton) enabled stacked auto-merge (squash) December 2, 2026 18:50
@jdalton
John-David Dalton (jdalton) force-pushed the feat/gitlab-mr-notes branch 5 times, most recently from 8258a1d to 23b6272 Compare December 3, 2026 16:53

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