Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
09947bed
Commit
09947bed
authored
Mar 29, 2019
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable approval_rules by default
parent
bbcd0747
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
14 additions
and
14 deletions
+14
-14
ee/app/controllers/ee/projects/merge_requests_controller.rb
ee/app/controllers/ee/projects/merge_requests_controller.rb
+2
-2
ee/app/models/concerns/visible_approvable_for_rule.rb
ee/app/models/concerns/visible_approvable_for_rule.rb
+1
-1
ee/app/models/ee/merge_request.rb
ee/app/models/ee/merge_request.rb
+2
-2
ee/app/models/ee/project.rb
ee/app/models/ee/project.rb
+1
-1
ee/app/services/ee/merge_requests/refresh_service.rb
ee/app/services/ee/merge_requests/refresh_service.rb
+1
-1
ee/app/services/ee/merge_requests/update_service.rb
ee/app/services/ee/merge_requests/update_service.rb
+1
-1
ee/app/services/ee/projects/update_service.rb
ee/app/services/ee/projects/update_service.rb
+1
-1
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
...projects/_merge_request_approvals_settings_form.html.haml
+1
-1
ee/app/views/shared/issuable/_approvals.html.haml
ee/app/views/shared/issuable/_approvals.html.haml
+1
-1
ee/lib/api/helpers/approval_helpers.rb
ee/lib/api/helpers/approval_helpers.rb
+1
-1
ee/lib/api/merge_request_approvals.rb
ee/lib/api/merge_request_approvals.rb
+1
-1
ee/lib/api/project_approval_rules.rb
ee/lib/api/project_approval_rules.rb
+1
-1
No files found.
ee/app/controllers/ee/projects/merge_requests_controller.rb
View file @
09947bed
...
...
@@ -9,7 +9,7 @@ module EE
prepended
do
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:approval_rules
,
merge_request
.
project
)
push_frontend_feature_flag
(
:approval_rules
,
merge_request
.
project
,
default_enabled:
true
)
end
before_action
:whitelist_query_limiting_ee_merge
,
only:
[
:merge
]
...
...
@@ -65,7 +65,7 @@ module EE
def
render_approvals_json
respond_to
do
|
format
|
format
.
json
do
entity
=
if
::
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
project
)
entity
=
if
::
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
project
,
default_enabled:
true
)
EE
::
API
::
Entities
::
ApprovalState
.
new
(
merge_request
.
approval_state
,
current_user:
current_user
)
else
EE
::
API
::
Entities
::
MergeRequestApprovals
.
new
(
merge_request
,
current_user:
current_user
)
...
...
ee/app/models/concerns/visible_approvable_for_rule.rb
View file @
09947bed
...
...
@@ -34,6 +34,6 @@ module VisibleApprovableForRule
end
def
approval_rules_disabled?
::
Feature
.
disabled?
(
:approval_rules
,
project
)
::
Feature
.
disabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
end
end
ee/app/models/ee/merge_request.rb
View file @
09947bed
...
...
@@ -65,7 +65,7 @@ module EE
end
def
validate_approval_rule_source
return
if
::
Feature
.
disabled?
(
:approval_rules
,
project
)
return
if
::
Feature
.
disabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
return
unless
approval_rules
.
any?
local_project_rule_ids
=
approval_rules
.
map
{
|
rule
|
rule
.
approval_merge_request_rule_source
&
.
approval_project_rule_id
}
...
...
@@ -84,7 +84,7 @@ module EE
strong_memoize
(
:participant_approvers
)
do
next
[]
unless
approval_needed?
if
::
Feature
.
enabled?
(
:approval_rules
,
project
)
if
::
Feature
.
enabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
approval_state
.
filtered_approvers
(
code_owner:
false
,
unactioned:
true
)
else
approvers
=
[
...
...
ee/app/models/ee/project.rb
View file @
09947bed
...
...
@@ -323,7 +323,7 @@ module EE
end
def
visible_regular_approval_rules
return
approval_rules
.
none
unless
::
Feature
.
enabled?
(
:approval_rules
,
self
)
return
approval_rules
.
none
unless
::
Feature
.
enabled?
(
:approval_rules
,
self
,
default_enabled:
true
)
strong_memoize
(
:visible_regular_approval_rules
)
do
regular_rules
=
approval_rules
.
regular
.
order
(
:id
)
...
...
ee/app/services/ee/merge_requests/refresh_service.rb
View file @
09947bed
...
...
@@ -40,7 +40,7 @@ module EE
def
update_approvers
return
yield
unless
project
.
feature_available?
(
:code_owners
)
if
::
Feature
.
enabled?
(
:approval_rules
,
project
)
if
::
Feature
.
enabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
results
=
yield
merge_requests_for_source_branch
.
each
do
|
merge_request
|
...
...
ee/app/services/ee/merge_requests/update_service.rb
View file @
09947bed
...
...
@@ -52,7 +52,7 @@ module EE
# TODO remove after #1979 is closed
def
sync_approval_rules
(
merge_request
)
return
if
::
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
target_project
)
return
if
::
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
target_project
,
default_enabled:
true
)
return
if
merge_request
.
merged?
return
unless
merge_request
.
previous_changes
.
include?
(
:approvals_before_merge
)
...
...
ee/app/services/ee/projects/update_service.rb
View file @
09947bed
...
...
@@ -72,7 +72,7 @@ module EE
# TODO remove after #1979 is closed
def
sync_approval_rules
return
if
::
Feature
.
enabled?
(
:approval_rules
,
project
)
return
if
::
Feature
.
enabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
return
unless
project
.
previous_changes
.
include?
(
:approvals_before_merge
)
project
.
approval_rules
.
update_all
(
approvals_required:
project
.
approvals_before_merge
)
...
...
ee/app/views/projects/_merge_request_approvals_settings_form.html.haml
View file @
09947bed
-
can_override_approvers
=
project
.
can_override_approvers?
-
if
Feature
.
enabled?
(
:approval_rules
,
project
)
-
if
Feature
.
enabled?
(
:approval_rules
,
project
,
default_enabled:
true
)
=
render
'shared/merge_request_approvals_settings/multiple_rules_form'
,
form:
form
,
project:
project
-
else
=
render
'shared/merge_request_approvals_settings/single_rule_form'
,
form:
form
,
project:
project
...
...
ee/app/views/shared/issuable/_approvals.html.haml
View file @
09947bed
...
...
@@ -11,7 +11,7 @@
=
form
.
label
:approver_ids
,
class:
'col-form-label col-sm-2'
do
Approvers
.col-sm-10
-
if
Feature
.
enabled?
(
:approval_rules
,
@target_project
)
-
if
Feature
.
enabled?
(
:approval_rules
,
@target_project
,
default_enabled:
true
)
=
render
'shared/issuable/approvals_multiple_rule'
,
issuable:
issuable
-
else
=
render
'shared/issuable/approvals_single_rule'
,
issuable:
issuable
,
presenter:
presenter
,
form:
form
...
...
ee/lib/api/helpers/approval_helpers.rb
View file @
09947bed
...
...
@@ -4,7 +4,7 @@ module API
module
Helpers
module
ApprovalHelpers
def
present_approval
(
merge_request
)
if
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
project
)
if
Feature
.
enabled?
(
:approval_rules
,
merge_request
.
project
,
default_enabled:
true
)
present
merge_request
.
approval_state
,
with:
::
EE
::
API
::
Entities
::
ApprovalState
,
current_user:
current_user
else
present
merge_request
.
present
(
current_user:
current_user
),
with:
::
EE
::
API
::
Entities
::
MergeRequestApprovals
,
current_user:
current_user
...
...
ee/lib/api/merge_request_approvals.rb
View file @
09947bed
...
...
@@ -54,7 +54,7 @@ module API
hidden:
true
}
get
'approval_settings'
do
not_found!
unless
::
Feature
.
enabled?
(
:approval_rules
,
user_project
)
not_found!
unless
::
Feature
.
enabled?
(
:approval_rules
,
user_project
,
default_enabled:
true
)
merge_request
=
find_merge_request_with_access
(
params
[
:merge_request_iid
])
...
...
ee/lib/api/project_approval_rules.rb
View file @
09947bed
...
...
@@ -3,7 +3,7 @@
module
API
class
ProjectApprovalRules
<
::
Grape
::
API
before
{
authenticate!
}
before
{
not_found!
unless
::
Feature
.
enabled?
(
:approval_rules
,
user_project
)
}
before
{
not_found!
unless
::
Feature
.
enabled?
(
:approval_rules
,
user_project
,
default_enabled:
true
)
}
ARRAY_COERCION_LAMBDA
=
->
(
val
)
{
val
.
empty?
?
[]
:
Array
.
wrap
(
val
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment