diff options
author | Fabio Pitino <fpitino@gitlab.com> | 2019-06-21 09:46:58 +0100 |
---|---|---|
committer | Fabio Pitino <fpitino@gitlab.com> | 2019-06-25 10:12:02 +0100 |
commit | a26916d18cab6bc3ed2e6846d130fcd5e36fb313 (patch) | |
tree | b2f3134bb2a0725eec821a3ba0d390229e4acf79 /doc | |
parent | e6a41c14e023627dba24ec321ddc0794fef41833 (diff) | |
download | gitlab-ce-a26916d18cab6bc3ed2e6846d130fcd5e36fb313.tar.gz |
Require pipeline if "Pipeline must succeed" is setrequire-pipeline-when-enabling-only-allow-merge-if-pipeline-succeeds
When a user sets only_allow_merge_if_pipeline_succeeds, also named
as "Pipeline must succeed" project setting, we require the pipeline
to be present.
This solves race condition issues especially with external CI
providers when a build is triggered externally but no pipelines are
created in GitLab yet.
Document that a head pipeline is expected when using "Pipeline
must succeed" setting. Also explain limitations with the use of
only/except where there may not be any jobs created and the merge
request will not be allowed to be merged.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/user/project/merge_requests/merge_when_pipeline_succeeds.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md index c93c7a5fe08..0dd60d84c42 100644 --- a/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md +++ b/doc/user/project/merge_requests/merge_when_pipeline_succeeds.md @@ -42,6 +42,8 @@ Navigate to your project's settings page and expand the **Merge requests** secti In the **Merge checks** subsection, select the **Pipelines must succeed** check box and hit **Save** for the changes to take effect. +NOTE: **Note:** This setting also prevents merge requests from being merged if there is no pipeline. + ![Pipelines must succeed settings](img/merge_when_pipeline_succeeds_only_if_succeeds_settings.png) From now on, every time the pipeline fails you will not be able to merge the @@ -49,6 +51,21 @@ merge request from the UI, until you make all relevant jobs pass. ![Only allow merge if pipeline succeeds message](img/merge_when_pipeline_succeeds_only_if_succeeds_msg.png) +### Limitations + +When this setting is enabled, a merge request is prevented from being merged if there is no pipeline. This may conflict with some use cases where [`only/except`](../../../ci/yaml/README.md#onlyexcept-advanced) rules are used and they don't generate any pipelines. + +Users that expect to be able to merge a merge request in this scenario should ensure that [there is always a pipeline](https://gitlab.com/gitlab-org/gitlab-ce/issues/54226) and that it's succesful. + +For example, to that on merge requests there is always a passing job even though `only/except` rules may not generate any other jobs: + +```yaml +enable_merge: + only: merge_requests + script: + - echo true +``` + <!-- ## Troubleshooting Include any troubleshooting steps that you can foresee. If you know beforehand what issues |