Skip to content

Commit 92290c5

Browse files
committed
NotesApi: fix createMergeRequestNote() API breakage introduced in 5.8.0
Even when the new `created_at` and `internal` arguments are marked as "optional", that doesn't mean one can simply omit them from argument list. This means `createMergeRequestNote()`'s function signature has been changed, which is a breaking change which happens without major version bump. So add a wrapper function with the old signature that calls the new signature, which restores compatibility to un-migrated code. IMO this change is not needed for 6.x.x line, as that can be seen as major update and API breakage is fine that way. Although, I'll admit that with 5.8.0 released over a year ago, I'm not sure if this still matters anymore... Fixes: 60259a6 ("Add attributes "created_at", "internal" for NotesApi commits and DiscussionApi merge requests (gitlab4j#1194)")
1 parent 89aeda9 commit 92290c5

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/main/java/org/gitlab4j/api/NotesApi.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,22 @@ public Note createMergeRequestNote(
524524
return (response.readEntity(Note.class));
525525
}
526526

527+
/**
528+
* Create a merge request's note.
529+
*
530+
* <pre><code>GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/notes/:note_id</code></pre>
531+
*
532+
* @param projectIdOrPath the project in the form of an Long(ID), String(path), or Project instance
533+
* @param mergeRequestIid the merge request IID to create the notes for
534+
* @param body the content of note
535+
* @return the created Note instance
536+
* @throws GitLabApiException if any exception occurs
537+
*/
538+
public Note createMergeRequestNote(Object projectIdOrPath, Long mergeRequestIid, String body)
539+
throws GitLabApiException {
540+
return createMergeRequestNote(projectIdOrPath, mergeRequestIid, body, null, false);
541+
}
542+
527543
/**
528544
* Update the specified merge request's note.
529545
*

0 commit comments

Comments
 (0)