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
3d54b561
Commit
3d54b561
authored
Dec 25, 2020
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF ci_seed_block_run_before_workflow_rules
It is already default enabled
parent
298ebf6f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
3 additions
and
111 deletions
+3
-111
config/feature_flags/development/ci_seed_block_run_before_workflow_rules.yml
...s/development/ci_seed_block_run_before_workflow_rules.yml
+0
-8
lib/gitlab/ci/features.rb
lib/gitlab/ci/features.rb
+0
-4
lib/gitlab/ci/pipeline/chain/seed.rb
lib/gitlab/ci/pipeline/chain/seed.rb
+0
-7
lib/gitlab/ci/pipeline/chain/seed_block.rb
lib/gitlab/ci/pipeline/chain/seed_block.rb
+0
-4
spec/lib/gitlab/ci/pipeline/chain/seed_block_spec.rb
spec/lib/gitlab/ci/pipeline/chain/seed_block_spec.rb
+0
-12
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
+3
-36
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+0
-40
No files found.
config/feature_flags/development/ci_seed_block_run_before_workflow_rules.yml
deleted
100644 → 0
View file @
298ebf6f
---
name
:
ci_seed_block_run_before_workflow_rules
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45674
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/270439
milestone
:
'
13.6'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
lib/gitlab/ci/features.rb
View file @
3d54b561
...
@@ -59,10 +59,6 @@ module Gitlab
...
@@ -59,10 +59,6 @@ module Gitlab
::
Feature
.
enabled?
(
:ci_pipeline_open_merge_requests
,
project
,
default_enabled:
false
)
::
Feature
.
enabled?
(
:ci_pipeline_open_merge_requests
,
project
,
default_enabled:
false
)
end
end
def
self
.
seed_block_run_before_workflow_rules_enabled?
(
project
)
::
Feature
.
enabled?
(
:ci_seed_block_run_before_workflow_rules
,
project
,
default_enabled:
true
)
end
def
self
.
ci_pipeline_editor_page_enabled?
(
project
)
def
self
.
ci_pipeline_editor_page_enabled?
(
project
)
::
Feature
.
enabled?
(
:ci_pipeline_editor_page
,
project
,
default_enabled:
false
)
::
Feature
.
enabled?
(
:ci_pipeline_editor_page
,
project
,
default_enabled:
false
)
end
end
...
...
lib/gitlab/ci/pipeline/chain/seed.rb
View file @
3d54b561
...
@@ -19,13 +19,6 @@ module Gitlab
...
@@ -19,13 +19,6 @@ module Gitlab
# Build to prevent erroring out on ambiguous refs.
# Build to prevent erroring out on ambiguous refs.
pipeline
.
protected
=
@command
.
protected_ref?
pipeline
.
protected
=
@command
.
protected_ref?
unless
::
Gitlab
::
Ci
::
Features
.
seed_block_run_before_workflow_rules_enabled?
(
project
)
##
# Populate pipeline with block argument of CreatePipelineService#execute.
#
@command
.
seeds_block
&
.
call
(
pipeline
)
end
##
##
# Gather all runtime build/stage errors
# Gather all runtime build/stage errors
#
#
...
...
lib/gitlab/ci/pipeline/chain/seed_block.rb
View file @
3d54b561
...
@@ -9,8 +9,6 @@ module Gitlab
...
@@ -9,8 +9,6 @@ module Gitlab
include
Gitlab
::
Utils
::
StrongMemoize
include
Gitlab
::
Utils
::
StrongMemoize
def
perform!
def
perform!
return
unless
::
Gitlab
::
Ci
::
Features
.
seed_block_run_before_workflow_rules_enabled?
(
project
)
##
##
# Populate pipeline with block argument of CreatePipelineService#execute.
# Populate pipeline with block argument of CreatePipelineService#execute.
#
#
...
@@ -20,8 +18,6 @@ module Gitlab
...
@@ -20,8 +18,6 @@ module Gitlab
end
end
def
break?
def
break?
return
false
unless
::
Gitlab
::
Ci
::
Features
.
seed_block_run_before_workflow_rules_enabled?
(
project
)
pipeline
.
errors
.
any?
pipeline
.
errors
.
any?
end
end
end
end
...
...
spec/lib/gitlab/ci/pipeline/chain/seed_block_spec.rb
View file @
3d54b561
...
@@ -51,18 +51,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::SeedBlock do
...
@@ -51,18 +51,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::SeedBlock do
expect
(
pipeline
.
variables
.
size
).
to
eq
(
1
)
expect
(
pipeline
.
variables
.
size
).
to
eq
(
1
)
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'does not execute the block'
do
run_chain
expect
(
pipeline
.
variables
.
size
).
to
eq
(
0
)
end
end
end
end
context
'when the seeds_block tries to save the pipelie'
do
context
'when the seeds_block tries to save the pipelie'
do
...
...
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
View file @
3d54b561
...
@@ -20,6 +20,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -20,6 +20,7 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
describe
'#perform!'
do
describe
'#perform!'
do
before
do
before
do
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
config
))
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
config
))
run_chain
end
end
let
(
:config
)
do
let
(
:config
)
do
...
@@ -36,20 +37,14 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -36,20 +37,14 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
end
it
'allocates next IID'
do
it
'allocates next IID'
do
run_chain
expect
(
pipeline
.
iid
).
to
be_present
expect
(
pipeline
.
iid
).
to
be_present
end
end
it
'ensures ci_ref'
do
it
'ensures ci_ref'
do
run_chain
expect
(
pipeline
.
ci_ref
).
to
be_present
expect
(
pipeline
.
ci_ref
).
to
be_present
end
end
it
'sets the seeds in the command object'
do
it
'sets the seeds in the command object'
do
run_chain
expect
(
command
.
pipeline_seed
).
to
be_a
(
Gitlab
::
Ci
::
Pipeline
::
Seed
::
Pipeline
)
expect
(
command
.
pipeline_seed
).
to
be_a
(
Gitlab
::
Ci
::
Pipeline
::
Seed
::
Pipeline
)
expect
(
command
.
pipeline_seed
.
size
).
to
eq
1
expect
(
command
.
pipeline_seed
.
size
).
to
eq
1
end
end
...
@@ -64,8 +59,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -64,8 +59,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
end
it
'correctly fabricates stages and builds'
do
it
'correctly fabricates stages and builds'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
stages
.
size
).
to
eq
2
expect
(
seed
.
stages
.
size
).
to
eq
2
...
@@ -91,8 +84,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -91,8 +84,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
end
it
'returns pipeline seed with jobs only assigned to master'
do
it
'returns pipeline seed with jobs only assigned to master'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
size
).
to
eq
1
expect
(
seed
.
size
).
to
eq
1
...
@@ -112,8 +103,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -112,8 +103,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
end
it
'returns pipeline seed with jobs only assigned to schedules'
do
it
'returns pipeline seed with jobs only assigned to schedules'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
size
).
to
eq
1
expect
(
seed
.
size
).
to
eq
1
...
@@ -141,8 +130,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -141,8 +130,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
let
(
:pipeline
)
{
build
(
:ci_pipeline
,
project:
project
)
}
let
(
:pipeline
)
{
build
(
:ci_pipeline
,
project:
project
)
}
it
'returns seeds for kubernetes dependent job'
do
it
'returns seeds for kubernetes dependent job'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
size
).
to
eq
2
expect
(
seed
.
size
).
to
eq
2
...
@@ -154,8 +141,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -154,8 +141,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
context
'when kubernetes is not active'
do
context
'when kubernetes is not active'
do
it
'does not return seeds for kubernetes dependent job'
do
it
'does not return seeds for kubernetes dependent job'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
size
).
to
eq
1
expect
(
seed
.
size
).
to
eq
1
...
@@ -173,8 +158,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -173,8 +158,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
end
end
it
'returns stage seeds only when variables expression is truthy'
do
it
'returns stage seeds only when variables expression is truthy'
do
run_chain
seed
=
command
.
pipeline_seed
seed
=
command
.
pipeline_seed
expect
(
seed
.
size
).
to
eq
1
expect
(
seed
.
size
).
to
eq
1
...
@@ -187,25 +170,9 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
...
@@ -187,25 +170,9 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
->
(
pipeline
)
{
pipeline
.
variables
.
build
(
key:
'VAR'
,
value:
'123'
)
}
->
(
pipeline
)
{
pipeline
.
variables
.
build
(
key:
'VAR'
,
value:
'123'
)
}
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is enabled'
do
it
'does not execute the block'
do
it
'does not execute the block'
do
run_chain
expect
(
pipeline
.
variables
.
size
).
to
eq
(
0
)
expect
(
pipeline
.
variables
.
size
).
to
eq
(
0
)
end
end
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'executes the block'
do
run_chain
expect
(
pipeline
.
variables
.
size
).
to
eq
(
1
)
end
end
end
end
end
end
end
spec/services/ci/create_pipeline_service_spec.rb
View file @
3d54b561
...
@@ -2402,16 +2402,6 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -2402,16 +2402,6 @@ RSpec.describe Ci::CreatePipelineService do
expect
(
build_names
).
to
contain_exactly
(
'regular-job'
)
expect
(
build_names
).
to
contain_exactly
(
'regular-job'
)
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'does not a pipeline'
do
expect
(
pipeline
).
not_to
be_persisted
end
end
context
'when a job requires the same variable'
do
context
'when a job requires the same variable'
do
let
(
:config
)
do
let
(
:config
)
do
<<-
EOY
<<-
EOY
...
@@ -2440,16 +2430,6 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -2440,16 +2430,6 @@ RSpec.describe Ci::CreatePipelineService do
expect
(
pipeline
).
to
be_persisted
expect
(
pipeline
).
to
be_persisted
expect
(
build_names
).
to
contain_exactly
(
'build'
,
'test1'
,
'test2'
)
expect
(
build_names
).
to
contain_exactly
(
'build'
,
'test1'
,
'test2'
)
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'does not a pipeline'
do
expect
(
pipeline
).
not_to
be_persisted
end
end
end
end
end
end
...
@@ -2460,16 +2440,6 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -2460,16 +2440,6 @@ RSpec.describe Ci::CreatePipelineService do
expect
(
pipeline
).
not_to
be_persisted
expect
(
pipeline
).
not_to
be_persisted
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'does not create a pipeline'
do
expect
(
pipeline
).
not_to
be_persisted
end
end
context
'when a job requires the same variable'
do
context
'when a job requires the same variable'
do
let
(
:config
)
do
let
(
:config
)
do
<<-
EOY
<<-
EOY
...
@@ -2497,16 +2467,6 @@ RSpec.describe Ci::CreatePipelineService do
...
@@ -2497,16 +2467,6 @@ RSpec.describe Ci::CreatePipelineService do
it
'does not create a pipeline'
do
it
'does not create a pipeline'
do
expect
(
pipeline
).
not_to
be_persisted
expect
(
pipeline
).
not_to
be_persisted
end
end
context
'when FF ci_seed_block_run_before_workflow_rules is disabled'
do
before
do
stub_feature_flags
(
ci_seed_block_run_before_workflow_rules:
false
)
end
it
'does not create a pipeline'
do
expect
(
pipeline
).
not_to
be_persisted
end
end
end
end
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