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
d94ffb92
Commit
d94ffb92
authored
Dec 14, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide behind feature flag
Add reviewer_approval_rules FF
parent
3bf38888
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
2 deletions
+29
-2
app/assets/javascripts/users_select/index.js
app/assets/javascripts/users_select/index.js
+1
-1
app/controllers/projects/merge_requests/creations_controller.rb
...ntrollers/projects/merge_requests/creations_controller.rb
+1
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
config/feature_flags/development/reviewer_approval_rules.yml
config/feature_flags/development/reviewer_approval_rules.yml
+8
-0
ee/spec/features/merge_request/user_edits_multiple_reviewers_mr_spec.rb
...es/merge_request/user_edits_multiple_reviewers_mr_spec.rb
+18
-1
No files found.
app/assets/javascripts/users_select/index.js
View file @
d94ffb92
...
...
@@ -831,7 +831,7 @@ UsersSelect.prototype.renderRowAvatar = function(issuableType, user, img) {
};
UsersSelect
.
prototype
.
renderApprovalRules
=
function
(
elsClassName
,
approvalRules
=
[])
{
if
(
!
elsClassName
?.
includes
(
'
reviewer
'
))
{
if
(
!
gon
.
features
?.
reviewerApprovalRules
||
!
elsClassName
?.
includes
(
'
reviewer
'
))
{
return
''
;
}
const
count
=
approvalRules
.
length
;
...
...
app/controllers/projects/merge_requests/creations_controller.rb
View file @
d94ffb92
...
...
@@ -14,6 +14,7 @@ class Projects::MergeRequests::CreationsController < Projects::MergeRequests::Ap
before_action
do
push_frontend_feature_flag
(
:merge_request_reviewers
,
@project
)
push_frontend_feature_flag
(
:mr_collapsed_approval_rules
,
@project
)
push_frontend_feature_flag
(
:reviewer_approval_rules
,
@project
)
end
def
new
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
d94ffb92
...
...
@@ -53,6 +53,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
push_frontend_feature_flag
(
:vue_issuable_sidebar
,
@project
.
group
)
push_frontend_feature_flag
(
:merge_request_reviewers
,
@project
)
push_frontend_feature_flag
(
:mr_collapsed_approval_rules
,
@project
)
push_frontend_feature_flag
(
:reviewer_approval_rules
,
@project
)
end
around_action
:allow_gitaly_ref_name_caching
,
only:
[
:index
,
:show
,
:discussions
]
...
...
config/feature_flags/development/reviewer_approval_rules.yml
0 → 100644
View file @
d94ffb92
---
name
:
reviewer_approval_rules
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/46738
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/293742
milestone
:
'
13.7'
type
:
development
group
:
group::code review
default_enabled
:
false
ee/spec/features/merge_request/user_edits_multiple_reviewers_mr_spec.rb
View file @
d94ffb92
...
...
@@ -13,7 +13,6 @@ RSpec.describe 'Merge request > User edits MR with multiple reviewers' do
context
'user approval rules'
,
:js
do
let
(
:rule_name
)
{
'some-custom-rule'
}
let
(
:user
)
{
create
(
:admin
)
}
let!
(
:mr_rule
)
{
create
(
:approval_merge_request_rule
,
merge_request:
merge_request
,
users:
[
user
],
name:
rule_name
,
approvals_required:
1
)}
it
'is not shown in assignee dropdown'
do
...
...
@@ -34,4 +33,22 @@ RSpec.describe 'Merge request > User edits MR with multiple reviewers' do
end
end
end
context
'when reviewer_approval_rules feature flag off'
do
let
(
:rule_name
)
{
'some-custom-rule'
}
let!
(
:mr_rule
)
{
create
(
:approval_merge_request_rule
,
merge_request:
merge_request
,
users:
[
user
],
name:
rule_name
,
approvals_required:
1
)}
before
do
stub_feature_flags
(
reviewer_approval_rules:
false
)
end
it
'is not shown in reviewer dropdown'
do
find
(
'.js-reviewer-search'
).
click
wait_for_requests
page
.
within
'.dropdown-menu-reviewer'
do
expect
(
page
).
not_to
have_content
(
rule_name
)
end
end
end
end
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