Add backticks to username mentions
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 |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- check out the branch,
gdk restart
- enter the rails console
gdk rails c
and turn the feature flag onFeature.enable(:importer_user_mapping)
- create a group with members and a project with issues, MRs milestones that have @ username mentions in the descriptions and notes.
- initiate an direct transfer import of this group
- after importing examin the imported issues, mrs, milestones etc for @ username mentions wrapped in backticks.
Related to #477097 (closed)