Validate milestone title for group import
What does this MR do and why?
This MR ensures file-based group imports observe milestone title rules (see Milestone titles should be unique in group hier... (!142857 - merged))
The rules are:
-
for project milestones, uniqueness in ancestors only, rather than the entire namespace, across both group and project milestone titles
-
for group milestones, uniqueness within the hierarchy - ancestors and children only, not across the entire root ancestor namespace
However, this MR only covers group milestones because Importer:Group Export/Import does not import any project resources.
For additional context, in the UI, when a user attempts to create a milestone with an existing title, they will see an error message and the milestone will not be created:
Before this change however, when importing a group via file-based import, existing group milestones with duplicate names would have their group_id updated to the new destination resource id, thereby "moving" from their original group to the newly imported group.
How to set up and validate locally
Before
- On
master, create a group, create a milestone for the group titled "17.0", create a subgroup, create a milestone for the subgroup titled "18.0", create a project in the subgroup, create a milestone for the project titled "19.0" - Open each milestones list page for the group, subgroup, and project for later reference.
- Export the group `settings > general > advanced > export group
- Once ready, download the export file
- Navigate to the group home page
- Create a new subgroup
- Select the "You can also import an existing group." option neat the top of the form
- Import the group with the "Import group from file" option, using the downloaded export file
- Once the import finishes, visit the milestones list page for the group, subgroup, and project and refresh each page.
- Observe the milestones for the group and subgroup are no longer visible.
- Visit the corresponding imported group and imported subgroup milestone list pages
- Observe the milestones now appear on these pages
After
- Check out to the
588256-validate-milestone-title - Repeat steps 1 to 9 above.
- Observe the milestones for the group and subgroup are still visible.
- Visit the corresponding imported group and imported subgroup milestone list pages
- Observe the milestones do not appear on these pages
References
Screenshots or screen recordings
| original milestones | imported milestones |
|---|---|
|
|
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #588256 (closed)


