Skip to content

WIP: Make global milestones editable

Work in Progress — TODO

The first commit is the result of a sprint to get a working implementation that allows users to edit global milestones. The immediate next step is to add test coverage and then polish with a thorough refactor. Below are the areas I will continue working on:

  • Add integration specs to test various cases
    • Proper authorization constraints
    • Editing title, due date, description, and projects
    • Proper removal/addition of projects to global milestones (focused caution on removing a project from a milestone)
  • Add validation/error feedback to edit page (e.g. raise error if all projects are removed during edit)
  • Remove duplication between edit/new forms
    • Revisit using @milestone.for_display for the edit form. Perhaps a method alias would be appropriate.
  • Extract GroupsMilestones#update functionality into its proper service (I'd also like to explore different strategies to best handle removing/adding projects). For now, I've used the "extract method" pattern within the controller to keep #update organized and easier to refactor.
  • Revisit copy on the global milestone edit page
  • Adhere to standard MR requirements

What does this MR do?

Allows global milestones to be editable so that the title, description, due date, and projects may be globally modified.

Key points of interest:

  • Title, description, and due date changes will overwrite any individual changes that may have been made to the global milestone within a project.
  • Projects can be added/removed from a global milestone

Are there points in the code the reviewer needs to double check?

  • Edge cases and authorization
  • Make sure the copy on the global milestone edit page clearly informs the user that changes will overwrite any changes that have been made with a global milestone within a project.

Why was this MR needed?

Will make it simple for users to modify global milestones that have numerous projects. Without this MR, one must edit each project individually to modify a milestone.

For example, users can now edit the description of a global milestone instead of needing to update the milestone description within each project.

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #20543 (closed)

/cc @smcgivern @DouweM

Merge request reports