Deploy key with write access fails on push rules
Summary
Prior to Gitlab 12.0, a deploy key with write access was not affected by push rules "Committer restriction" and "Check whether author is a Gitlab user". Currently it is impossible to push a commit via deploy key with either of these rules active.
Steps to reproduce
- Create a new empty project
- Create a deploy key with write access
- Commit and push a CI setup that pushes a commit in it's pipeline (see example project)
- Start a new pipeline (it should pass)
- Enable either combination of "Committer restriction" and "Check whether author is a Gitlab user"
- Start a new pipeline (it should fail)
Example Project
https://gitlab.com/csvn/deploy-key-push-rule-issues-reproduction
What is the current bug behavior?
Push fails with "remote: GitLab: You cannot push commits for 'xxx@yyy.zzz'. You can only push commits that were committed with one of your own verified emails." or "remote: GitLab: Author 'xxx@yyy.zzz' is not a member of team"
What is the expected correct behavior?
Push should succeed without errors
Relevant logs and/or screenshots
https://gitlab.com/csvn/deploy-key-push-rule-issues-reproduction/-/jobs/270723700
https://gitlab.com/csvn/deploy-key-push-rule-issues-reproduction/-/jobs/270731960
Output of checks
This bug happens on GitLab.com (12.2.0-pre 0874a8d346c)