Hooks that check email break GitLab automated git actions
ZD Reference: https://gitlab.zendesk.com/agent/tickets/27208
Having a hook that verifies the identity of the committer based on either name or email breaks features such as the "Rebase" button.
This is due to the fact that the git_user
has a git_user_email
value that doesn't match any of the DB users.
The customer reported the following:
We have a project that we're trying to use the "rebase" button and it appears nothing happens. We looked at the logs and found:
June 15, 2016 14:20 -> ERROR -> Failed to push rebased branch:
June 15, 2016 14:20 -> ERROR -> remote: GitLab: Committer 'gitlab@xxx.yyy' is not a member of team XX /var/opt/gitlab/git-data/repositories/xxxxxxxx/xxxxxxxx.git ! [remote rejected] xxxxxxxx/xxxxxxxx -> xxxxxxxx/xxxxxxxx (pre-receive hook declined) error: failed to push some refs to '/var/opt/gitlab/git-data/repositories/xxxxxxxx/xxxxxxxx
The default "GitLab" user found on our server isn't a user in GitLab so our validation is failing (since it's turned on). Disabling this validation process isn't an option, either.
Looking at
/etc/gitlab/gitlab.rb
, there is a line that states:
# user['git_user_email'] = "gitlab@#{node['fqdn']}"
How can we handle this better? Any ideas?