Some regex on push rules commit message prevents all merge from web UI
Summary
Some regex for push rules on commit message works while pushing in a branch but don’t works when merging a merge request from GitLab UI. For example the regex \A(\d{2})/(\d{2}).* Allows the following commit message when a commit and push is done on a Branch “[06/18] Super Feature
First imp of a super feature” But return an error when passed in the Merge view.
- Client side: Something went wrong during merge pre-receive hook
- Server side:
MergeService ERROR: myProject/myProject!23 - GitLab: Commit message does not follow the pattern '\A(\d{2})/(\d{2}).*'
MergeService ERROR: myProject/myProject!23 - Something went wrong during merge pre-receive hook
Steps to reproduce
In any project.
- Go to Settings -> Repository -> Push Rules add the regex \A(\d{2})/(\d{2}).* in the commit message part. Save
- Create a branch in your project
- Commit and Push something on the branch with a message that match de regex pattern ex. [06/18] myMessage
- Create a merge request with you branch
- Do the Merge with a modification of the default commit message. Put a message that match the regex.
What is the current bug behavior?
Merge is rejected
What is the expected correct behavior?
Merge should be accepted
Possible fixes
This issue is probably related with the following https://gitlab.com/gitlab-org/gitlab-ee/issues/576