Increase performance when creating discussion on diff
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?
-
Changelog entry added, if necessary -
Documentation created/updated -
Tests added for this feature/bug -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides
Edited by Phil Hughes