Support Group Milestones to be associated with Project Releases in API
Release notes
Release managers working across multiple projects in GitLab often use Group Milestones to collect related items for a scheduled a release. You may have realized that GitLab Releases could be associated to a Project Milestone before and now you can associate a Group Milestone to a Project Release via the Releases API. This will be a great help to all the Release Managers coordinating their releases with milestones.
Problem to solve
As a breakdown of Support release association to group milestones (Edit release page), we'll need to modify the releases API to allow for submissions that GET
, POST
, UPDATE
, and DELETE
group milestones to be associated with a release. This will probably require creating a new group_milestone
attribute and will likely need to be done after #235387 (closed)
Proposal
Only group milestones that belong to the project's immediate group can be added to the existing milestones
array, milestones belonging to any of the project's ancestor groups cannot be added. There is existing validation in place that ensures there is not a naming clash between project and project's group milestones.
The signature if the of the release API call does not hange, and the groups could be added to the same array, ie:
curl --header 'Content-Type: application/json' --request PUT --data '{"name": "milestone release", "milestones": ["release-milestone-1","subgroup-milestone"]}' --header "PRIVATE-TOKEN: <redacted>" "http://127.0.0.1:3000/api/v4/projects/20/releases/v25" | jq
Where release-milestone-1 is the project milestone, and subgroup-milestone is the group milestone.
Links / references
This is connected to #235387 (closed), where we will make the association in the database.
This is Iteration 1 of #121476 (closed)