diff --git a/doc/ci/pipelines/img/pipeline_fork_v13_7.png b/doc/ci/pipelines/img/pipeline_fork_v13_7.png deleted file mode 100644 index eb44290aa661cba215e6ed3cb2a136b804d2f74f..0000000000000000000000000000000000000000 Binary files a/doc/ci/pipelines/img/pipeline_fork_v13_7.png and /dev/null differ diff --git a/doc/ci/pipelines/merge_request_pipelines.md b/doc/ci/pipelines/merge_request_pipelines.md index b12e8b18d189bcc867a361006b12bdcd83299ac4..fbe7bf071a1507a1e6c99f390ffa813614e279b1 100644 --- a/doc/ci/pipelines/merge_request_pipelines.md +++ b/doc/ci/pipelines/merge_request_pipelines.md @@ -10,8 +10,6 @@ DETAILS: **Tier:** Free, Premium, Ultimate **Offering:** GitLab.com, Self-managed, GitLab Dedicated -> [Renamed](https://gitlab.com/gitlab-org/gitlab/-/issues/351192) from `pipelines for merge requests` to `merge request pipelines` in GitLab 14.8. - You can configure your pipeline to run every time you make changes to the source branch in a merge request. @@ -37,15 +35,13 @@ and target branches together, use merged results pipelines. To use merge request pipelines: -- Your project's [`.gitlab-ci.yml` file](../index.md#the-gitlab-ciyml-file) must be configured with - jobs that run in merge request pipelines. To do this, you can use: - - [`rules`](#use-rules-to-add-jobs). - - [`only/except`](#use-only-to-add-jobs). +- Your project's [`.gitlab-ci.yml` file](../index.md#the-gitlab-ciyml-file) must be + [configured with jobs that run in merge request pipelines](#add-jobs-to-merge-request-pipelines). - You must have at least the Developer role in the source project to run a merge request pipeline. - Your repository must be a GitLab repository, not an [external repository](../ci_cd_for_external_repos/index.md). -## Use `rules` to add jobs +## Add jobs to merge request pipelines Use the [`rules`](../yaml/index.md#rules) keyword to configure jobs to run in merge request pipelines. For example: @@ -85,25 +81,8 @@ workflow: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH ``` -## Use `only` to add jobs - -[`rules`](#use-rules-to-add-jobs) is the preferred method, but you can also use -the [`only`](../yaml/index.md#onlyrefs--exceptrefs) keyword with `merge_requests` -to configure jobs to run in merge request pipelines. For example: - -```yaml -job1: - script: - - echo "This job runs in merge request pipelines" - only: - - merge_requests -``` - ## Use with forked projects -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/217451) in GitLab 13.3. -> - [Moved](https://about.gitlab.com/blog/2021/01/26/new-gitlab-product-subscription-model/) to GitLab Premium in 13.9. - External contributors who work in forks can't create pipelines in the parent project. A merge request from a fork that is submitted to the parent project triggers a @@ -112,9 +91,7 @@ pipeline that: - Is created and runs in the fork (source) project, not the parent (target) project. - Uses the fork project's CI/CD configuration, resources, and project CI/CD variables. -Pipelines for forks display with the **fork** badge in the parent project: - - +Pipelines for forks display with the **fork** badge in the parent project. ### Run pipelines in the parent project diff --git a/doc/ci/review_apps/index.md b/doc/ci/review_apps/index.md index 8788a11ea9f0e22a0677b6a4819a6bf6df928092..3ea46d2222c7991457bcbb0647099056fdc9012b 100644 --- a/doc/ci/review_apps/index.md +++ b/doc/ci/review_apps/index.md @@ -263,7 +263,7 @@ to replace those values at runtime when each review app is created: variable or on the [project overview page](../../user/project/working_with_projects.md#access-the-project-overview-page-by-using-the-project-id). - `data-merge-request-id` is the merge request ID, which can be found by the `CI_MERGE_REQUEST_IID` variable. `CI_MERGE_REQUEST_IID` is available only if - [`rules:if: $CI_PIPELINE_SOURCE == "merge_request_event`](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs) + [`rules:if: $CI_PIPELINE_SOURCE == "merge_request_event`](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines) is used and the merge request is created. - `data-mr-url` is the URL of the GitLab instance and is the same for all review apps. diff --git a/doc/ci/yaml/index.md b/doc/ci/yaml/index.md index d9c744dc994bcd2b5a110423a2440f2bdd46b371..befbe0aa8adeddb7d04b6fa62b83748540dc29bb 100644 --- a/doc/ci/yaml/index.md +++ b/doc/ci/yaml/index.md @@ -672,7 +672,7 @@ and the pipeline is for either: - You can use the [`workflow:rules` templates](workflow.md#workflowrules-templates) to import a preconfigured `workflow: rules` entry. - [Common `if` clauses for `workflow:rules`](workflow.md#common-if-clauses-for-workflowrules). -- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs). +- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines). #### `workflow:rules:variables` @@ -4034,7 +4034,7 @@ job: - [Common `if` expressions for `rules`](../jobs/job_control.md#common-if-clauses-for-rules). - [Avoid duplicate pipelines](../jobs/job_control.md#avoid-duplicate-pipelines). -- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#use-rules-to-add-jobs). +- [Use `rules` to run merge request pipelines](../pipelines/merge_request_pipelines.md#add-jobs-to-merge-request-pipelines). #### `rules:changes`