Skip to content

Draft: Add quick action to add thread when opening issuables

Sarah Yasonik requested to merge sy-add-discussion-quick-action into master

What does this MR do and why?

Related issues: #390661, #235345

Adds a /discussion <comment> quick action to add comment threads when creating issues/epics/merge requests. The primary use-case for this is in templates, so threads can be automatically created without user intervention.

Why is this only available during issuable creation?
  1. If the issuable already exists, users can just comment/add a thread directly.
  2. I don't want to figure out the best way to protect against cyclical comments (/discussion /discussion /discussion /discussion).
  3. I don't want to decide on the best approach for using /discussion in comments on existing threads.
Why doesn't this match the designs in #390661 exactly?
  1. &9447 got deprioritized as a whole, so I'm not really implementing that issue directly here. But this MR won't contradict anything described in #390661 & this MR would unblock that work if it ever does get prioritized again.
    • So then why am I even working on this? Sometimes brains are tricky and you just open MRs. Whoops, I guess?
  2. The ~"<comment>" formatting/syntax isn't actually needed to post a single-line comment.
  3. I didn't want to deal with expanding the command-identifying regex to allow for multiline comments.

Screenshots or screen recordings

Happy path: issues

Command search Sample usage Preview message Posted issue
Screenshot_2023-03-29_at_6.25.11_PM Screenshot_2023-03-29_at_6.25.29_PM Screenshot_2023-03-29_at_6.25.38_PM Screenshot_2023-03-29_at_6.26.51_PM

Unhappy path: comments

Empty command search Lack of preview message Error message on save & no comment from command-only note
Screenshot_2023-03-29_at_6.27.48_PM Screenshot_2023-03-29_at_6.27.56_PM Screenshot_2023-03-29_at_6.28.09_PM

How to set up and validate locally

  1. Go through flow to create an issue, MR, or epic in any project/group
  2. Include /discussion whatever comment in your description
  3. Save!
  4. See the beauty.

MR acceptance checklist

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

Merge request reports

Loading