Skip to content

Fix fallback logic for automatic MR title assignment

Franz Liedke requested to merge franzliedke/gitlab-ce:patch-28 into master

What does this MR do?

When a merge request containing just one commit was opened, GitLab automatically suggests . For some reason (it might have to do with our barely used GitLab-internal issue tracker and the configured custom external issue tracker - apparently an unfortunate combination), GitLab seemed to think that the branch name (in this case fl/stat-notification-default) contained an issue reference and thus tried to retrieve the referenced issue to then pre-fill the MR title with Resolves "Issue title".

Judging by the comment a few lines above, GitLab should not even try to do so:

Setting the title as 'Resolves "Emoji don't show up in commit title"' if there is more than one commit in the MR

This MR makes sure the "Resolves ..." code is only run when no other suggestion for the title has been made.

Are there points in the code the reviewer needs to double check?

Is the comment still describing the intended behavior?

Why was this MR needed?

I missed the very useful behavior of extracting the title and message from branches containing just a single commit which worked flawlessly in other projects.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Possibly related to #27935 (moved).

Edited by Franz Liedke

Merge request reports