github-integration-plugin
github-integration-plugin copied to clipboard
Pull Request review Triggering
Hello I have been trying to get the build trigger when I comment on pull request to work. Attached are the job configurations. I know I am getting the webhooks from github because I can see that in Jenkins logs and also the github push event is working.
Also pasted below is jenkins log around an exception thrown when pull request review comment event is received. I have tried everything to make this work but not sure what the problem is. I think there is a bug in the plugin


Bad configured project qa_pipeline_step1 - Can't get remote GH repo for qa_pipeline_step1
java.lang.IllegalStateException: Can't get remote GH repo for qa_pipeline_step1
at com.google.common.base.Preconditions.checkState(Preconditions.java:172)
at com.github.kostyasha.github.integration.generic.GitHubTrigger.getRemoteRepository(GitHubTrigger.java:156)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.forProject(GitHubPRRepositoryFactory.java:63)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.createFor(GitHubPRRepositoryFactory.java:36)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.createFor(GitHubPRRepositoryFactory.java:27)
at hudson.model.Actionable.createFor(Actionable.java:107)
at hudson.model.Actionable.getAllActions(Actionable.java:98)
at hudson.model.Actionable.getAction(Actionable.java:165)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.doRun(GitHubPRTrigger.java:216)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.run(GitHubPRTrigger.java:173)
at hudson.triggers.Trigger.checkTriggers(Trigger.java:278)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:226)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Dec 09, 2016 5:25:01 PM WARNING org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger doRun
Can't get repository info, maybe project qa_pipeline_step1 misconfigured?
Dec 09, 2016 5:27:01 PM SEVERE org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory createFor
Bad configured project qa_pipeline_step1 - Can't get remote GH repo for qa_pipeline_step1
java.lang.IllegalStateException: Can't get remote GH repo for qa_pipeline_step1
at com.google.common.base.Preconditions.checkState(Preconditions.java:172)
at com.github.kostyasha.github.integration.generic.GitHubTrigger.getRemoteRepository(GitHubTrigger.java:156)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.forProject(GitHubPRRepositoryFactory.java:63)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.createFor(GitHubPRRepositoryFactory.java:36)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRRepositoryFactory.createFor(GitHubPRRepositoryFactory.java:27)
at hudson.model.Actionable.createFor(Actionable.java:107)
at hudson.model.Actionable.getAllActions(Actionable.java:98)
at hudson.model.Actionable.getAction(Actionable.java:165)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.doRun(GitHubPRTrigger.java:216)
at org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger.run(GitHubPRTrigger.java:173)
at hudson.triggers.Trigger.checkTriggers(Trigger.java:278)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:226)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:50)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Did you set github project job property?
Thanks for prompt reply. Can you point out where do I set it?
https://github.com/KostyaSha/github-integration-plugin/blob/master/docs/Configuration.adoc
Yes that is done with the Git repository name and I know it works if I trigger the job manually. The display name field is empty
Display name unrelated. And did you set global user that has access to your repo?
yes. if i trigger the job manually it works. So I know the credentials are working
git credentials unrelated, Trigger has repoprovider that searches for gh connection. It uses global settings....
ok let me check
You need login under user and check that it has no pending invintations.
the credentials I am using to access the repo is under Jenkins (global) domain and it has no pending invitations
Ah, it fails create repository for job... Is it new job or existed?
new
Maybe connection was bad and cached #175 ... will do release now
cool. let me know when done, I will upgrade the plugin and run it again
when will the update be available via Jenkins Plugin Manager?
release in process, if you install Jucies update center it should appear very fast: my release, checkbox on github, build on jitpack and available in jucies. In main jenkins update center it appears only tomorrow.
0.1.0-rc17 installed. That exception is gone but trigger still not occuring
should i check or uncheck cache connection in github plugin repository provider?
Cache makes sense only if it found wrong connection. How much users do you have in global settings? Did you restart your jenkins? Do you have anything in global jenkins log?
yes I did restart. I did get this after some time at the end of the event
Stopping 'Build GitHub Pull Requests' for project 'qa_pipeline_step1'
Dec 09, 2016 6:58:32 PM INFO org.jenkinsci.plugins.github.pullrequest.GitHubPRTrigger start
Starting GitHub Pull Request trigger for project qa_pipeline_step1
So something happened but job didn't trigger. I have removed the refspec for testing and specified a fix branch in branch specifier just for test purpose
is the refspec and branch to build in above screenshots correct?
You can even not specify git at all. Trigger self containing. What is written in "polling log" when you manually press run trigger from "github PRs" page?
sorry was this "You can even not specify git at all." a question? I don't understand what u mean by manually press trigger from"github PR" page? Do you mean writing a comment on the PR?
Should I email you the log to your gmail address? And by log I mean the Jenkins System Log. Nothing is appearing in the github hook log on the job page
ok I need to go now. Its very late on friday evening. I will check pick this up again on Monday. Have a good weekend and thanks for your help
Thanks, will reply with screenshots, busy atm
thanks
Must be specified
And global settings should be set as described in github-plugin
hello @KostyaSha both these settings are specified correctly (is checking manage hooks mandatory? I am not managing webhooks from jenkins). I know jenkins is receiving webhooks because I can see the packets in the jenkins log. Can you also screenshot the refspec. I want to confirm I have specified the branch and refspec correctly.
disable SCM, it not needed for triggering.