MergeWhenBuildSuccedsService quietly merged something and changed MR to "Closed" without any system notes

This happened in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/4859.

  1. Master clicked the "Merge When Build Succeeds" button.
  2. The MR was actually merged 17 minutes later (6/23/2016 4:47 pm UTC time).
  3. No system notes on the MR were created.
  4. No user event note (e.g. Yorick merged XXX) was created either.
  5. However, the relevant issue (gitlab-ce#18924) was also closed.

What's supposed to happen?

  1. MergeWhenBuildSucceedsService#trigger gets called by the commit status API when the build succeeds.
  2. This kicks off MergeWorker to run MergeService asynchronously.
  3. MergeService#commit creates the merge commit.
  4. MergeService#after_merge goes and closes the issues and creates the relevant system notes.

I double checked to see if this was an issue with notes being redacted, but I see no evidence of this.

I'm not sure how step 4 could close issues yet cause the MR to be put in the "Closed" state. It's possible the steps failed somewhere midway through the process, and we never saw the error message.

I think better logging may be necessary here to track this problem down.

Edited Jun 23, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading