Imported from Gitlab text should be removed from notes when moving an issue
This is a follow-up to #461490 (closed) where "imported" badges were removed from moved and cloned issues.
We also need to remove the (imported from GitLab) text that is appended to notes when moving and cloning, but it should be added only to notes that were imported:
There's a bit of confusion about where this text is being saved, as it doesn't appear in the note
or note_html
attribute of an imported Note on the DB.
In the MR for the previous issue we originally used a regex to update the note_html
before the copy was executed. Updating the note
attribute with the same regex had no effect.
In that MR @.luke had the following comment:
We'd need to change
note
becausenote_html
is just a cache of the HTML generated from the markdown innote
. If the cache is invalidated,note_html
would be rebuilt from the markdown innote
which unless changed would result in the "imported from" being put into thenote_html
again.Perhaps in this service
note_html
is being copied across and not being regenerated fromnote
when the new note has been created. In that case, we'd need to triggernote_html
be regenerated fromnote
. We could look in methods inCacheMarkdownField
for some clues.