-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
WebHook on GitLab does not work #11002
Comments
As I know there is a event within GitLab request header named 'X-Gitlab-Event', may be we need to add support for it. a refer is gitlabhq/gitlabhq#8644. Find the code in ./pkg/build/webhook/github/github.go, maybe we can fix it as following changs: func getEvent(header http.Header) string {
event := header.Get("X-GitHub-Event")
if len(event) == 0 {
event = header.Get("X-Gogs-Event")
}
if len(event) == 0 {
event = header.Get("X-Gitlab-Event")
}
return event
} I will test it and push it later. |
@vanloswang You should use generic webhook on OpenShift for GitLab |
@jorgemoralespou assuming gitlab is matching the github payload, using the github webhook makes sense given all the data we pull off of it. if gitlab is not matching the github payload then i agree, this is not going to work and shouldn't be merged... i was just assuming it was. perhaps a mistake. |
@bparees Didn't see the PR, just saw the issue and my comment was to confirm that GitHub triggers did not work with GitLab and generic webhook was needed. As if the linked PR does fixes that, then I'm happy to have it merged it. |
@bparees @jorgemoralespou With this commit, the webhook on gitlab is work well for me now. Both test push on gitlab and git push command will make Origin to auto build the container image. |
i used generic webhook still got 400 error "Hook executed successfully but returned HTTP 400 {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"missing X-GitHub-Event or X-Gogs-Event","reason":"BadRequest","code":400}" |
Environment is similar to #10986, just replace Gogs to GitLab, The GitLab server is deployed in a CentOS 7 VM.
Click 'Test Hook' and it returns an error, the error info is as following:
It seems like the webhook communication is ok now, but the request header does not contain the key and value for X-GitHub-Event or X-Gogs-Event. So how to let origin works together with GitLab?

The GitLab version is gitlab-ce-8.5.1-ce.0.el7.x86_64 and the settings on GitLab is as following:
Version
Origin 1.2
Steps To Reproduce
Current Result
failed and show me:
Expected Result
success
The text was updated successfully, but these errors were encountered: