Disable merging a WIP Pull request (#4529)

* prevent pull request to be merged when PR is a WIP

* add tests

* add helper to prepend WIP: in PR title

* move default wip prefixes into settings

* use configurable WIP prefixes in javascript and default to first one in templates

* add documentation

* add unit test on pull model

Signed-off-by: Julien Tant <julien@craftyx.fr>
This commit is contained in:
Julien Tant 2018-08-13 21:04:39 +02:00 committed by Lauris BH
parent 52c2cb15db
commit 7781e8cef2
16 changed files with 218 additions and 5 deletions

View file

@ -842,6 +842,8 @@ pulls.tab_files = Files Changed
pulls.reopen_to_merge = Please reopen this pull request to perform a merge.
pulls.merged = Merged
pulls.has_merged = The pull request has been merged.
pulls.title_wip_desc = `<a href="#">Start the title with <strong>%s</strong></a> to prevent the pull request from being merged accidentally.`
pulls.cannot_merge_work_in_progress = This pull request is marked as a work in progress. Remove the <strong>%s</strong> prefix from the title when it's ready
pulls.data_broken = This pull request is broken due to missing fork information.
pulls.is_checking = "Merge conflict checking is in progress. Try again in few moments."
pulls.can_auto_merge_desc = This pull request can be merged automatically.
@ -849,6 +851,7 @@ pulls.cannot_auto_merge_desc = This pull request cannot be merged automatically
pulls.cannot_auto_merge_helper = Merge manually to resolve the conflicts.
pulls.no_merge_desc = This pull request cannot be merged because all repository merge options are disabled.
pulls.no_merge_helper = Enable merge options in the repository settings or merge the pull request manually.
pulls.no_merge_wip = This pull request can not be merged because it is marked as being a work in progress.
pulls.merge_pull_request = Merge Pull Request
pulls.rebase_merge_pull_request = Rebase and Merge
pulls.squash_merge_pull_request = Squash and Merge