Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins github pull request builder plugin is not posting to github

I have configured the Jenkins Github Pull-Request builder plugin to build every pull-request made by members of my institution. It works like a charm.

However, the build is not reporting the build status back to github like it shows in this nice post. I also tried checking the box to "Use comments to report results when updating commit status fails", but still I get nothing back on github.

I have created a bot user on GitHub and given it push and administrative rights to the repo.

My Jenkins server is behind a firewall, but since it is building normally and detecting changes (by polling) to the github repo, I assume this is not the issue.

Anyone else had this issue? How did you solve it?

Here is a dump of my console output (compressed for readability)

Started by an SCM change
Building in workspace 
Fetching changes from the remote Git repository
Fetching upstream changes from repo
Seen branch in repository origin/HEAD
Seen branch in repository origin/master
Seen branch in repository origin/pr/1/head
Seen branch in repository origin/pr/1/merge
Seen branch in repository origin/pr/10/head
[…]
Seen branch in repository origin/pr/9/head
Seen branch in repository origin/pr/9/merge
Seen 33 remote branches
Checking out Revision 9b4d45ee3a2d265a1268c2931e7b2bcb738e1c87 (origin/pr/16/merge)
First time build. Skipping changelog.
...found 160 targets...
...updating 21 targets...
**passed** test/bin/test.test/gcc-4.8.1/debug/test.test
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing BoostTest-1.x (default)
[xUnit] [INFO] - Check 'Failed Tests' threshold.
[xUnit] [INFO] - Check 'Skipped Tests' threshold.
[xUnit] [INFO] - Setting the build status to SUCCESS
[xUnit] [INFO] - Stopping recording.
Finished: SUCCESS
like image 318
Carneiro Avatar asked Nov 22 '13 05:11

Carneiro


People also ask

How do I upload a pull request to GitHub?

To attach a file to an issue or pull request conversation, drag and drop it into the comment box. Alternatively, you can click the bar at the bottom of the comment box to browse, select, and add a file from your computer.

How do I pull from Jenkins to GitHub?

Step 1: go to your GitHub repository and click on 'Settings'. Step 2: Click on Webhooks and then click on 'Add webhook'. Step 3: In the 'Payload URL' field, paste your Jenkins environment URL. At the end of this URL add /github-webhook/.

How do I trigger a Jenkins job on a pull request?

For Jenkins to receive PR events through the pull request plugin, you need to add the Jenkins pull request builder payload URL in the Github repository settings. If you need just the PR triggers, you can select the “Let me select individual events” option and select just the “Pull requests” option.


1 Answers

After looking at Jenkins LOGS I learned a few things :

  1. This plugin (github pull-request builder) fully replaces all the other build-triggers (including git and SCM poll). I was using all three, and when I thought this plugin was working because it was building correctly, was actually the other triggers.
  2. You must set your project github URL on the github plugin. This plugin depends on the github plugin to work. This is what was preventing it from working in my configuration.

After you fix #2, you can remove the triggers from SCM Poll and Git to make sure the pull-request plugin is triggering the build. When it does, it actually adds a link to the pull request to the activity feed in Jenkins (very nice) and updates the status on github correctly.

like image 163
Carneiro Avatar answered Sep 19 '22 13:09

Carneiro