Commit 36f6fb2d authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'selhorn-vale-moresentences' into 'master'

Docs: Fixed Vale errors in CI YAML topic

See merge request gitlab-org/gitlab!44646
parents 86858439 8e5bd342
...@@ -1698,20 +1698,17 @@ while just `/issue/` would also match a branch called `severe-issues`. ...@@ -1698,20 +1698,17 @@ while just `/issue/` would also match a branch called `severe-issues`.
#### Supported `only`/`except` regexp syntax #### Supported `only`/`except` regexp syntax
CAUTION: **Warning:** In GitLab 11.9.4, GitLab began internally converting the regexp used
This is a breaking change that was introduced with GitLab 11.9.4.
In GitLab 11.9.4, GitLab begun internally converting regexp used
in `only` and `except` parameters to [RE2](https://github.com/google/re2/wiki/Syntax). in `only` and `except` parameters to [RE2](https://github.com/google/re2/wiki/Syntax).
This means that only subset of features provided by [Ruby Regexp](https://ruby-doc.org/core/Regexp.html) [RE2](https://github.com/google/re2/wiki/Syntax) limits the set of available features
is supported. [RE2](https://github.com/google/re2/wiki/Syntax) limits the set of features due to computational complexity, and some features, like negative lookaheads, became unavailable.
provided due to computational complexity, which means some features became unavailable in GitLab 11.9.4. Only a subset of features provided by [Ruby Regexp](https://ruby-doc.org/core/Regexp.html)
For example, negative lookaheads. are now supported.
For GitLab versions from 11.9.7 and up to GitLab 12.0, GitLab provides a feature flag that can be From GitLab 11.9.7 to GitLab 12.0, GitLab provided a feature flag to
enabled by administrators that allows users to use unsafe regexp syntax. This brings compatibility let you use the unsafe regexp syntax. This flag allowed
with previously allowed syntax version and allows users to gracefully migrate to the new syntax. compatibility with the previous syntax version so you could gracefully migrate to the new syntax.
```ruby ```ruby
Feature.enable(:allow_unsafe_ruby_regexp) Feature.enable(:allow_unsafe_ruby_regexp)
...@@ -1767,7 +1764,7 @@ added if the following is true: ...@@ -1767,7 +1764,7 @@ added if the following is true:
- `(any listed refs are true) OR (any listed variables are true) OR (any listed changes are true) OR (a chosen Kubernetes status matches)` - `(any listed refs are true) OR (any listed variables are true) OR (any listed changes are true) OR (a chosen Kubernetes status matches)`
In the example below, the `test` job will **not** be created when **any** of the following are true: In the example below, the `test` job is **not** created when **any** of the following are true:
- The pipeline runs for the `master` branch. - The pipeline runs for the `master` branch.
- There are changes to the `README.md` file in the root directory of the repository. - There are changes to the `README.md` file in the root directory of the repository.
...@@ -1819,12 +1816,11 @@ deploy: ...@@ -1819,12 +1816,11 @@ deploy:
> `variables` policy introduced in GitLab 10.7. > `variables` policy introduced in GitLab 10.7.
The `variables` keyword defines variables expressions. In other words, The `variables` keyword defines variable expressions.
you can use predefined variables / project / group or
environment-scoped variables to define an expression that GitLab These expressions determine whether or not a job should be created.
evaluates to decide whether a job should be created or not.
Examples of using variables expressions: Examples of using variable expressions:
```yaml ```yaml
deploy: deploy:
...@@ -1894,22 +1890,21 @@ docker build: ...@@ -1894,22 +1890,21 @@ docker build:
- more_scripts/*.{rb,py,sh} - more_scripts/*.{rb,py,sh}
``` ```
In the scenario above, when pushing commits to an existing branch in GitLab, When you push commits to an existing branch,
it creates and triggers the `docker build` job, provided that one of the the `docker build` job is created, but only if changes were made to any of the following:
commits contains changes to any of the following:
- The `Dockerfile` file. - The `Dockerfile` file.
- Any of the files inside `docker/scripts/` directory. - Any of the files in the `docker/scripts/` directory.
- Any of the files and subdirectories inside the `dockerfiles` directory. - Any of the files and subdirectories in the `dockerfiles` directory.
- Any of the files with `rb`, `py`, `sh` extensions inside the `more_scripts` directory. - Any of the files with `rb`, `py`, `sh` extensions in the `more_scripts` directory.
CAUTION: **Warning:** CAUTION: **Warning:**
If using `only:changes` with [only allow merge requests to be merged if the pipeline succeeds](../../user/project/merge_requests/merge_when_pipeline_succeeds.md#only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds), If you use `only:changes` with [only allow merge requests to be merged if the pipeline succeeds](../../user/project/merge_requests/merge_when_pipeline_succeeds.md#only-allow-merge-requests-to-be-merged-if-the-pipeline-succeeds),
undesired behavior could result if you don't [also use `only:merge_requests`](#using-onlychanges-with-pipelines-for-merge-requests). undesired behavior can result if you don't [also use `only:merge_requests`](#using-onlychanges-with-pipelines-for-merge-requests).
You can also use glob patterns to match multiple files in either the root directory You can also use glob patterns to match multiple files in either the root directory
of the repository, or in _any_ directory within the repository, but they must be wrapped of the repository, or in _any_ directory within the repository. However, they must be wrapped
in double quotes or GitLab can't parse the `.gitlab-ci.yml`. For example: in double quotes or GitLab can't parse them. For example:
```yaml ```yaml
test: test:
...@@ -1922,10 +1917,8 @@ test: ...@@ -1922,10 +1917,8 @@ test:
- "**/*.sql" - "**/*.sql"
``` ```
The following example skips the `build` job if a change is detected in any file You can skip a job if a change is detected in any file with a
with a `.md` extension in the root directory of the repository. This means that if you change multiple files, `.md` extension in the root directory of the repository:
but only one file is a `.md` file, the `build` job is still skipped and does
not run for the other files.
```yaml ```yaml
build: build:
...@@ -1935,13 +1928,13 @@ build: ...@@ -1935,13 +1928,13 @@ build:
- "*.md" - "*.md"
``` ```
CAUTION: **Warning:** If you change multiple files, but only one file ends in `.md`,
There are some points to be aware of when the `build` job is still skipped. The job does not run for any of the files.
[using this feature with new branches or tags *without* pipelines for merge requests](#using-onlychanges-without-pipelines-for-merge-requests).
CAUTION: **Warning:** Read more about how to use this feature with:
There are some points to be aware of when
[using this feature with scheduled pipelines](#using-onlychanges-with-scheduled-pipelines). - [New branches or tags *without* pipelines for merge requests](#using-onlychanges-without-pipelines-for-merge-requests).
- [Scheduled pipelines](#using-onlychanges-with-scheduled-pipelines).
##### Using `only:changes` with pipelines for merge requests ##### Using `only:changes` with pipelines for merge requests
......
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