Commit ffea1ee9 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'ci-secrets-remove-feature-flags' into 'master'

CI Secrets: remove feature flags

See merge request gitlab-org/gitlab!42055
parents b1b0ac0a d39a46a8
...@@ -136,7 +136,7 @@ module EE ...@@ -136,7 +136,7 @@ module EE
end end
def ci_secrets_management_available? def ci_secrets_management_available?
project.beta_feature_available?(:ci_secrets_management) project.feature_available?(:ci_secrets_management)
end end
override :runner_required_feature_names override :runner_required_feature_names
......
---
title: Add support for reading Vault secrets from CI jobs
merge_request: 42055
author:
type: added
---
name: ci_secrets_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/42055
rollout_issue_url:
group: group::release management
type: licensed
default_enabled: true
...@@ -12,10 +12,6 @@ module EE ...@@ -12,10 +12,6 @@ module EE
prepended do prepended do
attributes :secrets attributes :secrets
validations do
validates :secrets, absence: { message: 'feature is disabled' }, unless: :secrets_enabled?
end
entry :secrets, ::Gitlab::Ci::Config::Entry::Secrets, entry :secrets, ::Gitlab::Ci::Config::Entry::Secrets,
description: 'Configured secrets for this job', description: 'Configured secrets for this job',
inherit: false inherit: false
...@@ -25,10 +21,6 @@ module EE ...@@ -25,10 +21,6 @@ module EE
def value def value
super.merge({ secrets: secrets_value }.compact) super.merge({ secrets: secrets_value }.compact)
end end
def secrets_enabled?
::Gitlab::Ci::Features.secrets_syntax_enabled?
end
end end
end end
end end
......
# frozen_string_literal: true
module EE
module Gitlab
module Ci
module Features
extend ActiveSupport::Concern
prepended do
def self.secrets_syntax_enabled?
::Feature.enabled?(:ci_secrets_syntax)
end
end
end
end
end
end
...@@ -10,29 +10,12 @@ RSpec.describe Gitlab::Ci::Config::Entry::Job do ...@@ -10,29 +10,12 @@ RSpec.describe Gitlab::Ci::Config::Entry::Job do
context 'when has secrets' do context 'when has secrets' do
let(:config) { { script: 'echo', secrets: { DATABASE_PASSWORD: { vault: 'production/db/password' } } } } let(:config) { { script: 'echo', secrets: { DATABASE_PASSWORD: { vault: 'production/db/password' } } } }
context 'when ci_secrets_syntax feature flag is enabled' do
before do before do
stub_feature_flags(ci_secrets_syntax: true)
entry.compose! entry.compose!
end end
it { expect(entry).to be_valid } it { expect(entry).to be_valid }
end end
context 'when ci_secrets_syntax feature flag is disabled' do
before do
stub_feature_flags(ci_secrets_syntax: false)
entry.compose!
end
it 'returns an error' do
aggregate_failures do
expect(entry).not_to be_valid
expect(entry.errors).to include 'job secrets feature is disabled'
end
end
end
end
end end
context 'when entry value is not correct' do context 'when entry value is not correct' do
......
...@@ -77,5 +77,3 @@ module Gitlab ...@@ -77,5 +77,3 @@ module Gitlab
end end
end end
end end
::Gitlab::Ci::Features.prepend_if_ee('::EE::Gitlab::Ci::Features')
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