Commit aa9f365a authored by Krasimir Angelov's avatar Krasimir Angelov

Add ci_secrets_management Premium feature

Add new Premium feature named `ci_secrets_management` and also add
project scoped feature flag named `ci_secrets_management_vault` to help
with rolloutt of Vault secrets support.

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/28321
and https://gitlab.com/gitlab-org/gitlab/-/issues/218746.
parent 74448448
......@@ -134,6 +134,10 @@ module EE
!merge_train_pipeline? && super
end
def ci_secrets_management_available?
project.beta_feature_available?(:ci_secrets_management)
end
private
def parse_security_artifact_blob(security_report, blob)
......
......@@ -52,6 +52,7 @@ class License < ApplicationRecord
board_assignee_lists
board_milestone_lists
ci_cd_projects
ci_secrets_management
cluster_deployments
code_owner_approval_required
commit_committer_check
......
......@@ -486,4 +486,24 @@ RSpec.describe Ci::Build do
expect(described_class.license_scan).to contain_exactly(build_with_license_scan)
end
end
describe 'ci_secrets_management_available?' do
subject(:build) { job.ci_secrets_management_available? }
context 'when secrets management feature is available' do
before do
stub_licensed_features(ci_secrets_management: true)
end
it { is_expected.to be true }
end
context 'when secrets management feature is not available' do
before do
stub_licensed_features(ci_secrets_management: false)
end
it { is_expected.to be false }
end
end
end
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