[go: up one dir, main page]

Skip to content

Commit message error is not human friendly

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

Require expression in commit messages in Push rules doesn't allow for a custom error message. The error message is a regex pattern and that is not user-friendly.
We would like to write our own error message to explain what's wrong and provide examples.

Steps to reproduce

  1. Set-up a regex pattern in Require expression in commit messages in Push rules. For example, ^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(?:\([a-zA-Z->]*\))?: Push rules
  2. Try to commit with a commit message that doesn't comply with the regex pattern.
  3. You should see an error message that says Unexpected error and then states the regex pattern. Gitlab Web IDE

Example Project

What is the current bug behavior?

The error message for non-compliant commit message is not editable and is not user-friendly by default.

What is the expected correct behavior?

The error message is editable or user-friendly by default.

Relevant logs and/or screenshots

Gitlab Web IDE

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Edited by 🤖 GitLab Bot 🤖