Commit 71f20670 authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch '196171-follow-up-from-support-for-release-key-in-gitlab-ci-yaml' into 'master'

Feature flag for release generation

Closes #196171

See merge request gitlab-org/gitlab!23152
parents ecb728d1 767b6731
......@@ -35,6 +35,12 @@ module Gitlab
message: 'key may not be used with `rules`'
},
if: :has_rules?
validates :config,
disallowed_keys: {
in: %i[release],
message: 'release features are not enabled'
},
unless: -> { Feature.enabled?(:ci_release_generation, default_enabled: false) }
with_options allow_nil: true do
validates :allow_failure, boolean: true
......
......@@ -1331,9 +1331,9 @@ module Gitlab
stub_feature_flags(ci_release_generation: false)
end
it "returns release info" do
expect(processor.stage_builds_attributes('release').first[:options].include?(config[:release]))
.to be false
it 'raises error' do
expect { processor }.to raise_error(
'jobs:release config release features are not enabled: release')
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