(Backend)Add a toggle in the Enable merge trains section to disable skip merge train

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

🧩 Problem statement

Right now, when users enable merge train(after enabling pipeline for merged results), Merge immediately always shows up. Enabling pipeline must succeed only takes into account the recent pipeline(pipeline for merged results) and not the pipeline for merge train. By adding an additional toggle, users would get an option if they want the recent pipeline to be considered or specifically the pipeline for merge trains.

Background

#320981 (comment 578018148)

📝 Proposal

This issue to provide the backend changes for #331356


  • Only allow merging via merge train
    When enabled, the Merge immediately option is not available in merge requests. All merge requests must be added to a merge train to merge.

  1. Remove the line that forces 'merge immediately' to always show for merge trains
  2. Add a new setting(proposed in #331356), ensure it is persisted to the database and have relevant api endpoints for fetching and persisting the data to the servers
Edited by 🤖 GitLab Bot 🤖