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.
@@ -29088,6 +29088,29 @@ var SET_AUTO_MERGE_MUTATION = `
29088
29088
  }
29089
29089
  }
29090
29090
  `;
29091
+ var OVERRIDE_REQUESTED_CHANGES_MUTATION = `
29092
+ mutation overrideRequestedChanges(
29093
+ $projectPath: ID!
29094
+ $iid: String!
29095
+ $override: Boolean
29096
+ ) {
29097
+ mergeRequestUpdate(
29098
+ input: {
29099
+ projectPath: $projectPath
29100
+ iid: $iid
29101
+ overrideRequestedChanges: $override
29102
+ }
29103
+ ) {
29104
+ mergeRequest {
29105
+ id
29106
+ iid
29107
+ title
29108
+ detailedMergeStatus
29109
+ }
29110
+ errors
29111
+ }
29112
+ }
29113
+ `;
29091
29114
  var RESOLVE_DISCUSSION_MUTATION = `
29092
29115
  mutation resolveDiscussion($discussionId: DiscussionID!, $resolve: Boolean!) {
29093
29116
  discussionToggleResolve(input: { id: $discussionId, resolve: $resolve }) {
@@ -29370,6 +29393,41 @@ var MergeRequestsClient = class _MergeRequestsClient extends GitLabApiClient {
29370
29393
  static delay(ms) {
29371
29394
  return new Promise((resolve2) => setTimeout(resolve2, ms));
29372
29395
  }
29396
+ /**
29397
+ * Override (or clear an override of) requested changes on a merge request.
29398
+ *
29399
+ * When a reviewer formally requests changes, the "Change requests must be
29400
+ * approved by the requesting user" merge check blocks the merge. Setting the
29401
+ * persistent `override_requested_changes` flag downgrades that check from a
29402
+ * blocking failure to a non-blocking warning, which is what the "Bypass"
29403
+ * button in the merge request widget does. This is distinct from
29404
+ * `mergeRequestDestroyRequestedChanges`, which only clears the calling user's
29405
+ * own requested-changes review.
29406
+ *
29407
+ * Requires permission to merge to the target branch (otherwise GitLab
29408
+ * silently ignores the flag).
29409
+ *
29410
+ * @param projectId Project ID or URL-encoded path
29411
+ * @param mrIid Internal ID of the merge request
29412
+ * @param override true to bypass requested changes, false to re-enable the block
29413
+ * @returns The updated merge request (id, iid, title, detailedMergeStatus)
29414
+ */
29415
+ async overrideRequestedChanges(projectId, mrIid, override = true) {
29416
+ const result = await this.fetchGraphQL(OVERRIDE_REQUESTED_CHANGES_MUTATION, {
29417
+ projectPath: projectId,
29418
+ iid: String(mrIid),
29419
+ override
29420
+ });
29421
+ if (result.mergeRequestUpdate.errors.length > 0) {
29422
+ throw new Error(
29423
+ `Failed to override requested changes: ${result.mergeRequestUpdate.errors.join(", ")}`
29424
+ );
29425
+ }
29426
+ if (!result.mergeRequestUpdate.mergeRequest) {
29427
+ throw new Error("Failed to override requested changes: No merge request returned");
29428
+ }
29429
+ return result.mergeRequestUpdate.mergeRequest;
29430
+ }
29373
29431
  /**
29374
29432
  * Approve a merge request
29375
29433
  * Requires at least Developer role on the project
@@ -31542,7 +31600,10 @@ Returns the created merge request with all details.`,
31542
31600
  milestone_id: z.number().optional().describe("The ID of a milestone"),
31543
31601
  remove_source_branch: z.boolean().optional().describe("Remove source branch after merge (default: false)"),
31544
31602
  squash: z.boolean().optional().describe("Squash commits on merge (default: false)"),
31545
- allow_collaboration: z.boolean().optional().describe("Allow commits from members who can merge to the target branch")
31603
+ allow_collaboration: z.boolean().optional().describe("Allow commits from members who can merge to the target branch"),
31604
+ target_project_id: z.number().optional().describe(
31605
+ "The ID of the target project for cross-project (fork to upstream) merge requests. Defaults to the source project when omitted."
31606
+ )
31546
31607
  },
31547
31608
  execute: async (args, _ctx) => {
31548
31609
  const client = getGitLabClient();
@@ -31557,7 +31618,8 @@ Returns the created merge request with all details.`,
31557
31618
  milestone_id: args.milestone_id,
31558
31619
  remove_source_branch: args.remove_source_branch,
31559
31620
  squash: args.squash,
31560
- allow_collaboration: args.allow_collaboration
31621
+ allow_collaboration: args.allow_collaboration,
31622
+ target_project_id: args.target_project_id
31561
31623
  });
31562
31624
  return JSON.stringify(mr, null, 2);
31563
31625
  }
@@ -31757,6 +31819,29 @@ Always provide sha when you want to ensure you're merging the exact code that wa
31757
31819
  return JSON.stringify(result, null, 2);
31758
31820
  }
31759
31821
  }),
31822
+ gitlab_override_requested_changes: tool({
31823
+ description: `Bypass (or re-enable) a "requested changes" merge block on a merge request.
31824
+
31825
+ 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.
31826
+
31827
+ 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.
31828
+
31829
+ 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.`,
31830
+ args: {
31831
+ project_id: z.string().describe("The project ID or URL-encoded path"),
31832
+ mr_iid: z.number().describe("The internal ID of the merge request"),
31833
+ override: z.boolean().optional().describe("true (default) to bypass requested changes, false to restore the block")
31834
+ },
31835
+ execute: async (args, _ctx) => {
31836
+ const client = getGitLabClient();
31837
+ const result = await client.overrideRequestedChanges(
31838
+ args.project_id,
31839
+ args.mr_iid,
31840
+ args.override ?? true
31841
+ );
31842
+ return JSON.stringify(result, null, 2);
31843
+ }
31844
+ }),
31760
31845
  gitlab_approve_merge_request: tool({
31761
31846
  description: `Approve a merge request.
31762
31847
  Adds the current user's approval to the merge request.
@@ -34096,7 +34181,7 @@ async function main() {
34096
34181
  ...auditTools,
34097
34182
  ...awardEmojiTools
34098
34183
  };
34099
- const version2 = true ? "2.6.1" : "0.0.0";
34184
+ const version2 = true ? "2.8.0" : "0.0.0";
34100
34185
  const server = new McpServer({ name: "gitlab", version: version2 });
34101
34186
  adaptToolsToMcp(server, allTools);
34102
34187
  const transport = new StdioServerTransport();