Update same project URL references in issues & MRs during GitLab Migration
What does this MR do and why?
This MR updates same project URL references in issues & MRs during GitLab Migration.
For example, if an issue or MR has a url to another issue/MR of the same project (e.g. http://gdk.test/my/project/-/issues/1
) and then this project is migrated to a new destination, the url would still remain http://gdk.test/my/project/-/issues/1
leading to either an old project on the same gitlab instance, or old gitlab instance entirely.
This MR adds a new step of the project migration, looping through each MR, issue & all of their notes in order to get all 'matching url' and update them to point to a newly imported project URLs.
The updating flow is the following:
- For each mr, issue & notes of the imported project
- Check if body includes old (source) project full path e.g.
source/full/path
- If it does, extract all urls from html body
- Skip a url if old host does not match url host
- Skip a url if a url's path does not start with project full path e.g.
source/full/path
- Update a matched url with a new gitlab host as well as new project full path
before | after |
---|---|
Mentions #267947 (closed)
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
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.
-
I have evaluated the MR acceptance checklist for this MR.