opencode-gitlab-plugin 2.6.1 → 2.7.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 CHANGED
@@ -2,6 +2,18 @@
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.7.0](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.6.1...v2.7.0) (2026-08-17)
6
+
7
+
8
+ ### ✨ Features
9
+
10
+ * **merge-requests:** add gitlab_override_requested_changes tool ([50e17d6](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/50e17d6119c1373bec8c131b01114206f9486793))
11
+
12
+
13
+ ### 🐛 Bug Fixes
14
+
15
+ * **ci:** regenerate lockfile and reformat with Node 25.2.1 prettier ([58629e2](https://gitlab.com/vglafirov/opencode-gitlab-plugin/commit/58629e2e4e82b33422ecc69d64c903dc55ec101e))
16
+
5
17
  ## [2.6.1](https://gitlab.com/vglafirov/opencode-gitlab-plugin/compare/v2.6.0...v2.6.1) (2026-08-17)
6
18
 
7
19
 
package/README.md CHANGED
@@ -345,16 +345,17 @@ The plugin provides **64 tools** organized into the following categories:
345
345
 
346
346
  ### Merge Request Tools (8 tools)
347
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 |
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 |
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 |
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
@@ -2987,6 +3045,29 @@ Always provide sha when you want to ensure you're merging the exact code that wa
2987
3045
  return JSON.stringify(result, null, 2);
2988
3046
  }
2989
3047
  }),
3048
+ gitlab_override_requested_changes: tool({
3049
+ description: `Bypass (or re-enable) a "requested changes" merge block on a merge request.
3050
+
3051
+ 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.
3052
+
3053
+ 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.
3054
+
3055
+ 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.`,
3056
+ args: {
3057
+ project_id: z.string().describe("The project ID or URL-encoded path"),
3058
+ mr_iid: z.number().describe("The internal ID of the merge request"),
3059
+ override: z.boolean().optional().describe("true (default) to bypass requested changes, false to restore the block")
3060
+ },
3061
+ execute: async (args, _ctx) => {
3062
+ const client = getGitLabClient();
3063
+ const result = await client.overrideRequestedChanges(
3064
+ args.project_id,
3065
+ args.mr_iid,
3066
+ args.override ?? true
3067
+ );
3068
+ return JSON.stringify(result, null, 2);
3069
+ }
3070
+ }),
2990
3071
  gitlab_approve_merge_request: tool({
2991
3072
  description: `Approve a merge request.
2992
3073
  Adds the current user's approval to the merge request.