Skip to content

Add backticks to username mentions

Carla Drago requested to merge 477097-handle-mentions into master

What does this MR do and why?

This change surrounds username mentions in relevant description and note fields of entities imported with direct transfer using the updated user mapping feature. It wraps these mentions in backticks, so that they appear as code-formatted text in the UI.

It adds a new module, Import::UsernameMentionRewriter which updates @username mentions in text fields, handling already code-formatted text blocks, e.g. "Some example @text" or "Some example @text" remain unchanged.

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
issue-before issue-after
issue2-before issue2-after

How to set up and validate locally

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

  1. check out the branch, gdk restart
  2. enter the rails console gdk rails c and turn the feature flag on Feature.enable(:importer_user_mapping)
  3. create a group with members and a project with issues, MRs milestones that have @ username mentions in the descriptions and notes.
  4. initiate an direct transfer import of this group
  5. after importing examin the imported issues, mrs, milestones etc for @ username mentions wrapped in backticks.

Related to #477097 (closed)

Edited by Carla Drago

Merge request reports

Loading