Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-11-04 18:22:36 +0300
committerDouwe Maan <douwe@gitlab.com>2016-11-04 18:22:36 +0300
commitd12e764744e3be11c7ed886fb454e09a4d1f57d6 (patch)
tree66b12fe2442f6ac35597b066b5e32489fc1ff3e9 /lib/api
parent5368b9f249485e254a90fe7daa551d61412bee26 (diff)
parent065ba130585cbce5a2835def94a650d26493abb0 (diff)
Merge branch '20968-add-setting-to-check-unresolved-discussion' into 'master'
Add setting to only allow merge requests to be merged when all discussions are resolved _Originally opened at !6385 by @rodolfoasantos._ - - - ## What does this MR do? Based on #20968 this merge request adds setting only to allow merge requests to be merged when all discussions are resolved. ## Are there points in the code the reviewer needs to double check? Check if there are other points to add the resolved discussion setting ## Why was this MR needed? Add the possibility to configure the project to only accept merge request when all discussions are resolved ## Screenshots ![only_allow_merge_if_all_discussions_are_resolved](/uploads/9388db9421da0214590ffab6fb29f985/only_allow_merge_if_all_discussions_are_resolved.png) ![only_allow_merge_if_all_discussions_are_resolved_msg](/uploads/b1bba0c72ad67d3a1b34718baa08526e/only_allow_merge_if_all_discussions_are_resolved_msg.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [x] API support added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #20968 See merge request !7125
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/entities.rb1
-rw-r--r--lib/api/projects.rb9
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb
index 1f378ba1635..01e31f6f7d1 100644
--- a/lib/api/entities.rb
+++ b/lib/api/entities.rb
@@ -100,6 +100,7 @@ module API
end
expose :only_allow_merge_if_build_succeeds
expose :request_access_enabled
+ expose :only_allow_merge_if_all_discussions_are_resolved
end
class Member < UserBasic
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index da16e24d7ea..6b856128c2e 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -139,7 +139,8 @@ module API
:shared_runners_enabled,
:snippets_enabled,
:visibility_level,
- :wiki_enabled]
+ :wiki_enabled,
+ :only_allow_merge_if_all_discussions_are_resolved]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(current_user, attrs).execute
if @project.saved?
@@ -193,7 +194,8 @@ module API
:shared_runners_enabled,
:snippets_enabled,
:visibility_level,
- :wiki_enabled]
+ :wiki_enabled,
+ :only_allow_merge_if_all_discussions_are_resolved]
attrs = map_public_to_visibility_level(attrs)
@project = ::Projects::CreateService.new(user, attrs).execute
if @project.saved?
@@ -275,7 +277,8 @@ module API
:shared_runners_enabled,
:snippets_enabled,
:visibility_level,
- :wiki_enabled]
+ :wiki_enabled,
+ :only_allow_merge_if_all_discussions_are_resolved]
attrs = map_public_to_visibility_level(attrs)
authorize_admin_project
authorize! :rename_project, user_project if attrs[:name].present?