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
f56b96b8
Commit
f56b96b8
authored
Feb 11, 2020
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Recreate feature flags for merge trains
This commit recreates a feature flag for merge trains
parent
81cf8a7c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
25 additions
and
5 deletions
+25
-5
ee/app/models/ee/project_ci_cd_setting.rb
ee/app/models/ee/project_ci_cd_setting.rb
+8
-2
ee/spec/features/merge_request/user_merges_immediately_spec.rb
...ec/features/merge_request/user_merges_immediately_spec.rb
+1
-0
ee/spec/features/merge_trains/two_merge_requests_on_train_spec.rb
...features/merge_trains/two_merge_requests_on_train_spec.rb
+1
-0
ee/spec/features/merge_trains/user_adds_merge_request_to_merge_train_spec.rb
...rge_trains/user_adds_merge_request_to_merge_train_spec.rb
+1
-0
ee/spec/features/merge_trains/user_adds_to_merge_train_when_pipeline_succeeds_spec.rb
...s/user_adds_to_merge_train_when_pipeline_succeeds_spec.rb
+1
-0
ee/spec/models/project_ci_cd_setting_spec.rb
ee/spec/models/project_ci_cd_setting_spec.rb
+4
-0
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
+2
-1
ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb
...add_to_merge_train_when_pipeline_succeeds_service_spec.rb
+1
-0
ee/spec/services/auto_merge/merge_train_service_spec.rb
ee/spec/services/auto_merge/merge_train_service_spec.rb
+2
-1
ee/spec/services/merge_trains/check_status_service_spec.rb
ee/spec/services/merge_trains/check_status_service_spec.rb
+1
-0
ee/spec/services/merge_trains/create_pipeline_service_spec.rb
...pec/services/merge_trains/create_pipeline_service_spec.rb
+2
-1
ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb
...rvices/merge_trains/refresh_merge_request_service_spec.rb
+1
-0
No files found.
ee/app/models/ee/project_ci_cd_setting.rb
View file @
f56b96b8
...
...
@@ -8,9 +8,15 @@ module EE
project
.
feature_available?
(
:merge_pipelines
)
&&
super
end
##
# The `disable_merge_trains` feature flag is meant to be used for dogfooding
# pipelines for merged results in gitlab-org/gitlab project.
# This feature flag is never meant to be enabled for the entire instance.
# See more context in https://gitlab.com/gitlab-org/gitlab/issues/200037
def
merge_trains_enabled?
merge_pipelines_enabled?
&&
project
.
feature_available?
(
:merge_trains
)
&&
::
Feature
.
enabled?
(
:merge_trains_enabled
,
project
,
default_enabled:
true
)
return
false
if
::
Feature
.
enabled?
(
:disable_merge_trains
,
project
)
merge_pipelines_enabled?
&&
project
.
feature_available?
(
:merge_trains
)
end
def
merge_pipelines_were_disabled?
...
...
ee/spec/features/merge_request/user_merges_immediately_spec.rb
View file @
f56b96b8
...
...
@@ -24,6 +24,7 @@ describe 'Merge requests > User merges immediately', :js do
end
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
ci_yaml
))
...
...
ee/spec/features/merge_trains/two_merge_requests_on_train_spec.rb
View file @
f56b96b8
...
...
@@ -28,6 +28,7 @@ describe 'Two merge requests on a merge train' do
end
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
project
.
add_maintainer
(
maintainer_1
)
project
.
add_maintainer
(
maintainer_2
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
...
...
ee/spec/features/merge_trains/user_adds_merge_request_to_merge_train_spec.rb
View file @
f56b96b8
...
...
@@ -17,6 +17,7 @@ describe 'User adds a merge request to a merge train', :js do
end
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
project
.
add_maintainer
(
user
)
project
.
update!
(
merge_pipelines_enabled:
true
)
...
...
ee/spec/features/merge_trains/user_adds_to_merge_train_when_pipeline_succeeds_spec.rb
View file @
f56b96b8
...
...
@@ -15,6 +15,7 @@ describe 'User adds to merge train when pipeline succeeds', :js do
let
(
:pipeline
)
{
merge_request
.
all_pipelines
.
first
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
project
.
add_maintainer
(
user
)
project
.
update!
(
merge_pipelines_enabled:
true
)
...
...
ee/spec/models/project_ci_cd_setting_spec.rb
View file @
f56b96b8
...
...
@@ -3,6 +3,10 @@
require
'spec_helper'
describe
ProjectCiCdSetting
do
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
end
describe
'#merge_pipelines_enabled?'
do
subject
{
project
.
merge_pipelines_enabled?
}
...
...
ee/spec/serializers/merge_request_poll_widget_entity_spec.rb
View file @
f56b96b8
...
...
@@ -11,6 +11,7 @@ describe MergeRequestPollWidgetEntity do
let
(
:request
)
{
double
(
'request'
,
current_user:
user
)
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
project
.
add_developer
(
user
)
end
...
...
@@ -33,7 +34,7 @@ describe MergeRequestPollWidgetEntity do
context
'when the merge train feature is disabled'
do
before
do
stub_feature_flags
(
merge_trains_enabled:
fals
e
)
stub_feature_flags
(
disable_merge_trains:
tru
e
)
end
it
'does not have merge trains count'
do
...
...
ee/spec/services/auto_merge/add_to_merge_train_when_pipeline_succeeds_service_spec.rb
View file @
f56b96b8
...
...
@@ -16,6 +16,7 @@ describe AutoMerge::AddToMergeTrainWhenPipelineSucceedsService do
let
(
:pipeline
)
{
merge_request
.
reload
.
all_pipelines
.
first
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_trains:
true
,
merge_pipelines:
true
)
project
.
add_maintainer
(
user
)
project
.
update!
(
merge_pipelines_enabled:
true
)
...
...
ee/spec/services/auto_merge/merge_train_service_spec.rb
View file @
f56b96b8
...
...
@@ -20,6 +20,7 @@ describe AutoMerge::MergeTrainService do
allow
(
AutoMergeProcessWorker
).
to
receive
(
:perform_async
)
{
}
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_trains:
true
,
merge_pipelines:
true
)
project
.
update!
(
merge_pipelines_enabled:
true
)
end
...
...
@@ -263,7 +264,7 @@ describe AutoMerge::MergeTrainService do
context
'when merge trains project option is disabled'
do
before
do
stub_feature_flags
(
merge_trains_enabled:
fals
e
)
stub_feature_flags
(
disable_merge_trains:
tru
e
)
end
it
{
is_expected
.
to
be_falsy
}
...
...
ee/spec/services/merge_trains/check_status_service_spec.rb
View file @
f56b96b8
...
...
@@ -9,6 +9,7 @@ describe MergeTrains::CheckStatusService do
let
(
:previous_ref
)
{
'refs/heads/master'
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
project
.
update!
(
merge_pipelines_enabled:
true
)
end
...
...
ee/spec/services/merge_trains/create_pipeline_service_spec.rb
View file @
f56b96b8
...
...
@@ -9,6 +9,7 @@ describe MergeTrains::CreatePipelineService do
let
(
:previous_ref
)
{
'refs/heads/master'
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
project
.
add_maintainer
(
maintainer
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
project
.
update!
(
merge_pipelines_enabled:
true
)
...
...
@@ -35,7 +36,7 @@ describe MergeTrains::CreatePipelineService do
context
'when merge trains option is disabled'
do
before
do
stub_feature_flags
(
merge_trains_enabled:
fals
e
)
stub_feature_flags
(
disable_merge_trains:
tru
e
)
end
it_behaves_like
'returns an error'
do
...
...
ee/spec/services/merge_trains/refresh_merge_request_service_spec.rb
View file @
f56b96b8
...
...
@@ -9,6 +9,7 @@ describe MergeTrains::RefreshMergeRequestService do
let
(
:require_recreate
)
{
false
}
before
do
stub_feature_flags
(
disable_merge_trains:
false
)
project
.
add_maintainer
(
maintainer
)
stub_licensed_features
(
merge_pipelines:
true
,
merge_trains:
true
)
project
.
update!
(
merge_pipelines_enabled:
true
)
...
...
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