Hook response differs from documentation in 10.1.0
Summary
The hook response, that is send by GitLab for "project_created" seems to be different. hook_data["project_visibility"] responses with visibilitylevel|private, instead of just private. So either the documentation would need to be updated or the response needs to be changed
Steps to reproduce
- Run the GitLab docker container
- Register a webhook with your application
- Create a new project with visibility level private (public, internal would also work but just for this example)
- Look at the hook_data that is send by GitLab, if event_name equals "project_create"
- You will notice that the project_visibility value is "visibilitylevel|private", instead of just "private" like it is documented here: https://docs.gitlab.com/ee/system_hooks/system_hooks.html
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behaviour, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug has been fixed in a more recent version)
What is the current bug behavior?
This is returned by the GitLab system hook
{
"project_id":6,
"created_at":"2017-10-26T09:02:01Z",
"name":"fgfegrw",
"owner_email":"admin@example.com",
"updated_at":"2017-10-26T09:02:01Z",
"event_name":"project_create",
"owner_name":"Administrator",
"project_visibility":"visibilitylevel|private", <-- notice this
"path_with_namespace":"root/fgfegrw",
"path":"fgfegrw"
}
What is the expected correct behavior?
See documentation here: https://docs.gitlab.com/ee/system_hooks/system_hooks.html
{
"created_at": "2012-07-21T07:30:54Z",
"updated_at": "2012-07-21T07:38:22Z",
"event_name": "project_create",
"name": "StoreCloud",
"owner_email": "johnsmith@gmail.com",
"owner_name": "John Smith",
"path": "storecloud",
"path_with_namespace": "jsmith/storecloud",
"project_id": 74,
"project_visibility": "private" <-- Notice the difference
}
Possible fixes
Fix documentation here: https://docs.gitlab.com/ee/system_hooks/system_hooks.html