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
3e25217f
Commit
3e25217f
authored
Jun 21, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF ci_workflow_rules_variables
It's been enabled by default for 2 milestones. Changelog: other
parent
bf7b31d8
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
90 deletions
+5
-90
config/feature_flags/development/ci_workflow_rules_variables.yml
...feature_flags/development/ci_workflow_rules_variables.yml
+0
-8
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-28
lib/gitlab/ci/pipeline/chain/seed.rb
lib/gitlab/ci/pipeline/chain/seed.rb
+4
-11
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+0
-2
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
+0
-12
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+0
-13
spec/services/ci/create_pipeline_service/rules_spec.rb
spec/services/ci/create_pipeline_service/rules_spec.rb
+0
-16
No files found.
config/feature_flags/development/ci_workflow_rules_variables.yml
deleted
100644 → 0
View file @
bf7b31d8
---
name
:
ci_workflow_rules_variables
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52085
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/300997
milestone
:
'
13.11'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
doc/ci/yaml/README.md
View file @
3e25217f
...
...
@@ -233,15 +233,7 @@ If your rules match both branch pipelines and merge request pipelines,
#### `workflow:rules:variables`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/294232) in GitLab 13.11.
> - [Deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - [Enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/300997) in GitLab 13.12.
> - Enabled on GitLab.com.
> - Recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-workflowrulesvariables). **(FREE SELF)**
There can be
[
risks when disabling released features
](
../../user/feature_flags.md#risks-when-disabling-released-features
)
.
Refer to this feature's version history for more details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/300997) in GitLab 14.1.
You can use
[
`variables`
](
#variables
)
in
`workflow:rules:`
to define variables for specific pipeline conditions.
...
...
@@ -294,25 +286,6 @@ When the branch is something else:
-
job1's
`DEPLOY_VARIABLE`
is
`job1-default-deploy`
.
-
job2's
`DEPLOY_VARIABLE`
is
`default-deploy`
.
##### Enable or disable workflow:rules:variables **(FREE SELF)**
workflow:rules:variables is under development but ready for production use.
It is deployed behind a feature flag that is
**enabled by default**
.
[
GitLab administrators with access to the GitLab Rails console
](
../../administration/feature_flags.md
)
can opt to disable it.
To enable it:
```
ruby
Feature
.
enable
(
:ci_workflow_rules_variables
)
```
To disable it:
```
ruby
Feature
.
disable
(
:ci_workflow_rules_variables
)
```
#### `workflow:rules` templates
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217732) in GitLab 13.0.
...
...
lib/gitlab/ci/pipeline/chain/seed.rb
View file @
3e25217f
...
...
@@ -10,10 +10,7 @@ module Gitlab
def
perform!
raise
ArgumentError
,
'missing YAML processor result'
unless
@command
.
yaml_processor_result
if
::
Feature
.
enabled?
(
:ci_workflow_rules_variables
,
pipeline
.
project
,
default_enabled: :yaml
)
raise
ArgumentError
,
'missing workflow rules result'
unless
@command
.
workflow_rules_result
end
raise
ArgumentError
,
'missing workflow rules result'
unless
@command
.
workflow_rules_result
# Allocate next IID. This operation must be outside of transactions of pipeline creations.
pipeline
.
ensure_project_iid!
...
...
@@ -51,13 +48,9 @@ module Gitlab
end
def
root_variables
if
::
Feature
.
enabled?
(
:ci_workflow_rules_variables
,
pipeline
.
project
,
default_enabled: :yaml
)
::
Gitlab
::
Ci
::
Variables
::
Helpers
.
merge_variables
(
@command
.
yaml_processor_result
.
root_variables
,
@command
.
workflow_rules_result
.
variables
)
else
@command
.
yaml_processor_result
.
root_variables
end
::
Gitlab
::
Ci
::
Variables
::
Helpers
.
merge_variables
(
@command
.
yaml_processor_result
.
root_variables
,
@command
.
workflow_rules_result
.
variables
)
end
end
end
...
...
lib/gitlab/ci/pipeline/seed/build.rb
View file @
3e25217f
...
...
@@ -213,8 +213,6 @@ module Gitlab
end
def
recalculate_yaml_variables!
return
unless
::
Feature
.
enabled?
(
:ci_workflow_rules_variables
,
@pipeline
.
project
,
default_enabled: :yaml
)
@seed_attributes
[
:yaml_variables
]
=
Gitlab
::
Ci
::
Variables
::
Helpers
.
inherit_yaml_variables
(
from:
@context
.
root_variables
,
to:
@job_variables
,
inheritance:
@root_variables_inheritance
)
...
...
spec/lib/gitlab/ci/pipeline/chain/seed_spec.rb
View file @
3e25217f
...
...
@@ -203,18 +203,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Chain::Seed do
expect
(
rspec_variables
[
'VAR1'
]).
to
eq
(
'overridden var 1'
)
end
context
'when the FF ci_workflow_rules_variables is disabled'
do
before
do
stub_feature_flags
(
ci_workflow_rules_variables:
false
)
end
it
'sends root variable'
do
run_chain
expect
(
rspec_variables
[
'VAR1'
]).
to
eq
(
'var 1'
)
end
end
end
context
'N+1 queries'
do
...
...
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
View file @
3e25217f
...
...
@@ -250,19 +250,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
{
key:
'VAR4'
,
value:
'new var pipeline 4'
,
public:
true
}]
)
end
context
'when FF ci_workflow_rules_variables is disabled'
do
before
do
stub_feature_flags
(
ci_workflow_rules_variables:
false
)
end
it
'returns existing yaml variables'
do
expect
(
subject
[
:yaml_variables
]).
to
match_array
(
[{
key:
'VAR2'
,
value:
'var 2'
,
public:
true
},
{
key:
'VAR3'
,
value:
'var 3'
,
public:
true
}]
)
end
end
end
context
'when root_variables_inheritance is false'
do
...
...
spec/services/ci/create_pipeline_service/rules_spec.rb
View file @
3e25217f
...
...
@@ -230,22 +230,6 @@ RSpec.describe Ci::CreatePipelineService do
[
nil
,
nil
,
nil
,
'job var 4'
,
nil
,
nil
,
'overridden var 7'
]
)
end
context
'when FF ci_workflow_rules_variables is disabled'
do
before
do
stub_feature_flags
(
ci_workflow_rules_variables:
false
)
end
it
'does not affect workflow variables but job variables'
do
expect
(
job1
.
scoped_variables
.
to_hash
.
values_at
(
*
variable_keys
)).
to
eq
(
[
'overridden var 1'
,
'job var 2'
,
nil
,
'workflow var 4'
,
'job var 5'
,
nil
,
'workflow var 7'
]
)
expect
(
job2
.
scoped_variables
.
to_hash
.
values_at
(
*
variable_keys
)).
to
eq
(
[
nil
,
nil
,
nil
,
'job var 4'
,
nil
,
nil
,
'overridden var 7'
]
)
end
end
end
context
'when matching to the second rule'
do
...
...
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