github-integration-plugin icon indicating copy to clipboard operation
github-integration-plugin copied to clipboard

Pull Request review Triggering

Open vermasumeet1982 opened this issue 8 years ago • 38 comments

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

screen shot 2016-12-09 at 17 33 58 screen shot 2016-12-09 at 17 34 17
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)

vermasumeet1982 avatar Dec 09 '16 17:12 vermasumeet1982

Did you set github project job property?

KostyaSha avatar Dec 09 '16 17:12 KostyaSha

Thanks for prompt reply. Can you point out where do I set it?

vermasumeet1982 avatar Dec 09 '16 17:12 vermasumeet1982

https://github.com/KostyaSha/github-integration-plugin/blob/master/docs/Configuration.adoc

KostyaSha avatar Dec 09 '16 17:12 KostyaSha

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

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

Display name unrelated. And did you set global user that has access to your repo?

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

yes. if i trigger the job manually it works. So I know the credentials are working

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

git credentials unrelated, Trigger has repoprovider that searches for gh connection. It uses global settings....

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

ok let me check

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

You need login under user and check that it has no pending invintations.

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

the credentials I am using to access the repo is under Jenkins (global) domain and it has no pending invitations

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

Ah, it fails create repository for job... Is it new job or existed?

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

new

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

Maybe connection was bad and cached #175 ... will do release now

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

cool. let me know when done, I will upgrade the plugin and run it again

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

when will the update be available via Jenkins Plugin Manager?

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

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.

KostyaSha avatar Dec 09 '16 18:12 KostyaSha

0.1.0-rc17 installed. That exception is gone but trigger still not occuring

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

should i check or uncheck cache connection in github plugin repository provider?

vermasumeet1982 avatar Dec 09 '16 18:12 vermasumeet1982

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?

KostyaSha avatar Dec 09 '16 19:12 KostyaSha

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

vermasumeet1982 avatar Dec 09 '16 19:12 vermasumeet1982

is the refspec and branch to build in above screenshots correct?

vermasumeet1982 avatar Dec 09 '16 19:12 vermasumeet1982

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?

KostyaSha avatar Dec 09 '16 19:12 KostyaSha

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

vermasumeet1982 avatar Dec 09 '16 19:12 vermasumeet1982

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

vermasumeet1982 avatar Dec 09 '16 19:12 vermasumeet1982

Thanks, will reply with screenshots, busy atm

KostyaSha avatar Dec 09 '16 19:12 KostyaSha

thanks

vermasumeet1982 avatar Dec 09 '16 19:12 vermasumeet1982

github-project-property Must be specified

KostyaSha avatar Dec 11 '16 18:12 KostyaSha

And global settings should be set as described in github-plugin screenshot 2016-12-11 21 10 49

KostyaSha avatar Dec 11 '16 18:12 KostyaSha

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.

vermasumeet1982 avatar Dec 12 '16 10:12 vermasumeet1982

disable SCM, it not needed for triggering.

KostyaSha avatar Dec 12 '16 10:12 KostyaSha