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
760538a7
Commit
760538a7
authored
Oct 15, 2020
by
Marc Shaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove update_target_approvers feature flag
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/238977
parent
d9cba039
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
22 deletions
+8
-22
ee/app/services/ee/merge_requests/refresh_service.rb
ee/app/services/ee/merge_requests/refresh_service.rb
+1
-5
ee/changelogs/unreleased/remove_update_target_approvers_feature_flag.yml
...nreleased/remove_update_target_approvers_feature_flag.yml
+5
-0
ee/config/feature_flags/development/update_target_approvers.yml
...fig/feature_flags/development/update_target_approvers.yml
+0
-7
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
+2
-10
No files found.
ee/app/services/ee/merge_requests/refresh_service.rb
View file @
760538a7
...
@@ -37,17 +37,13 @@ module EE
...
@@ -37,17 +37,13 @@ module EE
end
end
def
update_approvers_for_target_branch_merge_requests
def
update_approvers_for_target_branch_merge_requests
if
update_target_approvers_features_enabled?
&&
branch_protected?
&&
code_owners_updated?
if
project
.
feature_available?
(
:code_owners
)
&&
branch_protected?
&&
code_owners_updated?
merge_requests_for_target_branch
.
each
do
|
merge_request
|
merge_requests_for_target_branch
.
each
do
|
merge_request
|
::
MergeRequests
::
SyncCodeOwnerApprovalRules
.
new
(
merge_request
).
execute
unless
merge_request
.
on_train?
::
MergeRequests
::
SyncCodeOwnerApprovalRules
.
new
(
merge_request
).
execute
unless
merge_request
.
on_train?
end
end
end
end
end
end
def
update_target_approvers_features_enabled?
::
Feature
.
enabled?
(
:update_target_approvers
,
project
)
&&
project
.
feature_available?
(
:code_owners
)
end
def
branch_protected?
def
branch_protected?
project
.
branch_requires_code_owner_approval?
(
push
.
branch_name
)
project
.
branch_requires_code_owner_approval?
(
push
.
branch_name
)
end
end
...
...
ee/changelogs/unreleased/remove_update_target_approvers_feature_flag.yml
0 → 100644
View file @
760538a7
---
title
:
Update merge requests approvers when code owners is updated
merge_request
:
45290
author
:
type
:
added
ee/config/feature_flags/development/update_target_approvers.yml
deleted
100644 → 0
View file @
d9cba039
---
name
:
update_target_approvers
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38575
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/238977
group
:
group::source code
type
:
development
default_enabled
:
false
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
View file @
760538a7
...
@@ -75,13 +75,11 @@ RSpec.describe MergeRequests::RefreshService do
...
@@ -75,13 +75,11 @@ RSpec.describe MergeRequests::RefreshService do
subject
{
service
.
execute
(
oldrev
,
newrev
,
"refs/heads/master"
)
}
subject
{
service
.
execute
(
oldrev
,
newrev
,
"refs/heads/master"
)
}
let
(
:enable_code_owner
)
{
true
}
let
(
:enable_code_owner
)
{
true
}
let
(
:enable_target_approvers
)
{
true
}
let!
(
:protected_branch
)
{
create
(
:protected_branch
,
name:
'master'
,
project:
project
,
code_owner_approval_required:
true
)
}
let!
(
:protected_branch
)
{
create
(
:protected_branch
,
name:
'master'
,
project:
project
,
code_owner_approval_required:
true
)
}
let
(
:newrev
)
{
TestEnv
::
BRANCH_SHA
[
'with-codeowners'
]
}
let
(
:newrev
)
{
TestEnv
::
BRANCH_SHA
[
'with-codeowners'
]
}
before
do
before
do
stub_feature_flags
(
update_target_approvers:
enable_target_approvers
,
code_owners:
enable_code_owner
)
stub_licensed_features
(
code_owner_approval_required:
true
,
code_owners:
enable_code_owner
)
stub_licensed_features
(
code_owner_approval_required:
true
)
end
end
context
'when the feature flags are enabled'
do
context
'when the feature flags are enabled'
do
...
@@ -133,14 +131,8 @@ RSpec.describe MergeRequests::RefreshService do
...
@@ -133,14 +131,8 @@ RSpec.describe MergeRequests::RefreshService do
end
end
end
end
context
'when update_target_approvers is disabled'
do
let
(
:enable_code_owner
)
{
false
}
it_behaves_like
'does not refresh the code owner rules'
end
context
'when code_owners is disabled'
do
context
'when code_owners is disabled'
do
let
(
:enable_
target_approvers
)
{
false
}
let
(
:enable_
code_owner
)
{
false
}
it_behaves_like
'does not refresh the code owner rules'
it_behaves_like
'does not refresh the code owner rules'
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