Skip to content

Fix group milestone deletion

What does this MR do and why?

Group milestones fail to delete with an internal server error if a merge request is assigned to it.

The MergeRequests::BaseService expects a projects as parameter. The Milestones::DeleteService however passed a group as the project parameter.

That caused a NoMethodError since the @project variable is not being set in the BaseContainerService because the passed container is a group. That resulted in the project attr_accessor returning nil.

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

No UI changes

How to set up and validate locally

  1. Create a group
  2. Create a milestone in the group
  3. Create a project in the group
  4. Create a merge request in the project
  5. Assign the milestone to the merge request
  6. Delete the milestone and verify that it works

Related to #330428 (closed)

Merge request reports

Loading