Add regenerate unique domain regenerate button for GitLab Pages
What does this MR do and why?
TODO: Spec tests / UX wording improvement
This MR features the addition of a button/option to allow users to regenerate a unique domain for their project pages. This can be useful if the current domain is no longer desired or if it needs to be changed for any reason. The feature also includes a confirmation dialogue to prevent accidental domain regeneration.
In this issue, the behaviour was addressed that Google may flag a dangerous site with the old long domains. We may still have these on GitLab.com and there is no option to reset/regenerate them easily.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
- Addresses #481746 (closed)
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
How to set up and validate locally
- Deploy GDK with GitLab Pages + Unique Domain support
- Deploy a project with GitLab Pages.
- Use the Rails console to set a project's unique domain to an old format as shown below.
- Use the UI to regenerate the domain to a shorter value.
For Step 3:
p = Project.find_by(id: X)
p.project_setting.pages_unique_domain = "my-project-group-subgroup-ea14221d9c14a8baaacd211be9d48c6706b39ef134e7f9"
p.save!