Make discussions API work with quick actions-only notes

What does this MR do and why?

This is a follow-up to !173055 (merged).

Previously quick actions were not handled properly in the commits and discussions API for the following API routes:

  • POST /projects/:id/<noteable>/<noteable_id>/discussions/:discussion_id/notes
  • PUT /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id

For example:

  • POST /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes
  • PUT /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id
  • POST /projects/:id/repository/commits/:commit_id/discussions/:discussion_id/notes
  • PUT /projects/:id/repository/commits/:commit_id/discussions/:discussion_id/notes/:note_id

Users would see a 400 Bad Request even if the quick action were initiated. This commit changes that to respond with a 202 upon success.

References

Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.

Relates to #505100 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

See the steps in !173055 (merged).

Edited by Stan Hu

Merge request reports

Loading