Wrong date format for created_at and updated_at for merge_request webhook events
Summary
The Gitlab webhook can send events of type merge_request. The problem is that the created_at and updated_at fields within the object_attributes property have a wrong format. The documentation says the format should be '2013-12-03T17:23:34Z', while the actual format is '2013-12-03 17:23:34 UTC'. Other events, like issue events, does give back these fields in the right format.
Steps to reproduce
- Create a webhook for Gitlab on group level
- Subscribe for merge request events
- Trigger a merge request
- The received event will have a wrong format for the created_at and updated_at fields in object_attributes
- Manually sending a merge request event via the 'Test' button on the webhooks page will give back a date in the right format
Example Project
Not relevant
What is the current bug behavior?
Wrong format of date for the two fields
What is the expected correct behavior?
Expected is the ISO8601 format for the two date fields.
Relevant logs and/or screenshots
Actual:
{
"object_kind": "merge_request",
"event_type": "merge_request",
...
"object_attributes": {
"created_at": "2020-10-06 15:27:18 UTC",
"updated_at": "2020-10-06 15:27:18 UTC",
...
},
...
}
Expected (from 'Test' button on webhook page):
{
"object_kind": "merge_request",
"event_type": "merge_request",
...
"object_attributes": {
"created_at": "2019-10-03T10:18:20.705Z",
"updated_at": "2019-10-03T10:19:26.484Z",
...
},
...
}
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Not relevant
Results of GitLab application Check
Not relevant
Possible fixes
Fix the date format