rht-labs / labs-ci-cd

👻UNMAINTAINED - A collection of Red Hat Open Innovation Labs CI/CD components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webhooks for PR Builds

pcarney8 opened this issue · comments

Our Jenkinsfile needs to be kicked off and get information from the GitHub PR Webhook: https://developer.github.com/v3/activity/events/types/#pullrequestevent

Currently that is not supported in OCP for multibranch or github specific webhooks. It appears that using a generic webhook is possible, but would require something to translate it: openshift/origin#13970 (comment)
their reasoning here: openshift/origin#15455 (comment)

The other option is to go directly to Jenkins and use something like this: https://github.com/jenkinsci/generic-webhook-trigger-plugin/

they way we handled it with hf was to with an app that took accepted the webhook and update / invoked the PR / MR pipeline config.

There is also this card in trello that is getting a bit stale https://trello.com/c/ucGKOKnt/1158-5-support-folders-organization-folders-and-multibranch-pipelines-pipelineintegration-evg

@mcanoy cool, sounds the "translate it" solution. Hmm yeah that was moved to devtools candidates in July it looks like.

Have you tried the generic-webhook-trigger-plugin with GH webhooks? i haven't tried that yet, but it looked promising.

I haven't tried it. Looks interesting but seems like there still has to be something in the middle to get the ref or commit value set, right? I am assuming if that was changed to the value we wanted - the pr - then it will build that instead of the ref that is in the pipeline bc.

git:
  uri: "<url to git repository>"
  ref: "<optional git reference>"
  commit: "<commit hash identifying a specific git commit>"
  author:
    name: "<author name>"
    email: "<author e-mail>"
  committer:
    name: "<committer name>"
    email: "<committer e-mail>"
  message: "<commit message>"
env: 
   - name: "<variable name>"
     value: "<variable value>"