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

Notification from the notification API #72

Open
mrmanc opened this issue May 16, 2016 · 5 comments
Open

Notification from the notification API #72

mrmanc opened this issue May 16, 2016 · 5 comments

Comments

@mrmanc
Copy link

mrmanc commented May 16, 2016

Hello

I was wondering whether this plugin hooks in to the Go Notification API (https://api.go.cd/current/#notify-git-materials) to accept published Git events? Or does it always have to poll the GitHub server to work out when a new commit / pull request has happened?

Thanks

@ashwanthkumar
Copy link
Owner

@mrmanc AFAIK no. From the docs here, I don't know how to hook into it as well.

cc: @arvindsv

@arvindsv
Copy link

I took a quick look at the code, and it looks like any pluggable SCM material should be able to use the post commit hook (but in a specific way). The endpoint should be:

POST /go/api/material/notify/scm

The param expected is scm_name and it is matched against the name of the material, in the SCM config. So, the curl is probably something like this (untested):

curl 'https://ci.example.com/go/api/material/notify/scm' \
      -u 'username:password' \
      -H 'Confirm: true' \
      -X POST \
      -d 'scm_name=your-materials-name'

Can you see if that works?

I don't think that will allow you to directly connect a GitHub webhook to GoCD, because of the expectation of the header (Confirm) and the data parameter (scm_name), but it might be a start towards what @mrmanc mentioned in gocd/gocd#217 (comment).

@mrmanc
Copy link
Author

mrmanc commented May 17, 2016

Thanks @ashwanthkumar, @arvindsv. Cool, so I understand from that that if we find a way to transform GitHub webhooks into GoCD notifications, then we can use this plugin without generating any more polling activity. Awesome :) I think that wraps up this issue… further discussion can happen in gocd/gocd#217 (comment).

@hubx
Copy link

hubx commented Nov 6, 2020

gocd/gocd#217 is closed and we use /go/api/webhooks/github/notify successfully to trigger all our pipelines on our project. We wanted to try PR builds with this cool plugin. However they are only built if we re-enable polling for the Github SCM again.

What do we need to to do to have PR builds working with github webhooks only and without polling? (Polling is limited by our Github Enterprise team)

@arvindsv
Copy link

arvindsv commented Nov 6, 2020

gocd/gocd#8170 finished a few days ago and to be released in 20.9.0 might be relevant.

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

4 participants