Commit 453e7e1
feat: add native GitLab MR review integration (#622)
* feat: add native GitLab MR review integration (#618)
Adds `altimate-code gitlab review <mr-url>` CLI command that fetches MR
diffs and posts AI review comments back to GitLab merge requests.
- Parses GitLab MR URLs (any instance, nested groups, self-hosted)
- Fetches MR metadata, diffs, and existing comments via REST API v4
- Runs AI code review using the existing session/prompt infrastructure
- Posts review results as MR notes with deduplication marker
- Exports discussion API helper for future inline commenting
- Auth via GITLAB_PERSONAL_ACCESS_TOKEN or GITLAB_TOKEN env vars
- Self-hosted instances via GITLAB_INSTANCE_URL or auto-detected from URL
Fixes #618
Co-Authored-By: Vijay Yadav <vjyadav194@gmail.com>
* fix: address CodeRabbit review findings on GitLab MR review
- Replace process.exit(1) with thrown errors so top-level finally
block runs Telemetry.shutdown() on failure (matches github.ts pattern)
- Deduplicate review comments: detect existing marker note and update
via PUT instead of always creating a new one
- Remove duplicate output printing (subscribeSessionEvents already
renders the completed assistant message)
- Fix GITLAB_INSTANCE_URL env var precedence: env now overrides the
URL parsed from the MR link, enabling self-hosted proxy/mirror use
- Remove unused postMRDiscussion/DiscussionPosition dead code; add
updateMRNote helper used by the dedup logic
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address second round of CodeRabbit findings
- Add 30s timeout to gitlabApi fetch via AbortController to prevent
indefinite hangs on network stalls
- Paginate MR notes (loop pages of 100) so dedup marker detection
works on active MRs with >100 notes
- Fix ternary precedence in tool title rendering — part.state.title
was being ignored due to || binding with the ternary condition
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: anandgupta42 <93243293+anandgupta42@users.noreply.github.com>1 parent 06c4c84 commit 453e7e1
File tree
3 files changed
+570
-0
lines changed- packages/opencode
- src
- cli/cmd
- test/cli
3 files changed
+570
-0
lines changed
0 commit comments