Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitlab webhook for multiple event types #678

Closed
rossigee opened this issue May 30, 2020 · 1 comment · Fixed by #696
Closed

Gitlab webhook for multiple event types #678

rossigee opened this issue May 30, 2020 · 1 comment · Fixed by #696
Assignees
Labels
enhancement New feature or request

Comments

@rossigee
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, we can only configure a Gitlab webhook for one specific event type.

Describe the solution you'd like
I'd like to be able to configure a webhook that accepts all the event types.

Describe alternatives you've considered
N/A

Additional context
Gitlab's API and the upstream 'go-gitlab' library seem to allow you to specify multiple events by passing 'true' for multiple boolean event type attributes...

https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794

So, we need something like this...

diff --git a/pkg/apis/eventsources/v1alpha1/types.go b/pkg/apis/eventsources/v1alpha1/types.go
index bb2817e..134a348 100644
--- a/pkg/apis/eventsources/v1alpha1/types.go
+++ b/pkg/apis/eventsources/v1alpha1/types.go
@@ -376,9 +376,9 @@ type GitlabEventSource struct {
        Webhook *webhook.Context `json:"webhook" protobuf:"bytes,1,name=webhook"`
        // ProjectId is the id of project for which integration needs to setup
        ProjectId string `json:"projectId" protobuf:"bytes,2,name=projectId"`
-       // Event is a gitlab event to listen to.
+       // Events are which gitlab events to listen to.
        // Refer https://github.com/xanzy/go-gitlab/blob/bf34eca5d13a9f4c3f501d8a97b8ac226d55e4d9/projects.go#L794.
-       Event string `json:"event" protobuf:"bytes,3,name=event"`
+       Events []string `json:"event" protobuf:"bytes,3,name=event"`
        // AccessToken is reference to k8 secret which holds the gitlab api access information
        AccessToken *corev1.SecretKeySelector `json:"accessToken" protobuf:"bytes,4,name=accessToken"`
        // EnableSSLVerification to enable ssl verification
@VaibhavPage
Copy link
Contributor

It will be added in v0.16.0

@VaibhavPage VaibhavPage self-assigned this Jun 11, 2020
@VaibhavPage VaibhavPage added the enhancement New feature or request label Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants