6
votes

I'm trying out a local version of Jenkins. Everything is at the latest possible version. I've installed the GitHub Pull Request Builder, but I am unable to get it to report the build status back to GitHub and update the PR with SUCCESS, FAILURE or ERROR.

I have performed the following steps:

  • Manage Jenkins > Configure System > Github Pull Request Builder : I've added my Credentials and performed all tests successfully:
    • Test basic connection to GitHub -> works
    • Test Permissions to a Repository -> works
    • Test adding comment to Pull Request -> works
    • Test updating commit status -> works

I then created a new job with the following settings:

Jenkins Screenshot

However, I am unable to get Jenkins to update the GitHub PR when doing a build at all. The build is correctly reported as success or fail in Jenkins, but nothing makes it back to GitHub.

Note that I am building manually, and not via the "Use github hooks for build triggering". I assume that this doesn't make a difference?

2
As far as i understand, this plugin will only get into effect when the trigger is actually used. And i think this is working as intended, you dont want your manual runs all get pushed to your github, it only should get added when the build is in response to a pull request. Can't you test it by issueing a pull request yourself? Here is some how to i found interesting. Maybe its useful to you.Dominik Gebhart
@DominikGebhart you are 100% correct! If you would like to add this as an answer, I'd be happy to give you the pointsJonoB

2 Answers

3
votes

This plugin will only get into effect when the trigger is actually used.

And i think this is working as intended, you dont want your manual runs all get pushed to your github, it only should get added when the build is in response to a pull request.

You should be able to test it by issuing a pull request yourself. Also, here is some how-to i found interesting.

0
votes

You should consider checking out instructions provided at official page https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin in paragraph "Creating job:"

The crucial point is to properly setup "refspec" and "branch specifier" fields.

Under Advanced, set "refspec" to
+refs/pull/*:refs/remotes/origin/pr/*
In "Branch Specifier", enter
${sha1}
or if you want to use the actual commit in the pull request, use
${ghprbActualCommit}

The plugin is based on some parameters to the job that you are [probably] not providing when you are triggering it manually.