Commit 6fcec4f2 authored by Sean McGivern's avatar Sean McGivern

Merge branch 'ci-variable-expansion-in-rules-changes-ff-cleanup' into 'master'

Remove ci_variable_expansion_in_rules_changes feature flag

See merge request gitlab-org/gitlab!48329
parents 651e8d4b 9db53d78
---
name: ci_variable_expansion_in_rules_changes
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/45037
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/267192
type: development
group: group::pipeline authoring
default_enabled: true
......@@ -1342,14 +1342,7 @@ if there is no `if:` statement that limits the job to branch or merge request pi
##### Variables in `rules:changes`
> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/34272) in GitLab 13.6.
> - It was [deployed behind a feature flag](../../user/feature_flags.md), disabled by default.
> - [Became enabled by default](https://gitlab.com/gitlab-org/gitlab/-/issues/267192) in GitLab 13.6.
> - 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-variables-support-in-ruleschanges). **(CORE ONLY)**
CAUTION: **Warning:**
This feature might not be available to you. Check the **version history** note above for details.
> - [Feature flag removed](https://gitlab.com/gitlab-org/gitlab/-/issues/267192) in GitLab 13.7.
Environment variables can be used in `rules:changes` expressions to determine when
to add jobs to a pipeline:
......@@ -1368,25 +1361,6 @@ The `$` character can be used for both variables and paths. For example, if the
`$DOCKERFILES_DIR` variable exists, its value is used. If it does not exist, the
`$` is interpreted as being part of a path.
###### Enable or disable variables support in `rules:changes` **(CORE ONLY)**
Variables support in `rules:changes` is under development, but is 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.
To enable it:
```ruby
Feature.enable(:ci_variable_expansion_in_rules_changes)
```
To disable it:
```ruby
Feature.disable(:ci_variable_expansion_in_rules_changes)
```
#### `rules:exists`
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24021) in GitLab 12.4.
......
......@@ -11,7 +11,7 @@ module Gitlab
def satisfied_by?(pipeline, context)
return true if pipeline.modified_paths.nil?
expanded_globs = expand_globs(pipeline, context)
expanded_globs = expand_globs(context)
pipeline.modified_paths.any? do |path|
expanded_globs.any? do |glob|
File.fnmatch?(glob, path, File::FNM_PATHNAME | File::FNM_DOTMATCH | File::FNM_EXTGLOB)
......@@ -19,8 +19,7 @@ module Gitlab
end
end
def expand_globs(pipeline, context)
return @globs unless ::Feature.enabled?(:ci_variable_expansion_in_rules_changes, pipeline.project, default_enabled: true)
def expand_globs(context)
return @globs unless context
@globs.map do |glob|
......
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