Skip to content

Update same project URL references in issues & MRs during GitLab Migration

George Koltsov requested to merge georgekoltsov/update-issue-related-mrs into master

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:

  1. For each mr, issue & notes of the imported project
  2. Check if body includes old (source) project full path e.g. source/full/path
  3. If it does, extract all urls from html body
  4. Skip a url if old host does not match url host
  5. Skip a url if a url's path does not start with project full path e.g. source/full/path
  6. Update a matched url with a new gitlab host as well as new project full path
before after
image image

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.

Edited by George Koltsov

Merge request reports

Loading