opencode-gitlab-plugin 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +13 -12
- package/dist/index.js +87 -2
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.cjs +88 -3
- package/dist/mcp-server.cjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [2.8.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.7.0...v2.8.0) (2026-09-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ✨ Features
|
|
9
|
+
|
|
10
|
+
* **merge-requests:** support target_project_id for cross-project MRs ([e03a3b4](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/e03a3b436e2ad7ef3540fee1ee380a6ef5b03b09))
|
|
11
|
+
|
|
12
|
+
## [2.7.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.6.1...v2.7.0) (2026-08-17)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### ✨ Features
|
|
16
|
+
|
|
17
|
+
* **merge-requests:** add gitlab_override_requested_changes tool ([50e17d6](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/50e17d6119c1373bec8c131b01114206f9486793))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 🐛 Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **ci:** regenerate lockfile and reformat with Node 25.2.1 prettier ([58629e2](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/58629e2e4e82b33422ecc69d64c903dc55ec101e))
|
|
23
|
+
|
|
5
24
|
## [2.6.1](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.6.0...v2.6.1) (2026-08-17)
|
|
6
25
|
|
|
7
26
|
|
package/README.md
CHANGED
|
@@ -343,18 +343,19 @@ Or for API tokens:
|
|
|
343
343
|
|
|
344
344
|
The plugin provides **64 tools** organized into the following categories:
|
|
345
345
|
|
|
346
|
-
### Merge Request Tools (
|
|
347
|
-
|
|
348
|
-
| Tool
|
|
349
|
-
|
|
|
350
|
-
| `gitlab_get_merge_request`
|
|
351
|
-
| `gitlab_list_merge_requests`
|
|
352
|
-
| `gitlab_create_merge_request`
|
|
353
|
-
| `gitlab_update_merge_request`
|
|
354
|
-
| `gitlab_get_mr_changes`
|
|
355
|
-
| `gitlab_get_mr_details`
|
|
356
|
-
| `gitlab_list_merge_request_diffs`
|
|
357
|
-
| `gitlab_set_mr_auto_merge`
|
|
346
|
+
### Merge Request Tools (9 tools)
|
|
347
|
+
|
|
348
|
+
| Tool | Description |
|
|
349
|
+
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
|
|
350
|
+
| `gitlab_get_merge_request` | Get details of a specific merge request with title, description, state, author, assignees, reviewers, labels, and diff stats |
|
|
351
|
+
| `gitlab_list_merge_requests` | List merge requests with filtering by state, scope, and labels |
|
|
352
|
+
| `gitlab_create_merge_request` | Create a new merge request (supports target_project_id for fork-to-upstream MRs) |
|
|
353
|
+
| `gitlab_update_merge_request` | Update merge request title, description, state, assignees, reviewers, and labels |
|
|
354
|
+
| `gitlab_get_mr_changes` | Get file changes/diffs for a merge request |
|
|
355
|
+
| `gitlab_get_mr_details` | Get additional MR details (commits or pipelines) with detail_type parameter |
|
|
356
|
+
| `gitlab_list_merge_request_diffs` | List file diffs with pagination support for large changesets |
|
|
357
|
+
| `gitlab_set_mr_auto_merge` | Enable auto-merge (MWPS) using GraphQL API when pipeline succeeds |
|
|
358
|
+
| `gitlab_override_requested_changes` | Bypass a "requested changes" merge block (the widget's Bypass button) by setting the override_requested_changes flag |
|
|
358
359
|
|
|
359
360
|
### Issue Tools (3 tools)
|
|
360
361
|
|
package/dist/index.js
CHANGED
|
@@ -324,6 +324,29 @@ var SET_AUTO_MERGE_MUTATION = `
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
`;
|
|
327
|
+
var OVERRIDE_REQUESTED_CHANGES_MUTATION = `
|
|
328
|
+
mutation overrideRequestedChanges(
|
|
329
|
+
$projectPath: ID!
|
|
330
|
+
$iid: String!
|
|
331
|
+
$override: Boolean
|
|
332
|
+
) {
|
|
333
|
+
mergeRequestUpdate(
|
|
334
|
+
input: {
|
|
335
|
+
projectPath: $projectPath
|
|
336
|
+
iid: $iid
|
|
337
|
+
overrideRequestedChanges: $override
|
|
338
|
+
}
|
|
339
|
+
) {
|
|
340
|
+
mergeRequest {
|
|
341
|
+
id
|
|
342
|
+
iid
|
|
343
|
+
title
|
|
344
|
+
detailedMergeStatus
|
|
345
|
+
}
|
|
346
|
+
errors
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
`;
|
|
327
350
|
var RESOLVE_DISCUSSION_MUTATION = `
|
|
328
351
|
mutation resolveDiscussion($discussionId: DiscussionID!, $resolve: Boolean!) {
|
|
329
352
|
discussionToggleResolve(input: { id: $discussionId, resolve: $resolve }) {
|
|
@@ -606,6 +629,41 @@ var MergeRequestsClient = class _MergeRequestsClient extends GitLabApiClient {
|
|
|
606
629
|
static delay(ms) {
|
|
607
630
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
608
631
|
}
|
|
632
|
+
/**
|
|
633
|
+
* Override (or clear an override of) requested changes on a merge request.
|
|
634
|
+
*
|
|
635
|
+
* When a reviewer formally requests changes, the "Change requests must be
|
|
636
|
+
* approved by the requesting user" merge check blocks the merge. Setting the
|
|
637
|
+
* persistent `override_requested_changes` flag downgrades that check from a
|
|
638
|
+
* blocking failure to a non-blocking warning, which is what the "Bypass"
|
|
639
|
+
* button in the merge request widget does. This is distinct from
|
|
640
|
+
* `mergeRequestDestroyRequestedChanges`, which only clears the calling user's
|
|
641
|
+
* own requested-changes review.
|
|
642
|
+
*
|
|
643
|
+
* Requires permission to merge to the target branch (otherwise GitLab
|
|
644
|
+
* silently ignores the flag).
|
|
645
|
+
*
|
|
646
|
+
* @param projectId Project ID or URL-encoded path
|
|
647
|
+
* @param mrIid Internal ID of the merge request
|
|
648
|
+
* @param override true to bypass requested changes, false to re-enable the block
|
|
649
|
+
* @returns The updated merge request (id, iid, title, detailedMergeStatus)
|
|
650
|
+
*/
|
|
651
|
+
async overrideRequestedChanges(projectId, mrIid, override = true) {
|
|
652
|
+
const result = await this.fetchGraphQL(OVERRIDE_REQUESTED_CHANGES_MUTATION, {
|
|
653
|
+
projectPath: projectId,
|
|
654
|
+
iid: String(mrIid),
|
|
655
|
+
override
|
|
656
|
+
});
|
|
657
|
+
if (result.mergeRequestUpdate.errors.length > 0) {
|
|
658
|
+
throw new Error(
|
|
659
|
+
`Failed to override requested changes: ${result.mergeRequestUpdate.errors.join(", ")}`
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
if (!result.mergeRequestUpdate.mergeRequest) {
|
|
663
|
+
throw new Error("Failed to override requested changes: No merge request returned");
|
|
664
|
+
}
|
|
665
|
+
return result.mergeRequestUpdate.mergeRequest;
|
|
666
|
+
}
|
|
609
667
|
/**
|
|
610
668
|
* Approve a merge request
|
|
611
669
|
* Requires at least Developer role on the project
|
|
@@ -2772,7 +2830,10 @@ Returns the created merge request with all details.`,
|
|
|
2772
2830
|
milestone_id: z.number().optional().describe("The ID of a milestone"),
|
|
2773
2831
|
remove_source_branch: z.boolean().optional().describe("Remove source branch after merge (default: false)"),
|
|
2774
2832
|
squash: z.boolean().optional().describe("Squash commits on merge (default: false)"),
|
|
2775
|
-
allow_collaboration: z.boolean().optional().describe("Allow commits from members who can merge to the target branch")
|
|
2833
|
+
allow_collaboration: z.boolean().optional().describe("Allow commits from members who can merge to the target branch"),
|
|
2834
|
+
target_project_id: z.number().optional().describe(
|
|
2835
|
+
"The ID of the target project for cross-project (fork to upstream) merge requests. Defaults to the source project when omitted."
|
|
2836
|
+
)
|
|
2776
2837
|
},
|
|
2777
2838
|
execute: async (args, _ctx) => {
|
|
2778
2839
|
const client = getGitLabClient();
|
|
@@ -2787,7 +2848,8 @@ Returns the created merge request with all details.`,
|
|
|
2787
2848
|
milestone_id: args.milestone_id,
|
|
2788
2849
|
remove_source_branch: args.remove_source_branch,
|
|
2789
2850
|
squash: args.squash,
|
|
2790
|
-
allow_collaboration: args.allow_collaboration
|
|
2851
|
+
allow_collaboration: args.allow_collaboration,
|
|
2852
|
+
target_project_id: args.target_project_id
|
|
2791
2853
|
});
|
|
2792
2854
|
return JSON.stringify(mr, null, 2);
|
|
2793
2855
|
}
|
|
@@ -2987,6 +3049,29 @@ Always provide sha when you want to ensure you're merging the exact code that wa
|
|
|
2987
3049
|
return JSON.stringify(result, null, 2);
|
|
2988
3050
|
}
|
|
2989
3051
|
}),
|
|
3052
|
+
gitlab_override_requested_changes: tool({
|
|
3053
|
+
description: `Bypass (or re-enable) a "requested changes" merge block on a merge request.
|
|
3054
|
+
|
|
3055
|
+
When a reviewer formally requests changes, the merge check "Change requests must be approved by the requesting user" blocks the merge (detailed_merge_status: requested_changes). This tool sets the persistent override_requested_changes flag, which is exactly what the "Bypass" button in the MR widget does: it downgrades that check from a blocking failure to a non-blocking warning so the MR can be merged.
|
|
3056
|
+
|
|
3057
|
+
Use this when the requesting reviewer is unavailable (e.g. on PTO) and their concerns have been addressed. The acting user must have permission to merge to the target branch, otherwise GitLab silently ignores the flag.
|
|
3058
|
+
|
|
3059
|
+
Note: this is NOT the same as clearing your own requested-changes review. It overrides another user's request. Set override=false to restore the block.`,
|
|
3060
|
+
args: {
|
|
3061
|
+
project_id: z.string().describe("The project ID or URL-encoded path"),
|
|
3062
|
+
mr_iid: z.number().describe("The internal ID of the merge request"),
|
|
3063
|
+
override: z.boolean().optional().describe("true (default) to bypass requested changes, false to restore the block")
|
|
3064
|
+
},
|
|
3065
|
+
execute: async (args, _ctx) => {
|
|
3066
|
+
const client = getGitLabClient();
|
|
3067
|
+
const result = await client.overrideRequestedChanges(
|
|
3068
|
+
args.project_id,
|
|
3069
|
+
args.mr_iid,
|
|
3070
|
+
args.override ?? true
|
|
3071
|
+
);
|
|
3072
|
+
return JSON.stringify(result, null, 2);
|
|
3073
|
+
}
|
|
3074
|
+
}),
|
|
2990
3075
|
gitlab_approve_merge_request: tool({
|
|
2991
3076
|
description: `Approve a merge request.
|
|
2992
3077
|
Adds the current user's approval to the merge request.
|