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.
@@ -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
@@ -31757,6 +31815,29 @@ Always provide sha when you want to ensure you're merging the exact code that wa
31757
31815
  return JSON.stringify(result, null, 2);
31758
31816
  }
31759
31817
  }),
31818
+ gitlab_override_requested_changes: tool({
31819
+ description: `Bypass (or re-enable) a "requested changes" merge block on a merge request.
31820
+
31821
+ 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.
31822
+
31823
+ 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.
31824
+
31825
+ 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.`,
31826
+ args: {
31827
+ project_id: z.string().describe("The project ID or URL-encoded path"),
31828
+ mr_iid: z.number().describe("The internal ID of the merge request"),
31829
+ override: z.boolean().optional().describe("true (default) to bypass requested changes, false to restore the block")
31830
+ },
31831
+ execute: async (args, _ctx) => {
31832
+ const client = getGitLabClient();
31833
+ const result = await client.overrideRequestedChanges(
31834
+ args.project_id,
31835
+ args.mr_iid,
31836
+ args.override ?? true
31837
+ );
31838
+ return JSON.stringify(result, null, 2);
31839
+ }
31840
+ }),
31760
31841
  gitlab_approve_merge_request: tool({
31761
31842
  description: `Approve a merge request.
31762
31843
  Adds the current user's approval to the merge request.
@@ -34096,7 +34177,7 @@ async function main() {
34096
34177
  ...auditTools,
34097
34178
  ...awardEmojiTools
34098
34179
  };
34099
- const version2 = true ? "2.6.1" : "0.0.0";
34180
+ const version2 = true ? "2.7.0" : "0.0.0";
34100
34181
  const server = new McpServer({ name: "gitlab", version: version2 });
34101
34182
  adaptToolsToMcp(server, allTools);
34102
34183
  const transport = new StdioServerTransport();