Skip to content

Increase performance when creating discussion on diff

Douwe Maan requested to merge dm-create-note-return-discussion into master

What does this MR do?

This improves the performance when creating discussion on a diff by returning the newly created discussion. Perviously we would create a discussion and then re-fetch all the discussions and filter for the newly created one. For smaller merge request (with not many discussions) this didn't affect performance, but for larger merge request it was creating an unnecessarily large request for all of the discussions.

Now we just pass return_discussion=true with the request. This then returns JSON with a discussion key that holds the full JSON representation of the the discussion with a single note.

What are the relevant issue numbers?

Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/49002

Does this MR meet the acceptance criteria?

Edited by Phil Hughes

Merge request reports