Commit 559c5148 authored by Stan Hu's avatar Stan Hu

Merge branch '289803-remove-ci_rules_variables' into 'master'

Remove FF ci_rules_variables [RUN ALL RSPEC] [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!54716
parents 66e87900 298fdb9d
---
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
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment