Skip to content

Create todo when user is mentioned in Task description

What does this MR do and why?

This MR moves the parsing of existing user mentions from before issuable is updated to after issuable is updated, maintaining the logic though.

How

Before this change:
  1. store any user mentions on the issuable we are going to update
  2. do the update
  3. get current the mentions on the issuable
  4. make the diff between 3 and 1 and if there is any additional mentions create todos and fire emails
After this change:
  1. do the update
  2. get previous user mentions from saved changes
  3. get current the mentions on the issuable
  4. make the diff between 3 and 1 and if there is any additional mentions create todos and fire emails

Why

This is needed mainly because of the move we made to use description widget, which sets the description attribute into the work item(issuable) before we get the chance to compute the mentions.

Not sure if there is a way to modify the description widget in some other way to avoid this 🤔

#368198 (closed)

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

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

Edited by Brett Walker

Merge request reports