Can't create webhooks via Api for build events.
Summary
Based on Api documentation I can't actually create a webhook for a project that listens to build events. I think this relates to EE and CE. I'm reproing this on gitlab.com.
The api documentation refers to job_events, but get requests on webhooks I created via the gitlab.com UI using the JOB EVENTS checkbox return build_event: true.
{
"wiki_page_events": false,
"pipeline_events": false,
"build_events": true,
"note_events": false,
"merge_requests_events": false,
"issues_events": false,
"project_id": ****,
"enable_ssl_verification": true,
"tag_push_events": false,
"push_events": false,
"created_at": "2017-04-03T07:22:31.869Z",
"url": "****",
"id": ****
}
However if I try to post using the api and including the build_events=true parameter.
{
"error": "build_events is invalid"
}
If I include job_events=true then I get a 201 response, but build_events is not set to true in the GET request, and the UI doesn't include build events being sent to the webhook.
{
"wiki_page_events": false,
"pipeline_events": false,
"build_events": false,
"note_events": false,
"merge_requests_events": false,
"issues_events": false,
"project_id": ****,
"enable_ssl_verification": true,
"tag_push_events": false,
"push_events": false,
"created_at": "2017-04-03T21:14:41.329Z",
"url": "****",
"id": ****
}
Steps to reproduce
Perform a Post request to the hooks endpoint and expect to be able to set the build_events flag.
What is the current bug behavior?
I'm blocked from being able to create webhooks appropriately via the api. Which is blocking my ability to create webhooks across multiple projects.
What is the expected correct behavior?
The ability to add webhooks via the api that include build_events
or job_events
. Whatever the name is for receiving messages on a per execution within the ci.
Output of checks
This bug happens on GitLab.com
Possible fixes
Not exactly sure all the places that would need to be updated, but this looks like it needs to be updated to job_events: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/lib/api/project_hooks.rb#L16