user_email field in Webhook Requests is incorrect and inconsistent
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
The user_email
field in Webhook Requests is incorrect and inconsistent.
Steps to reproduce
- Create a webhook for push events
- Create a Project Access Token
- Perform a push event using the Token
- Perform a push event using GitLab account
- Review Recent Event details for the webhook
Example Project
What is the current bug behavior?
When using a Project Access Token, user_email
is null
, while for an action performed with a human account, the value is ""
.
What is the expected correct behavior?
The user_email
should be populated with a string containing the email address. For Bot accounts, this should be the Bot Email.
Relevant logs and/or screenshots
{
"object_kind": "push",
"event_name": "push",
"before": "9da54cec13753d1aabdffba07bdedbf9581ccd2c",
"after": "c92eaf6b85edf8ed8e3e0b18849811e96b38d933",
"ref": "refs/heads/appflow",
"checkout_sha": "c92eaf6b85edf8ed8e3e0b18849811e96b38d933",
"message": null,
"user_id": 13632652,
"user_name": "GitBot",
"user_username": "project_43153858_bot",
"user_email": null,
"user_avatar": "https://secure.gravatar.com/avatar/fc6c934ae371500eade684de4972e628?s=80&d=identicon",
"project_id": 43153858,
...
{
"object_kind": "push",
"event_name": "push",
"before": "b74fade0e7e70d4ef765ea4c54b7622f31f773e1",
"after": "a7da71597c2adb972cf4a72adbe174389d917585",
"ref": "refs/heads/main",
"checkout_sha": "a7da71597c2adb972cf4a72adbe174389d917585",
"message": null,
"user_id": 11008925,
"user_name": "Miguel",
"user_username": "miguel7234",
"user_email": "",
"user_avatar": "https://gitlab.com/uploads/-/system/user/avatar/11008925/avatar.png",
"project_id": 43153858,
...
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 🤖