-1

I need your help to determine the correct order events I should follow before I perform a specific type of merge in GitLab. I have a "Draft" merge request which has the prefix "Draft:" in its title, but has been approved by all its required code reviewers. At this point it says,

  • Merge blocked: merge request must be marked as ready. It's still marked as draft.

Beneath that there is a warning:

  • The source branch is 2 commits behind the target branch

The Merge button is disabled. A little exclamation point icon appears next to it. And there is a "Mark as ready" button that is enabled and I could click on.

enter image description here

Am I free to click "Mark as ready" at this point, or should I first clone that project locally, catch it up with its parent branch, and push it back up to the remote repository before I click "Mark as ready"?

ShieldOfSalvation
  • 1,297
  • 16
  • 32
  • If there are no conflicts, why would you need to "catch it up"? If you want to regardless, you don't have to clone it locally to do that. You can use the '/rebase' quick action. – Arty-chan Nov 08 '22 at 05:21

1 Answers1

0

The GitLab web UI actually made this process quite easy despite the fact that by the time I got around to this, I was 10 commits behind!

All I did was click "Mark as ready", which removed the "Draft:" prefix from the merge request title. Then the UI said it was "Ready to merge" with a green checkmark icon. Beneath that, it said, "3 commits and 1 merge commit will be added to develop".

I suppose that meant that whatever commits I was behind, it took care of merging/rebasing that in the background--or maybe GitLab didn't do anything and I was covered because the code in my draft merge's branch was either mutually exclusive (i.e., didn't conflict) with the develop branch or it already up to date with the develop branch. Any explanations/clarifications by other more experienced software engineers are welcome! I believe that if there had been a conflict, GitLab would have presented me with further options before merging.

The "3 commits" left here at this point certainly had to do with the actual code pushed into this specific merge request by the developer.

I then clicked the two checkboxes, "Delete source branch" and "Squash commits" (as a preference). The subtitle now reflected that "1 commit and 1 merge commit will be added to develop (squashes 3 commits)." Finally, I simply clicked "Merge".

enter image description here

Done.

ShieldOfSalvation
  • 1,297
  • 16
  • 32