[go: up one dir, main page]

Skip to content

Creating Merge Request from "(default branch)" to "(other branch)" breaks workflows

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

Problem

One developer accidentally opened a Merge Request with the default branch (main) as Source Branch and his own branch as Target Branch. This led to a few breaking changes:

  • Gitlab CI Rules didn't work as expected: "CI_COMMIT_BRANCH" isn't set because a merge to main is treated as a merge_request_event pipeline instead of a branch pipeline, as the main branch is part of a merge request.
  • Every merge to "default branch" is added to the opened Merge Request, every person doing a merge to default branch is introduced as author to the newly opened MR.

This led to an interruption in the CI/CD Workflow. Issue mitigation was to simply close the MR.

Proposal

  1. Add an option in the settings which disables the following possibilities:
  • Disable use of "Default Branch" as Source Branch in MRs
  • Disable use of "Protected Branch" as Source Branch in MRs
  1. Use said options in the creation of MRs to prevent any users from creating MRs which cause workflow disruption

BTW: It is possible to open circular Merge Request Trains, i didn't investigate if this might cause issues, especially around https://docs.gitlab.com/ee/ci/pipelines/merged_results_pipelines.html

Edited by 🤖 GitLab Bot 🤖