Web editor commit messages do not match commit message expressions with new lines
Summary
This bug is specific to the validate commit messages feature and the Web Editor (not the IDE).
If you have configured regex requiring commit messages to contain a new line, a commit message that is valid when sent via the Web IDE or via the command line will fail if sent from the Web Editor specifically, stating:
13:update reference: running pre-receive hooks: GitLab: Commit message does not follow the pattern '(?i)Description:\n(.|\n)+|merge\s.*'.
This only seems to occur if the regex requires new lines within the commit. I was not able to reproduce this otherwise.
Steps to reproduce
In a testing project:
- Go to the project's Settings >> Repository >> Push Rules area and add the following regex to the "Require expression in commit messages" field:
(?i)Description:\n(.|\n)+|merge\s.*
(make sure to click save after) - Next, browse to a file via the UI and click Edit >> Edit single file
- In the Web Editor, add characters to the file in question and use the commit message beneath these steps. Attempt to push this commit and you will observe an error stating the commit message doesn't match the specified regex.
- Edit the same file locally or via the Web IDE and use the same commit message - the commit will pass validation and be successful.
Commit message:
Description:
This is a test.
What is the current bug behavior?
Commit messages that match the required commit regex fail when sent via the Web Editor.
What is the expected correct behavior?
Commit messages that match the required commit regex pass when sent via the Web Editor.
Output of checks
This bug happens on GitLab.com