Skip to content

Add "Delete orphan branches" action

What does this MR do and why?

This implements the "Delete orphan branches" action.

Described in #434365 (closed), linked to #357095

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

(UI Changes are required)

Before After
image
image
image

How to set up and validate locally

  1. Start GitLab
  2. Create a new project (with main branch)
  3. Create a new branch: this-is-an-mr-branch
  4. Create a new branch: this-is-an-orphan-branch
  5. Create a merge request from this-is-an-mr-branch to `main
  6. Navigate to the branches list
  7. Select "Delete orphan branches" in the dropdown menu
  8. Write delete
  9. Click "Delete orphan branches"
  10. (observe the notice)
  11. Wait a bit
  12. Observe the this-is-an-orphan-branch deletion

Tasks left

  • Fix UI (why isn't all of this VueJS ?)
  • Fix typo "Plese" vs "Please"
  • Implement test: DOES NOT Delete branches that are MR sources
  • Implement test: DOES NOT Delete branches that are MR targets
  • Implement test: DOES NOT Delete branches that are protected
  • Bug: It looks like the service is not deleting anything. Did it start ? Is the branches list correct ?

Implementation questions

  • Should there be 2 different component for the modals ? Currently there are a lot of "if-toggle", but they both share some text and logic
  • Should "delete_merged_branches" and "delete_orphan_branches" queues be unified inside a single "delete_bulk" ?
  • Should "DELETE merged_branches" and "DELETE orphan_branches" be unified ? I'm not sure as this would change the public API
  • Wording: Should we clarify the difference between the 2 actions ?

Note: Gitpod is awesome!

Edited by homer

Merge request reports