Add new merge immediately options to the MR Widget
What does this MR do and why?
Adds two new options for the MR Widget when working with Merge Trains.
Merge now and restart train
Merge now and don't restart train
These new options allow merging an MR that uses merge trains immediately, the latter allowing to skip the merge train altogether.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
Note When the project is not setup for merge trains, the Merge immediately
options is still the default option
How to set up and validate locally
- In the Rails console, enable the
merge_trains_skip_train
feature flag
echo "Feature.enable(:merge_trains_skip_train)" | bundle exec rails c
- Inside a project, go to
Project -> Settings -> Merge requests
- Ensure the following options are enabled for merge trains
- Ensure that your project has the following workflow rules for the
.gitlab-ci.yml
pipelines
rules: # This must be present
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
stages:
- build
- test
build-job:
stage: build
script:
- echo "Compiling the code..."
- echo "Compile complete."
unit-test-job:
stage: test
script:
- echo "Running unit tests... This will take about 60 seconds."
- sleep 60
- echo "Code coverage is 90%"
lint-test-job:
stage: test
script:
- echo "Linting code... This will take about 10 seconds."
- sleep 10
- echo "No lint issues found."
- Open a Merge Request for your project, wait for the pipeline to finish, and look at the new dropdown buttons
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jose Ivan Vargas