Commit 98b94d74 authored by Marius Bobin's avatar Marius Bobin

Remove ci_custom_yaml_tags feature flag

Remove ci_custom_yaml_tags feature flag
parent d6d09424
---
title: Add '!reference' YAML tag to help merge CI configurations
merge_request: 54198
author:
type: added
---
name: ci_custom_yaml_tags
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/52104
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/300155
milestone: '13.9'
type: development
group: group::pipeline authoring
default_enabled: false
......@@ -4600,13 +4600,6 @@ into templates.
### `!reference` tags
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/266173) in GitLab 13.9.
> - It's [deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - It's disabled on GitLab.com.
> - It's not recommended for production use.
> - To use it in GitLab self-managed instances, ask a GitLab administrator to [enable it](#enable-or-disable-reference-tags). **(FREE SELF)**
WARNING:
This feature might not be available to you. Check the **version history** note above for details.
Use the `!reference` custom YAML tag to select keyword configuration from other job
sections and reuse it in the current section. Unlike [YAML anchors](#anchors), you can
......@@ -4666,25 +4659,6 @@ test-vars-2:
You can't reuse a section that already includes a `!reference` tag. Only one level
of nesting is supported.
#### Enable or disable `!reference` tags **(FREE SELF)**
The `!reference` tag is under development and not ready for production use. It is
deployed behind a feature flag that is **disabled by default**.
[GitLab administrators with access to the GitLab Rails console](../../administration/feature_flags.md)
can enable it.
To enable it:
```ruby
Feature.enable(:ci_custom_yaml_tags)
```
To disable it:
```ruby
Feature.disable(:ci_custom_yaml_tags)
```
## Skip Pipeline
To push a commit without triggering a pipeline, add `[ci skip]` or `[skip ci]`, using any
......
......@@ -90,15 +90,7 @@ module Gitlab
end
def build_config(config)
if ::Feature.enabled?(:ci_custom_yaml_tags, @context.project, default_enabled: :yaml)
build_config_with_custom_tags(config)
else
build_config_without_custom_tags(config)
end
end
def build_config_with_custom_tags(config)
initial_config = Config::Yaml.load!(config, project: @context.project)
initial_config = Config::Yaml.load!(config)
initial_config = Config::External::Processor.new(initial_config, @context).perform
initial_config = Config::Extendable.new(initial_config).to_hash
initial_config = Config::Yaml::Tags::Resolver.new(initial_config).to_hash
......@@ -107,15 +99,6 @@ module Gitlab
initial_config
end
def build_config_without_custom_tags(config)
initial_config = Gitlab::Config::Loader::Yaml.new(config).load!
initial_config = Config::External::Processor.new(initial_config, @context).perform
initial_config = Config::Extendable.new(initial_config).to_hash
initial_config = Config::EdgeStagesInjector.new(initial_config).to_hash
initial_config
end
def build_context(project:, sha:, user:, parent_pipeline:)
Config::External::Context.new(
project: project,
......
......@@ -60,11 +60,7 @@ module Gitlab
def content_hash
strong_memoize(:content_yaml) do
if ::Feature.enabled?(:ci_custom_yaml_tags, context.project, default_enabled: :yaml)
::Gitlab::Ci::Config::Yaml.load!(content)
else
Gitlab::Config::Loader::Yaml.new(content).load!
end
::Gitlab::Ci::Config::Yaml.load!(content)
end
rescue Gitlab::Config::Loader::FormatError
nil
......
......@@ -7,7 +7,7 @@ module Gitlab
AVAILABLE_TAGS = [Config::Yaml::Tags::Reference].freeze
class << self
def load!(content, project: nil)
def load!(content)
ensure_custom_tags
Gitlab::Config::Loader::Yaml.new(content, additional_permitted_classes: AVAILABLE_TAGS).load!
......
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