Skip to content

Change "in_reply_to_discussion_id" to integer

What does this MR do and why?

From Change "in_reply_to_discussion_id" to integer (#421232 - closed), the "in_reply_to_discussion_id" parameter for "Create Draft Note" is an Integer, but merge request discussion's ID is String, so creating a reply draft note was impossible. This MR changes the type of in_reply_to_discussion_id from integer to string.

How to set up and validate locally

Gather the following:

  • your custom user token in the GDK
  • a merge request with a comment on it
  • the ID of that merge request
  • the project ID of that merge request
  • the ID of the discussion you want to reply to

Then, in a terminal, type: curl --header "PRIVATE-TOKEN: $GITLAB_LOCAL_TOKEN" "https://gdk.test:3443/api/v4/projects/[Project id]/merge_requests/[MR id]/draft_notes?note=[example note here]&in_reply_to_discussion_id=[ID of a discussion in the MR]"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Diff

diff --git a/app/models/merge_request_service.rb b/app/models/merge_request_service.rb
index 1551090..0212685 100644
--- a/app/models/merge_request_service.rb
+++ b/app/models/merge_request_service.rb
@@ -13,7 +13,7 @@ def draft_note_params
         requires :id,                        type: String,  desc: "The ID of a project."
         requires :merge_request_iid,         type: Integer, desc: "The ID of a merge request."
         requires :note,                      type: String,  desc: 'The content of a note.'
-        optional :in_reply_to_discussion_id, type: Integer, desc: 'The ID of a discussion the draft note replies to.'
+        optional :in_reply_to_discussion_id, type: String,  desc: 'The ID of a discussion the draft note replies to.'
         optional :commit_id,                 type: String,  desc: 'The sha of a commit to associate the draft note to.'
         optional :resolve_discussion,        type: Boolean, desc: 'The associated discussion should be resolved.'
         use :positional

This description was generated for revision 4eca214c using AI

Edited by Gary Holtz

Merge request reports

Loading