Commit graph

8 commits

Author SHA1 Message Date
Toon Claes
35081a77b0 Make Delete Merged Branches handle wildcard protected branches correctly
The "Delete Merged Branches" button should filter out protected
branches matching the wildcard patterns.

Closes gitlab-org/gitlab-ce#35592.
2017-08-02 14:45:54 +02:00
Yorick Peterse
6ef87a2083
Merge issuable "reopened" state into "opened"
Having two states that essentially mean the same thing is very much like
having a boolean "true" and boolean "mostly-true": it's rather silly.
This commit merges the "reopened" state into the "opened" state while
taking care of system notes still showing messages along the lines of
"Alice reopened this issue".

A big benefit from having only two states (opened and closed) is that
indexing and querying becomes simpler and more performant. For example,
to get all the opened queries we no longer have to query both states:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state IN ('opened', 'reopened');

Instead we can query a single state directly, which can be much faster:

    SELECT *
    FROM issues
    WHERE project_id = 2
    AND state = 'opened';

Further, only having two states makes indexing easier as we will only
ever filter (and thus scan an index) using a single value. Partial
indexes could help but aren't supported on MySQL, complicating the
development process and not being helpful for MySQL.
2017-07-28 13:31:51 +02:00
Rémy Coutable
ddccd24c13 Remove superfluous lib: true, type: redis, service: true, models: true, services: true, no_db: true, api: true
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-07-27 14:31:53 +02:00
Toon Claes
e0f106ae97 DeleteMergedBranchesService should not delete protected branches
When deleting all the branches that are merged, the protected branches
should not be deleted.
2017-07-04 12:14:40 +02:00
Sam Rose
1ebd9dad8e Add confirm delete protected branch modal 2017-05-08 07:41:58 +00:00
Stan Hu
11fd2f80b0 Don't delete a branch involved in an open merge request in "Delete all merged branches" service
Customers were surprised by the previous behavior, which destroyed branches
even though an open merge request existed for it.

Closes #29427
2017-04-19 07:56:08 -07:00
Robert Speicher
ca9a79f620 Use :empty_project where possible in service specs 2017-03-27 20:44:09 -04:00
Toon Claes
1afab9eb79 Add button to delete all merged branches
It adds a button to the branches page that the user can use to delete
all the branches that are already merged. This can be used to clean up
all the branches that were forgotten to delete while merging MRs.

Fixes #21076.
2016-11-09 21:04:03 +01:00