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

Push events webhook not working [SOLVED] #54

Closed
alloveras opened this issue May 15, 2016 · 2 comments
Closed

Push events webhook not working [SOLVED] #54

alloveras opened this issue May 15, 2016 · 2 comments
Assignees

Comments

@alloveras
Copy link

alloveras commented May 15, 2016

Good afternoon,
I've been playing with strider-gitlab plugin today and I realized that the webhook for receiveing push events is not working properly. The thing was that when I pushed a new commit to my Gitlab repository strider didn't receive the HTTP request on the webhook URL and, in consequence, any of my builds were automatically triggered.

However, after some time of research across the plugin's code I found that the endpoint that strider-gitlab is implementing is a POST endpoint located at http://yourdomain.com/yourproject/api/gitlab/webhook. Firstly, that seemed normal to me but lately I discovered that Gitlab.com is sending a GET HTTP requests instead of POST ones to the WebHook URL making my continuous integration server to produce a Page Not Found response.

My solution to the problem was to replace the following lines of webapp.js file:

// gitlab should hit this endpoint
app.anon.post('/webhook', webhooks.receiveWebhook.bind(null, context.emitter));    

For the following ones:

// gitlab should hit this endpoint
app.anon.get('/webhook', function (req,res){
    webhooks.receiveWebhook(context.emitter,req, res);
});

Hope that this post can help anyone else that is experimenting the same trouble.

Albert

@knownasilya knownasilya self-assigned this May 15, 2016
@knutanderss
Copy link

+1

@knownasilya
Copy link
Member

Should be solved, please update your plugin to v1.2.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants