Skip to content

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.

#423922 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2023-11-07_at_11.36.32_a.m. Screenshot_2023-11-07_at_11.34.10_a.m.

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

  1. In the Rails console, enable the merge_trains_skip_train feature flag
echo "Feature.enable(:merge_trains_skip_train)" | bundle exec rails c
  1. Inside a project, go to Project -> Settings -> Merge requests
  2. Ensure the following options are enabled for merge trains Screenshot_2023-11-07_at_11.02.07_a.m.
  3. 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."
  1. 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.

Edited by Jose Ivan Vargas

Merge request reports