Commit 0e2874d9 authored by James Lopez's avatar James Lopez

Merge branch 'remove-ci-instance-level-variables-feature-flags' into 'master'

Remove feature flags for instance level variables

See merge request gitlab-org/gitlab!36187
parents 25ad8786 f82f222e
...@@ -45,13 +45,5 @@ module Ci ...@@ -45,13 +45,5 @@ module Ci
end end
end end
end end
private
def validate_plan_limit_not_exceeded
if Gitlab::Ci::Features.instance_level_variables_limit_enabled?
super
end
end
end end
end end
...@@ -84,8 +84,6 @@ module Ci ...@@ -84,8 +84,6 @@ module Ci
end end
def secret_instance_variables def secret_instance_variables
return [] unless ::Feature.enabled?(:ci_instance_level_variables, project, default_enabled: true)
project.ci_instance_variables_for(ref: git_ref) project.ci_instance_variables_for(ref: git_ref)
end end
......
# Instance-level CI/CD variables API # Instance-level CI/CD variables API
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0 > - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/14108) in GitLab 13.0
> - It's deployed behind a feature flag, enabled by default. > - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/218249) in GitLab 13.2.
> - 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-instance-level-cicd-variables-core-only). **(CORE ONLY)**
## List all instance variables ## List all instance variables
...@@ -140,22 +137,3 @@ DELETE /admin/ci/variables/:key ...@@ -140,22 +137,3 @@ DELETE /admin/ci/variables/:key
```shell ```shell
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/admin/ci/variables/VARIABLE_1" curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/admin/ci/variables/VARIABLE_1"
``` ```
### Enable or disable instance-level CI/CD variables **(CORE ONLY)**
Instance-level CI/CD 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 for your instance.
To disable it:
```ruby
Feature.disable(:ci_instance_level_variables)
```
To enable it:
```ruby
Feature.enable(:ci_instance_level_variables)
```
...@@ -458,9 +458,6 @@ The UI interface for Instance-level CI/CD variables is under development but rea ...@@ -458,9 +458,6 @@ The UI interface for Instance-level CI/CD variables is under development but rea
It is deployed behind a feature flag that is **enabled by default**. 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 for your instance. [GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md) can opt to disable it for your instance.
NOTE: **Note:**
This feature will not work if the [instance-level CI/CD variables API feature flag is disabled](../../api/instance_level_ci_variables.md#enable-or-disable-instance-level-cicd-variables-core-only).
To disable it: To disable it:
```ruby ```ruby
......
...@@ -18,10 +18,6 @@ module Gitlab ...@@ -18,10 +18,6 @@ module Gitlab
::Feature.enabled?(:ci_job_heartbeats_runner, project, default_enabled: true) ::Feature.enabled?(:ci_job_heartbeats_runner, project, default_enabled: true)
end end
def self.instance_level_variables_limit_enabled?
::Feature.enabled?(:ci_instance_level_variables_limit, default_enabled: true)
end
def self.pipeline_fixed_notifications? def self.pipeline_fixed_notifications?
::Feature.enabled?(:ci_pipeline_fixed_notifications, default_enabled: true) ::Feature.enabled?(:ci_pipeline_fixed_notifications, default_enabled: true)
end end
......
...@@ -3301,17 +3301,6 @@ RSpec.describe Ci::Build do ...@@ -3301,17 +3301,6 @@ RSpec.describe Ci::Build do
expect(build.scoped_variables_hash).not_to include('MY_VAR': 'my value 1') expect(build.scoped_variables_hash).not_to include('MY_VAR': 'my value 1')
end end
end end
context 'when CI instance variables are disabled' do
before do
create(:ci_instance_variable, key: 'MY_VAR', value: 'my value 1')
stub_feature_flags(ci_instance_level_variables: false)
end
it 'does not include instance level variables' do
expect(build.scoped_variables_hash).not_to include('MY_VAR': 'my value 1')
end
end
end end
describe '#any_unmet_prerequisites?' do describe '#any_unmet_prerequisites?' do
......
...@@ -15,21 +15,6 @@ RSpec.describe Ci::InstanceVariable do ...@@ -15,21 +15,6 @@ RSpec.describe Ci::InstanceVariable do
subject { build(:ci_instance_variable) } subject { build(:ci_instance_variable) }
end end
context 'with instance level variable feature flag disabled' do
let(:plan_limits) { create(:plan_limits, :default_plan) }
before do
stub_feature_flags(ci_instance_level_variables_limit: false)
plan_limits.update(described_class.limit_name => 1)
create(:ci_instance_variable)
end
it 'can create new models exceeding the plan limits', :aggregate_failures do
expect { subject.save }.to change { described_class.count }
expect(subject.errors[:base]).to be_empty
end
end
describe '.unprotected' do describe '.unprotected' do
subject { described_class.unprotected } subject { described_class.unprotected }
......
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