@@ -117,6 +117,8 @@ public Pager<MergeRequest> getMergeRequests(Integer projectId, MergeRequestState
117
117
/**
118
118
* Get information about a single merge request.
119
119
*
120
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
121
+ *
120
122
* GET /projects/:id/merge_requests/:merge_request_id
121
123
*
122
124
* @param projectId the project ID of the merge request
@@ -132,6 +134,8 @@ public MergeRequest getMergeRequest(Integer projectId, Integer mergeRequestIid)
132
134
/**
133
135
* Get a list of merge request commits.
134
136
*
137
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
138
+ *
135
139
* GET /projects/:id/merge_requests/:merge_request_iid/commits
136
140
*
137
141
* @param projectId the project ID for the merge request
@@ -146,6 +150,8 @@ public List<Commit> getCommits(int projectId, int mergeRequestIid) throws GitLab
146
150
/**
147
151
* Get a list of merge request commits.
148
152
*
153
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
154
+ *
149
155
* GET /projects/:id/merge_requests/:merge_request_iid/commits
150
156
*
151
157
* @param projectId the project ID for the merge request
@@ -164,6 +170,8 @@ public List<Commit> getCommits(int projectId, int mergeRequestIid, int page, int
164
170
/**
165
171
* Get a Pager of merge request commits.
166
172
*
173
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
174
+ *
167
175
* GET /projects/:id/merge_requests/:merge_request_iid/commits
168
176
*
169
177
* @param projectId the project ID for the merge request
@@ -212,6 +220,8 @@ public MergeRequest createMergeRequest(Integer projectId, String sourceBranch, S
212
220
/**
213
221
* Updates an existing merge request. You can change branches, title, or even close the MR.
214
222
*
223
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
224
+ *
215
225
* PUT /projects/:id/merge_requests/:merge_request_iid
216
226
*
217
227
* @param projectId the ID of a project
@@ -254,6 +264,8 @@ public MergeRequest updateMergeRequest(Integer projectId, Integer mergeRequestIi
254
264
/**
255
265
* Updates an existing merge request. You can change branches, title, or even close the MR.
256
266
*
267
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
268
+ *
257
269
* PUT /projects/:id/merge_requests/:merge_request_iid
258
270
*
259
271
* @param projectId the ID of a project
@@ -293,6 +305,8 @@ public MergeRequest updateMergeRequest(Integer projectId, Integer mergeRequestIi
293
305
/**
294
306
* Only for admins and project owners. Soft deletes the specified merge.
295
307
*
308
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
309
+ *
296
310
* DELETE /projects/:id/merge_requests/:merge_request_iid
297
311
*
298
312
* @param projectId the ID of a project
@@ -321,6 +335,8 @@ public void deleteMergeRequest(Integer projectId, Integer mergeRequestIid) throw
321
335
* a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't
322
336
* have permissions to accept this merge request, you'll get a 401.
323
337
*
338
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
339
+ *
324
340
* PUT /projects/:id/merge_requests/:merge_request_iid/merge
325
341
*
326
342
* @param projectId the ID of a project
@@ -340,6 +356,9 @@ public MergeRequest acceptMergeRequest(Integer projectId, Integer mergeRequestIi
340
356
* a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't
341
357
* have permissions to accept this merge request, you'll get a 401.
342
358
*
359
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request. Additionally,
360
+ * mergeWhenPipelineSucceeds sets the merge_when_build_succeeds flag for GitLab API V3.</p>
361
+ *
343
362
* PUT /projects/:id/merge_requests/:merge_request_iid/merge
344
363
*
345
364
* @param projectId the ID of a project
@@ -365,6 +384,9 @@ public MergeRequest acceptMergeRequest(Integer projectId, Integer mergeRequestIi
365
384
* a 409 and the error message 'SHA does not match HEAD of source branch'. If you don't
366
385
* have permissions to accept this merge request, you'll get a 401.
367
386
*
387
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request. Additionally,
388
+ * mergeWhenPipelineSucceeds sets the merge_when_build_succeeds flag for GitLab API V3.</p>
389
+ *
368
390
* PUT /projects/:id/merge_requests/:merge_request_iid/merge
369
391
*
370
392
* @param projectId the ID of a project
@@ -391,7 +413,9 @@ public MergeRequest acceptMergeRequest(Integer projectId, Integer mergeRequestIi
391
413
Form formData = new GitLabApiForm ()
392
414
.withParam ("merge_commit_message" , mergeCommitMessage )
393
415
.withParam ("should_remove_source_branch" , shouldRemoveSourceBranch )
394
- .withParam ("merge_when_pipeline_succeeds" , mergeWhenPipelineSucceeds )
416
+ .withParam ((isApiVersion (ApiVersion .V3 ) ?
417
+ "merge_when_build_succeeds" : "merge_when_pipeline_succeeds" ),
418
+ mergeWhenPipelineSucceeds )
395
419
.withParam ("sha" , sha );
396
420
397
421
Response response = put (Response .Status .OK , formData .asMap (), "projects" , projectId , "merge_requests" , mergeRequestIid , "merge" );
@@ -404,6 +428,8 @@ public MergeRequest acceptMergeRequest(Integer projectId, Integer mergeRequestIi
404
428
* error message 'Method Not Allowed'. In case the merge request is not set to be merged when the
405
429
* pipeline succeeds, you'll also get a 406 error.
406
430
*
431
+ * <p>NOTE: GitLab API V4 uses IID (internal ID), V3 uses ID to identify the merge request.</p>
432
+ *
407
433
* PUT /projects/:id/merge_requests/:merge_request_iid/cancel_merge_when_pipeline_succeeds
408
434
*
409
435
* @param projectId the ID of a project
0 commit comments