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
298fdb9d
Commit
298fdb9d
authored
Feb 19, 2021
by
Furkan Ayhan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove FF ci_rules_variables
It was already enabled by default
parent
928b0c26
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
72 deletions
+5
-72
config/feature_flags/development/ci_rules_variables.yml
config/feature_flags/development/ci_rules_variables.yml
+0
-8
doc/ci/yaml/README.md
doc/ci/yaml/README.md
+1
-27
lib/gitlab/ci/features.rb
lib/gitlab/ci/features.rb
+0
-4
lib/gitlab/ci/pipeline/seed/build.rb
lib/gitlab/ci/pipeline/seed/build.rb
+4
-8
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
+0
-11
spec/services/ci/create_pipeline_service/rules_spec.rb
spec/services/ci/create_pipeline_service/rules_spec.rb
+0
-14
No files found.
config/feature_flags/development/ci_rules_variables.yml
deleted
100644 → 0
View file @
928b0c26
---
name
:
ci_rules_variables
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/48752
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/289803
milestone
:
'
13.7'
type
:
development
group
:
group::pipeline authoring
default_enabled
:
true
doc/ci/yaml/README.md
View file @
298fdb9d
...
...
@@ -1436,14 +1436,7 @@ In this example, if the first rule matches, then the job has `when: manual` and
#### `rules:variables`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/209864) in GitLab 13.7.
> - It was [deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/289803) on GitLab 13.8.
> - It's enabled on GitLab.com.
> - It's recommended for production use.
> - For GitLab self-managed instances, GitLab administrators can opt to [disable it](#enable-or-disable-rulesvariables). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the
**version history**
note above for details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/289803) in GitLab 13.10.
You can use
[
`variables`
](
#variables
)
in
`rules:`
to define variables for specific conditions.
...
...
@@ -1465,25 +1458,6 @@ job:
-
echo "Run another script if $IS_A_FEATURE exists"
```
##### Enable or disable rules:variables **(FREE SELF)**
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_rules_variables
)
```
To disable it:
```
ruby
Feature
.
disable
(
:ci_rules_variables
)
```
#### Complex rule clauses
To conjoin
`if`
,
`changes`
, and
`exists`
clauses with an
`AND`
, use them in the
...
...
lib/gitlab/ci/features.rb
View file @
298fdb9d
...
...
@@ -59,10 +59,6 @@ module Gitlab
::
Feature
.
enabled?
(
:ci_pipeline_editor_page
,
project
,
default_enabled: :yaml
)
end
def
self
.
rules_variables_enabled?
(
project
)
::
Feature
.
enabled?
(
:ci_rules_variables
,
project
,
default_enabled:
true
)
end
def
self
.
validate_build_dependencies?
(
project
)
::
Feature
.
enabled?
(
:ci_validate_build_dependencies
,
project
,
default_enabled: :yaml
)
&&
::
Feature
.
disabled?
(
:ci_validate_build_dependencies_override
,
project
)
...
...
lib/gitlab/ci/pipeline/seed/build.rb
View file @
298fdb9d
...
...
@@ -169,15 +169,11 @@ module Gitlab
strong_memoize
(
:rules_attributes
)
do
next
{}
unless
@using_rules
if
::
Gitlab
::
Ci
::
Features
.
rules_variables_enabled?
(
@pipeline
.
project
)
rules_variables_result
=
::
Gitlab
::
Ci
::
Variables
::
Helpers
.
merge_variables
(
@seed_attributes
[
:yaml_variables
],
rules_result
.
variables
)
rules_variables_result
=
::
Gitlab
::
Ci
::
Variables
::
Helpers
.
merge_variables
(
@seed_attributes
[
:yaml_variables
],
rules_result
.
variables
)
rules_result
.
build_attributes
.
merge
(
yaml_variables:
rules_variables_result
)
else
rules_result
.
build_attributes
end
rules_result
.
build_attributes
.
merge
(
yaml_variables:
rules_variables_result
)
end
end
...
...
spec/lib/gitlab/ci/pipeline/seed/build_spec.rb
View file @
298fdb9d
...
...
@@ -85,17 +85,6 @@ RSpec.describe Gitlab::Ci::Pipeline::Seed::Build do
{
key:
'VAR2'
,
value:
'var 2'
,
public:
true
},
{
key:
'VAR3'
,
value:
'var 3'
,
public:
true
}])
end
context
'when FF ci_rules_variables is disabled'
do
before
do
stub_feature_flags
(
ci_rules_variables:
false
)
end
it
do
is_expected
.
to
include
(
yaml_variables:
[{
key:
'VAR1'
,
value:
'var 1'
,
public:
true
},
{
key:
'VAR2'
,
value:
'var 2'
,
public:
true
}])
end
end
end
context
'with cache:key'
do
...
...
spec/services/ci/create_pipeline_service/rules_spec.rb
View file @
298fdb9d
...
...
@@ -180,20 +180,6 @@ RSpec.describe Ci::CreatePipelineService do
expect
(
variables
[
'VAR2'
]).
to
eq
(
'my var 2'
)
expect
(
variables
[
'VAR3'
]).
to
be_nil
end
context
'when FF ci_rules_variables is disabled'
do
before
do
stub_feature_flags
(
ci_rules_variables:
false
)
end
it
'does not affect variables'
do
variables
=
job
.
scoped_variables_hash
expect
(
variables
[
'VAR1'
]).
to
eq
(
'my var 1'
)
expect
(
variables
[
'VAR2'
]).
to
eq
(
'my var 2'
)
expect
(
variables
[
'VAR3'
]).
to
be_nil
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