Gitlab Review
@webframp/gitlab-reviewv2026.07.18.1
01README
AI-assisted GitLab merge request code review with human approval gate. Uses GraphQL for notes and MR metadata, REST fallback for diff content and approve/unapprove (no CLI dependencies). Designed to pair with @dougschaefer/writing-voice for tone-consistent reviews driven from an agent harness.
Authentication
Requires a GitLab personal access token with api scope, stored in a
swamp vault.
Methods
- get_mr_diff — Fetch MR metadata (GraphQL) and file diffs (REST)
- analyze — Store an AI-generated review draft
- edit_draft — Revise the draft (versioned, retains history)
- update_review — Edit an existing comment via GraphQL updateNote
- approve_mr — Approve the MR without posting a comment (REST)
- unapprove_mr — Remove approval / request changes (REST; idempotent — a never-approved MR is a no-op)
- post_review — Post draft via GraphQL createNote, optionally approve/unapprove
02Release Notes
2026.07.18.1
Added: An upgrades array entry (no-op) to review.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.
2026.07.08.1
Fixed:
unapprove_mrandpost_review action=request_changesare now idempotent. GitLab's unapprove endpoint returns HTTP 404 when the caller has no approval to remove; that is the desired end state for "request changes", not an error. A never-approved MR no longer fails the call — the comment still posts and the MR is left unapproved. Non-404 errors still propagate.
03Models
@webframp/gitlab-reviewv2026.07.18.1gitlab-review/review.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| host | string | GitLab hostname (e.g. gitlab.example.com) |
| token | string | GitLab personal access token |
fn get_mr_diff(project: string, iid: number)
Fetch MR metadata via GraphQL and file diffs via REST (raw diff content not available in GraphQL).
| Argument | Type | Description |
|---|---|---|
| project | string | Project path (e.g. mygroup/myproject) |
| iid | number | Merge request IID |
fn analyze(project: string, iid: number, body: string)
Store an AI-generated review draft for human review before posting.
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
| body | string | Review comment body (markdown) |
fn edit_draft(project: string, iid: number, body: string)
Replace the current review draft body. Creates a new version
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
| body | string | Updated review comment body (markdown) |
fn approve_mr(project: string, iid: number)
Approve a merge request without posting a comment.
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
fn unapprove_mr(project: string, iid: number)
Remove approval from a merge request (request changes).
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
fn update_review(project: string, iid: number, noteId: number)
Edit an existing review comment on a GitLab MR via GraphQL updateNote mutation.
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
| noteId | number | Note ID to update |
fn post_review(project: string, iid: number)
Post the current review draft as a comment via GraphQL createNote,
| Argument | Type | Description |
|---|---|---|
| project | string | Project path |
| iid | number | Merge request IID |
Resources
mrDiff(7d)— MR diff content for review
reviewDraft(7d)— Draft review comment (editable before posting)
reviewPosted(30d)— Record of posted review comment
04Previous Versions
2026.07.08.1
2026.07.08.1
Fixed:
unapprove_mrandpost_review action=request_changesare now idempotent. GitLab's unapprove endpoint returns HTTP 404 when the caller has no approval to remove; that is the desired end state for "request changes", not an error. A never-approved MR no longer fails the call — the comment still posts and the MR is left unapproved. Non-404 errors still propagate.
2026.06.24.1
2026.06.15.1
2026.06.08.1
2026.06.04.2
2026.06.04.1
05Stats
A
100 / 100
Downloads
22
Archive size
13.8 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
06Platforms
07Labels