Generally, this is a safer option than merging merge requests immediately, because your
Make sure your `gitlab-ci.yml` file is [configured properly for pipelines for merge requests](../index.md#configuring-pipelines-for-merge-requests),
merge request will be evaluated with an expected post-merge result before the actual
otherwise pipelines for merged results won't run and your merge requests will be stuck in an unresolved state.
merge happens.
For more information, read the [documentation on Merge Trains](merge_trains/index.md).
## Automatic pipeline cancelation
## Automatic pipeline cancelation
...
@@ -118,15 +128,3 @@ which indicates that the checkout-SHA is not found in the merge ref.
...
@@ -118,15 +128,3 @@ which indicates that the checkout-SHA is not found in the merge ref.
This behavior was improved at GitLab 12.4 by introducing [Persistent pipeline refs](../../pipelines/index.md#troubleshooting-fatal-reference-is-not-a-tree).
This behavior was improved at GitLab 12.4 by introducing [Persistent pipeline refs](../../pipelines/index.md#troubleshooting-fatal-reference-is-not-a-tree).
You should be able to create pipelines at any timings without concerning the error.
You should be able to create pipelines at any timings without concerning the error.
## Using Merge Trains **(PREMIUM)**
By enabling [Pipelines for merged results](#pipelines-for-merged-results-premium),
GitLab will [automatically display](merge_trains/index.md#how-to-add-a-merge-request-to-a-merge-train)
a **Start/Add Merge Train button** as the most recommended merge strategy.
Generally, this is a safer option than merging merge requests immediately as your
merge request will be evaluated with an expected post-merge result before the actual
merge happens.
For more information, read the [documentation on Merge Trains](merge_trains/index.md).
### Merge request dropped from the merge train immediately
### Merge request dropped from the merge train immediately
If a merge request is not mergeable (for example, it's WIP, there is a merge
If a merge request is not mergeable (for example, it's WIP, there is a merge
conflict, etc), your merge request will be dropped from the merge train automatically.
conflict, etc.), your merge request will be dropped from the merge train automatically.
In these cases, the reason for dropping the merge request is in the **system notes**.
In these cases, the reason for dropping the merge request is in the **system notes**.
...
@@ -146,35 +157,30 @@ To check the reason:
...
@@ -146,35 +157,30 @@ To check the reason:
### Merge When Pipeline Succeeds cannot be chosen
### Merge When Pipeline Succeeds cannot be chosen
[Merge When Pipeline Succeeds](../../../../user/project/merge_requests/merge_when_pipeline_succeeds.md)
[Merge When Pipeline Succeeds](../../../../user/project/merge_requests/merge_when_pipeline_succeeds.md)
is unavailable when
is currently unavailable when Merge Trains are enabled.
[Pipelines for Merged Results is enabled](../index.md#enabling-pipelines-for-merged-results).
Follow [this issue](https://gitlab.com/gitlab-org/gitlab/issues/12267) to
See [the related issue](https://gitlab.com/gitlab-org/gitlab/issues/12267)
track progress on this issue.
for more information.
### Merge Train Pipeline cannot be retried
### Merge Train Pipeline cannot be retried
A Merge Train pipeline cannot be retried because the merge request is dropped from the merge train upon failure. For this reason, the retry button does not appear next to the pipeline icon.
A Merge Train pipeline cannot be retried because the merge request is dropped from the merge train upon failure. For this reason, the retry button does not appear next to the pipeline icon.
In the case of pipeline failure, you should [re-enqueue](#how-to-add-a-merge-request-to-a-merge-train) the merge request to the merge train, which will then initiate a new pipeline.
In the case of pipeline failure, you should [re-enqueue](#add-a-merge-request-to-a-merge-train) the merge request to the merge train, which will then initiate a new pipeline.
### Merge Train disturbs your workflow
First of all, please check if [merge immediately](#immediately-merge-a-merge-request-with-a-merge-train)
### Merge Trains feature flag **(PREMIUM ONLY)**
is available as a workaround in your workflow. This is the most recommended
workaround you'd be able to take immediately. If it's not available or acceptable,
please read through this section.
Merge train is enabled by default when you enable [Pipelines for merged results](../index.md),
To enable and disable the Merge Trains feature, use the `:disable_merge_trains` feature flag.
however, you can disable this feature by setting the `:disable_merge_trains` feature flag to `enable`.
When you disable this feature, all existing merge trains are aborted and
the **Start/Add Merge Train** button no longer appears in merge requests.
To check if the feature flag is enabled on your GitLab instance,
To check if the feature flag is enabled on your GitLab instance,
please ask an administrator to execute the following commands **(CORE ONLY)**:
ask an administrator to execute the following commands:
```shell
```shell
>sudo gitlab-rails console # Login to Rails console of GitLab instance.
>sudo gitlab-rails console # Login to Rails console of GitLab instance.
> Feature.enabled?(:disable_merge_trains)# Check if it's disabled or not.
> Feature.enabled?(:disable_merge_trains)# Check if it's disabled or not.