Giter VIP home page Giter VIP logo

ghprb-plugin's Introduction

GitHub Pull Request Builder Plugin

This Jenkins plugin builds pull requests from GitHub and will report the results directly to the pull request via the GitHub Commit Status API

When a new pull request is opened in the project and the author of the pull request isn't whitelisted, builder will ask Can one of the admins verify this patch?. One of the admins can comment ok to test to accept this pull request for testing, test this please for one time test run and add to whitelist to add the author to the whitelist.

If an author of a pull request is whitelisted, adding a new pull request or new commit to an existing pull request will start a new build.

A new build can also be started with a comment which contains, retest this please; with or without additional lines in the comment. A review summary comment will not start a new build.

You can extend the standard build comment message on github creating a comment file from shell console or any other jenkins plugin. Contents of that file will be added to the comment on GitHub. This is useful for posting some build dependent urls for users without access to the jenkins UI console.

Jobs can be configured to only build if a matching comment is added to a pull request. For instance, if you have two job you want to run against a pull request, a smoke test job and a full test job, you can configure the full test job to only run if someone adds the comment full test please on the pull request.

For more details, see https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin

Build status:

Build Status

Required Jenkins Plugins:

Pre-installation:

  • I recommend to create GitHub 'bot' user that will be used for communication with GitHub (however you can use your own account if you want).
  • The user needs to have push rights for your repository (must be collaborator (user repo) or must have Push & Pull rights (organization repo)).
  • If you want to use GitHub hooks have them set automatically the user needs to have administrator rights for your repository (must be owner (user repo) or must have Push, Pull & Administrative rights (organization repo))

Installation:

  • Install the plugin.

  • Go to Manage Jenkins -> Configure System -> GitHub Pull Request Builder section.

  • Add GitHub usernames of admins (these usernames will be used as defaults in new jobs).

  • Under Advanced, you can modify:

    • The phrase for adding users to the whitelist via comment. (Java regexp)
    • The phrase for accepting a pull request for testing. (Java regexp)
    • The phrase for starting a new build. (Java regexp)
    • The crontab line. This specify default setting for new jobs.
    • Github labels for which the build will not be triggered (Separated by newline characters)
  • Under Application Setup

    • There are global and job default extensions that can be configured for things like:
      • Commit status updates
      • Build status messages
      • Adding lines from the build log to the build result message
      • etc.
  • Save to preserve your changes.

Using Groovy

If you wish to configure your Jenkins master using Groovy, you can use a script such as the one below to configure the plugin:

import jenkins.model.*
import org.jenkinsci.plugins.ghprb.*

GhprbTrigger.DescriptorImpl descriptor = Jenkins.instance.getDescriptorByType(org.jenkinsci.plugins.ghprb.GhprbTrigger.DescriptorImpl.class)

List<GhprbGitHubAuth> githubAuths = descriptor.getGithubAuth()

String serverAPIUrl = 'https://api.github.com'
String jenkinsUrl = 'https://your.jenkins.url/'
String credentialsId = 'credentials-id'
String description = 'Anonymous connection'
String id = 'github-auth-id'
String secret = null
githubAuths.add(new GhprbGitHubAuth(serverAPIUrl, jenkinsUrl, credentialsId, description, id, secret))

descriptor.save()

Credentials

  • If you are using Enterprise GitHub set the Server API URL in GitHub Server API URL. Otherwise leave there https://api.github.com.
  • Set the Jenkins URL if you need to override the default (e.g. it's behind a firewall)
  • A GitHub API token or username password can be used for access to the GitHub API
  • To setup credentials for a given GitHub Server API URL:
    • Click Add next to the Credentials drop down
      • For a token select Kind -> Secret text
        • If you haven't generated an access token you can generate one in Test Credentials....
          • Set your 'bot' user's GitHub username and password.
          • Press the Create Access Token button
          • Jenkins will create a token credential, and give you the id of the newly created credentials. The default description is: serverAPIUrl + " GitHub auto generated token credentials".
      • For username/password use Kind -> Username with password
        • The scope determines what has access to the credentials you are about to create
      • The first part of the description is used to show different credentials in the drop down, so use something semi-descriptive
      • Click Add
    • Credentials will automatically be created in the domain given by the GitHub Server API URL field.
    • Select the credentials you just created in the drop down.
    • The first fifty characters in the Description are used to differentiate credentials per job, so again use something semi-descriptive
  • Add as many GitHub auth sections as you need, even duplicate server URLs

Creating a job:

  • Create a new job.
  • Add the project's GitHub URL to the GitHub project field (the one you can enter into browser. eg: https://github.com/janinko/ghprb)
  • Select Git SCM.
  • Add your GitHub Repository URL.
  • Under Advanced, set Name to origin and:
    • If you just want to build PRs, set refspec to +refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/*
    • If you want to build PRs and branches, set refspec to +refs/heads/*:refs/remotes/origin/* +refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/* (see note below about parameterized builds)
  • In Branch Specifier, instead of the default */master, enter
    • ${ghprbActualCommit} if you want to use the head of the pull request branch (e.g. refs/pull/4/head); or
    • ${sha1}, to use GitHub's tentative merge of the compare and base branches (e.g. refs/pull/4/merge) if the PR can be automatically merged or the head of the pull request branch (e.g. refs/pull/4/head) if they can not be automatically merged.
  • In the Pipeline SCM section, uncheck Lightweight checkout.
  • Under Build Triggers, check GitHub Pull Request Builder.
    • Add admins for this specific job.
    • If you want to use GitHub hooks for automatic testing, read the help for Use github hooks for build triggering in job configuration. Then you can check the checkbox.
    • In Advanced, you can modify:
      • The crontab line for this specific job. This schedules polling to GitHub for new changes in Pull Requests.
      • The whitelisted users for this specific job.
      • The organisation names whose members are considered whitelisted for this specific job.
  • Save to preserve your changes.

Make sure you DON'T have Prune remote branches before build advanced option selected, since it will prune the branch created to test this build.

Parameterized Builds

If you want to manually build the job, in the job setting check This build is parameterized and add string parameter named sha1 with a default value of master. When starting build give the sha1 parameter commit id you want to build or refname (eg: origin/pr/9/head).

Job DSL Support

Since the plugin contains an extension for the Job DSL plugin to add DSL syntax for configuring the build trigger and the pull request merger post-build action.

It is also possible to set Downstream job commit statuses when displayBuildErrorsOnDownstreamBuilds() is set in the upstream job's triggers and downstreamCommitStatus block is included in the downstream job's wrappers.

Here is an example showing all DSL syntax elements:

job('upstreamJob') {
    scm {
        git {
            remote {
                github('test-owner/test-project')
                refspec('+refs/pull/*:refs/remotes/origin/pr/*')
            }
            branch('${sha1}')
        }
    }

    triggers {
        githubPullRequest {
            admin('user_1')
            admins(['user_2', 'user_3'])
            userWhitelist('[email protected]')
            userWhitelist(['[email protected]', '[email protected]'])
            orgWhitelist('my_github_org')
            orgWhitelist(['your_github_org', 'another_org'])
            cron('H/5 * * * *')
            triggerPhrase('special trigger phrase')
            onlyTriggerPhrase()
            useGitHubHooks()
            permitAll()
            autoCloseFailedPullRequests()
            displayBuildErrorsOnDownstreamBuilds()
            whiteListTargetBranches(['master','test', 'test2'])
            blackListTargetBranches(['master','test', 'test2'])
            whiteListLabels(['foo', 'bar'])
            blackListLabels(['baz'])
            allowMembersOfWhitelistedOrgsAsAdmin()
            extensions {
                commentFilePath {
                    commentFilePath("relative/path/to/file")
                }
                commitStatus {
                    context('deploy to staging site')
                    triggeredStatus('starting deployment to staging site...')
                    startedStatus('deploying to staging site...')
                    addTestResults(true)
                    statusUrl('http://mystatussite.com/prs')
                    completedStatus('SUCCESS', 'All is well')
                    completedStatus('FAILURE', 'Something went wrong. Investigate!')
                    completedStatus('PENDING', 'still in progress...')
                    completedStatus('ERROR', 'Something went really wrong. Investigate!')
                }
                buildStatus {
                    completedStatus('SUCCESS', 'There were no errors, go have a cup of coffee...')
                    completedStatus('FAILURE', 'There were errors, for info, please see...')
                    completedStatus('ERROR', 'There was an error in the infrastructure, please contact...')
                }
            }
        }
    }
    publishers {
        mergeGithubPullRequest {
            mergeComment('merged by Jenkins')
            onlyAdminsMerge()
            disallowOwnCode()
            failOnNonMerge()
            deleteOnMerge()
        }
    }
}

job('downstreamJob') {
    wrappers {
        downstreamCommitStatus {
            context('CONTEXT NAME')
            triggeredStatus("The job has triggered")
            startedStatus("The job has started")
            statusUrl()
            completedStatus('SUCCESS', "The job has passed")
            completedStatus('FAILURE', "The job has failed")
            completedStatus('ERROR', "The job has resulted in an error")
        }
    }
}

Updates

See CHANGELOG

FAQ

See FAQ

Style Guide

See STYLE GUIDE

ghprb-plugin's People

Contributors

abridgett avatar arcivanov avatar benpatterson avatar bjoernhaeuser avatar daspilker avatar davidtanner avatar emanuelez avatar farmdawgnation avatar ffissore avatar hartzell avatar illyachekrygin avatar janinko avatar jasonkuster avatar jglick avatar jlebon avatar mdelapenya avatar memphiz avatar mmitche avatar olivergondza avatar praseodym avatar rholder avatar rsennewald avatar ryanwalls avatar samrocketman avatar sjstyle avatar taoistmath avatar thisguycodes avatar tlusk avatar udisch avatar valdisrigdon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghprb-plugin's Issues

Ignoring pull requests?

We have a tradition on our team of creating early pull requests for big features to solicit feedback. These PRs are incomplete, so triggering a build + running tests generates unnecessary noise (triggers emails, messages in Slack, etc). We mark these early pull requests with a pencil (โœŽ) or "WIP" in the title. Is there a way to have ghprb skip over these PRs until we've removed these markers?

v1.22: Commit status doesn't add a link to the build and is not set at the end

I just updated to the latest version and noticed that now there is no link to the build in the commit status, all I get from GitHub (at least the web interface) is: "Waiting to hear about a468a45 โ€” Build triggered. sha1 is merged.", but no link to see the details as before.

Also, after the building is done, the commit status is not set appropriately (at least when the build was successful, I haven't check yet with failed builds).

Comments on the PR trigger jenkins but jenkins does not trigger github

Hello,

I notice a weird behavior when you trigger builds manually. (in my project, we don't want jenkins build automatically every PR because it takes a lot of time)

When you create a pull-request on the github, then you add the comment to trigger jenkins, everything is ok. The build start and jenkins tell github about the current status of the build. As you can see on this screenshot:

screen_jenkins_success

After added a commit, then when you try to start again a build, the build is started by jenkins but github does not receive information about the build. Checkout the following screenshot:

screen_jenkins_fail

I have no idea where comes this bug, or how to fix it. But i tried many configurations of the plugin and nothing to do, the problem is still here.

Don't hesitate to ask anything if i'm not clear enough.

NPE with 1.24 version

We're getting a NullPointerException with version 1.24 of this plugin. This happens after the build completes and the pull request on GitHub is left in a pending state.

This is with Jenkins ver. 1.616 (and ver. 1.617) and version 1.24 of ghprb. Manually downgrading to 1.23 resolves this issue.

image

Job #15 main build action completed: FAILURE
Jun 19, 2015 9:53:50 PM WARNING hudson.model.listeners.RunListener report
RunListener failed
java.lang.NullPointerException
    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.onBuildComplete(GhprbSimpleStatus.java:134)
    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:145)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:27)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:12)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
    at hudson.model.Run.execute(Run.java:1789)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)

GitHub authentication failures updating statuses after upgrading to 1.24

After upgrading to 1.24, the plugin is no longer able to update commit statuses, though the "Connect to API" button in the global settings successfully connects to GitHub.

From the console output:

Using context: Jenkins builder
FileNotFoundException means that the credentials Jenkins is using is probably wrong. Or the user account does not have write access to the repo.
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
    at org.kohsuke.github.Requester.handleApiError(Requester.java:494)
    at org.kohsuke.github.Requester._to(Requester.java:245)
    at org.kohsuke.github.Requester.to(Requester.java:191)
    at org.kohsuke.github.GHRepository.createCommitStatus(GHRepository.java:780)
    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.createCommitStatus(GhprbSimpleStatus.java:175)
    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.onBuildStart(GhprbSimpleStatus.java:124)
    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onStarted(GhprbBuilds.java:108)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onStarted(GhprbBuildListener.java:19)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onStarted(GhprbBuildListener.java:12)
    at hudson.model.listeners.RunListener.fireStarted(RunListener.java:215)
    at hudson.model.Run.execute(Run.java:1740)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/k8s-bot/kubernetes/statuses/e50c01f6bfc4c6859aa7de9e76aa4ead9fe80558
    at sun.reflect.GeneratedConstructorAccessor148.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at org.kohsuke.github.Requester.parse(Requester.java:451)
    at org.kohsuke.github.Requester._to(Requester.java:224)
    ... 12 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/k8s-bot/kubernetes/statuses/e50c01f6bfc4c6859aa7de9e76aa4ead9fe80558
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.kohsuke.github.Requester.parse(Requester.java:447)
    ... 13 more

Trigger phrase doesn't accept regexp pattern

According to the documentation here:

  • Under Advanced, you can modify:
    • The phrase for adding users to the whitelist via comment. (Java regexp)
    • The phrase for accepting a pull request for testing. (Java regexp)
    • The phrase for starting a new build. (Java regexp)
    • The crontab line. This specify default setting for new jobs.

However, according to the source, this isn't interpreted as a regular expression, it's just a plain string:
https://github.com/jenkinsci/ghprb-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/Ghprb.java#L178-L180

Is this a bug? Or an error in the documentation?

Grails PR Build Failing with Spaces

I'm using this plugin with a grails wrapper and the variables that GitHub is passing in as environment variables that have spaces (description of pull request, author name, etc.) are causing the errors for the grails wrapper. Is there a way to configure this plugin so that we do not pass in all of the environment variables?

Not starting the trigger causes all triggers to fail.

If GhprbTrigger.start() doesn't call super.start() then it causes a null pointer when Jenkins tries run the cron triggers. In my case because there are some disabled projects start() is returning before calling the super method. I could only reproduce the bug locally by creating a new job, letting it get set up, disabling it, then restarting jenkins.

Jun 02, 2015 11:20:01 AM WARNING hudson.triggers.Trigger$Cron doRun
Cron thread throw an exception
java.lang.NullPointerException
at hudson.triggers.Trigger.checkTriggers(Trigger.java:263)
at hudson.triggers.Trigger$Cron.doRun(Trigger.java:215)
at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

Allow customisation of 'Details' destination in Github status

Currently the plugin updates the PullRequest status with link to the specific job (the 'Details' button on the right).
githubstatus
Most of the time, when a job fails, the user will want to go to console to find out the reason and with current setup that requires 2 clicks, 2 page loads.

I believe the workflow can be simplified by allowing the endpoint destination to be changed in global config depending on job result status.

for example:
job created - link to job
job succeeded - link to job
job failed - link to console

"Helper is null, unable to run trigger"

The Jenkins log constantly shows severe-level error messages of the form

Jun 19, 2015 5:12:01 PM SEVERE org.jenkinsci.plugins.ghprb.GhprbTrigger run
Helper is null, unable to run trigger

It's unclear whether these messages are benign or indicative of a problem. If they are a configuration issue, they give no hint at to what is actually wrong or how one could fix the issue.

does not build on new commits

After a while, the plugin stopped looking at new commits and you can only trigger a new build with the retest this please phrase. No idea where to start looking: I checked github token, config, etc. and it looks ok. Commit status is also updated properly, the only thing not working is that the build is not triggered when a new commit is added to the pull request.

NPEs in GHPRB Merge

2015-08-16 03:41:46.917: java.lang.NullPointerException
2015-08-16 03:41:46.917:    at org.jenkinsci.plugins.ghprb.GhprbPullRequestMerge.perform(GhprbPullRequestMerge.java:151)
2015-08-16 03:41:46.917:    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
2015-08-16 03:41:46.917:    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:776)
2015-08-16 03:41:46.917:    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:723)
2015-08-16 03:41:46.917:    at hudson.model.Build$BuildExecution.post2(Build.java:183)
2015-08-16 03:41:46.917:    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:670)
2015-08-16 03:41:46.917:    at hudson.model.Run.execute(Run.java:1763)
2015-08-16 03:41:46.917:    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
2015-08-16 03:41:46.917:    at hudson.model.ResourceController.execute(ResourceController.java:98)
2015-08-16 03:41:46.917:    at hudson.model.Executor.run(Executor.java:381)
2015-08-16 03:41:46.918: Build step 'Github Pull Request Merger' marked build as failure

The culprit is here: triggerSender can be null.

How to build this plugin or an enhancement of the mergable state checking?

Im using this plugin with an github enterprise server๏ผŒfor same reason๏ผŒthe server compares pull request a little slow. This makes some problem: I found this plugin wait up to only 5 seconds to check if a pull request mergable. So I want to modify the wait time and build one for the server.with the Java and maven installed, I build multijob and multi scm success,but have many exceptions and errors when build this plugin.Is the plugin need some special build environments ?

More build information available on Github comments.

Hello, I would like to be able to post of the build information from Jenkins to the comment made on the Github pull request. Currently the list of environment variables that can be used is somewhat limited.

I would like to be able to post information such as the build duration, test results, build health and so on.

I have found a way to implement this functionality but it is pretty basic. I would be happy to contribute to the plugin as a whole and was wondering what the best way to add this functionality in would be. I looked at the possibility of making some of these things environment variables but those are set when the build starts and thus would not work for things like duration or test results.

How should I implement this to be consistent with the current way of doing things and how should it be offered as an option to users?

Build should not fail if no merge is requested

If the build passes, but no merge is requested (merge on only on trigger phrase) the PR is updated as failed build. This is annoying as I'd like to see a successful build & then request merge which would re-run build & merge properly.

Code is at

if (merge) {
listener.finished(Result.SUCCESS);
} else {
listener.finished(Result.FAILURE);
}
return merge;

org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook abuses Rate Limit

I have more than 300 jobs and 300 github repositories and I noticed handleWebHook runs every 10mn (I did not find where it is configured and if it is) but it burts my rate limit and fail not fast (maybe due to github-api lib which has no timeout on http calls and multiple retries?) .

So, is there a way to configure the frequency of calls to handleWebHook ? or at least debug or fine logs when an API call (and an effective http call) is done?

This is really critical has the entire Jenkins is affected and do not respond when this happens.

retest this please, test this please are broken

I've tested plugin version 1.24.4 - it works as expected. So looks like the bug was introduced later

bug tested on ghprb 1.24.5 and 1.24.7

The issue itself is, when the build was done, success of failure, jenkins not more accepting comments like retest this please or test this please

Log shows

Jul 08, 2015 7:10:01 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
INFO: Pull request #7 was updated on propeoplemd/mvtp at 7/8/15 7:07 AM by User:podarok
Jul 08, 2015 7:10:01 AM org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
INFO: Pull request #7 was updated on repo propeoplemd/mvtp but there aren't any new comments nor commits; that may mean that commit status was updated.

When creating new PR - everything is good, but only for a first build

Broken PR <a> tag

2015-08-20 15 21 29
2015-08-20 15 28 15

GitHub Pull Request Builder v 1.27
GitHub plugin v 1.12.1
GitHub API Plugin v 1.69

Build hangs forever if PR is merged before build starts

After f482b8f, if a PR is merged before the triggered build starts, the GHPRB will simply hang forever.

That suggests to me that GHPullRequest.getMergeable() returns null if the PR is merged, and so checking for null is not a good heuristic for "Github is unreachable".

Regardless, we should definitely not busy-wait eternally on this check. It would be better to just abort the build if we can't get a response from Github.

Do not automatically merge PRs/branches with master

Something's going on with wiki.jenkins-ci.org and I can't add a comment there, so I was forced to post it here.

So my question is:

  • how can I configure ghprb so that it doesn't merge PRs or branches with master?

Basically what we need is to have 2 jobs for the same repo:

  • 1st one, that will checkout only the PR/branch code without merging it with master
  • 2nd that will merge PR/branch (if possible) with master

Here's an excerpt from the current build log.
I've highlighted things that bother me and is not what I need.

GitHub pull request #15 of commit 4a2fce874f2d8e20c46423ffdc0ea21beb055953, no merge conflicts.
Setting status of 4a2fce874f2d8e20c46423ffdc0ea21beb055953 to PENDING with url http://xxxxx:8080/job/xxxxxxxxxx/20/ and message: Build started, _sha1 is merged_
[EnvInject] - Loading node environment variables.
Building on master in workspace /var/lib/jenkins/workspace/xxxxxxxxx
git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url [email protected]/xxxxxx.git # timeout=10
Fetching upstream changes from [email protected]:xxxx/xxxxxxxx.git
git --version # timeout=10
using GIT_SSH to set credentials Used for Github integration
git -c core.askpass=true fetch --tags --progress [email protected]:xxxxxxxxxxxxx.git +refs/heads/:refs/remotes/origin/
_git rev-parse refs/remotes/origin/pr/15/merge^{commit}_ # timeout=10
_git rev-parse refs/remotes/origin/origin/pr/15/merge^{commit}_ # timeout=10
_Checking out Revision 4fd5b9af8a7d582cc02c0b8e6c43a197be1de452 (refs/remotes/origin/pr/15/merge)_
git config core.sparsecheckout # timeout=10
_git checkout -f 4fd5b9af8a7d582cc02c0b8e6c43a197be1de452_

GitHub trigger causes NPE at trigger.getRepository()

Edit: Found that this was because the GitHub project was not specified in the job. Could be a better error message still.

The GitHub webhook causes the following exception in the log (all on FINEST), and the job is not built:

Aug 20, 2015 9:51:02 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook checkSignature
Signatures checking OK
Aug 20, 2015 9:51:02 AM SEVERE org.jenkinsci.plugins.ghprb.GhprbTrigger getRepository
The ghprb trigger for xxx wasn't properly started - helper is null
Aug 20, 2015 9:51:02 AM SEVERE org.jenkinsci.plugins.ghprb.GhprbRootAction doIndex
Unable to process web hook for: xxx
java.lang.NullPointerException
    at org.jenkinsci.plugins.ghprb.GhprbWebHook.handleWebHook(GhprbWebHook.java:33)
    at org.jenkinsci.plugins.ghprb.GhprbRootAction.doIndex(GhprbRootAction.java:90)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
    at org.kohsuke.stapler.MetaClass$2.dispatch(MetaClass.java:165)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:123)
    at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:58)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:120)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:114)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:168)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    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)

https://github.com/jenkinsci/ghprb-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/GhprbWebHook.java#L32

Feature request: update commit status while waiting for permission to test a PR

The developers on our project feel safe to merge a PR when all of the commit checks are green, including usually our Jenkins run.

However, if the Jenkins plugin asks for permission to test a PR, it doesn't update the commit status, and so a developer may miss that the tests weren't run. (For example, this recently happened on kubernetes/kubernetes#11379.)

If the plugin would mark a commit as pending while waiting for permission to run tests, it would make it very obvious that tests hadn't run yet. (Extra bonus if the commit status mentioned that it was waiting for permission.)

Credential issues still continue after #123

The credentials issue is not fully resolved in #123

Comments are not left by GHPRB in the PRs being tested even though the appropriate global configuration is set. The GitHub status API updates complete successfully though.

Jun 29, 2015 4:30:29 PM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: issue_comment
Jun 29, 2015 4:30:29 PM FINEST org.jenkinsci.plugins.ghprb.GhprbGitHubAuth
Using OAuth token for context (null)
Jun 29, 2015 4:30:29 PM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Checking issue comment 'org.kohsuke.github.GHIssueComment@5dcd4aef' for repo cschcs/kesem
Jun 29, 2015 4:30:29 PM FINER org.jenkinsci.plugins.ghprb.GhprbRepository
Comment on issue #2 from User:arcivanov: test this please
Jun 29, 2015 4:30:29 PM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Retest phrase
Jun 29, 2015 4:30:29 PM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Admin User:arcivanov gave retest phrase
Jun 29, 2015 4:30:30 PM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Running the build
Jun 29, 2015 4:30:30 PM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
PR is not null, checking if mergable
Jun 29, 2015 4:30:30 PM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Running build...
Jun 29, 2015 4:30:30 PM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: issue_comment
Jun 29, 2015 4:30:30 PM FINEST org.jenkinsci.plugins.ghprb.GhprbGitHubAuth
Using OAuth token for context (null)
Jun 29, 2015 4:30:31 PM SEVERE org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
Failed to look up credentials for context (null) using id: 2c6f0a56-02f2-4082-88ca-143fa817b765
Jun 29, 2015 4:30:31 PM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: issue_comment
Jun 29, 2015 4:30:31 PM FINEST org.jenkinsci.plugins.ghprb.GhprbGitHubAuth
Using OAuth token for context (null)
Jun 29, 2015 4:31:00 PM FINE org.jenkinsci.plugins.ghprb.GhprbTrigger
Use webHooks is set, so not running trigger

Github "pull_request" event not supported?

This is the message I get when my webhook tries to send the pull_request event to my Jenkins instance:

A problem occurred while processing the request.
    Please check <a href="https://issues.jenkins-ci.org/">our bug tracker</a> to see if a similar problem has already been reported.
    If it is already reported, please vote and put a comment on it to let us gauge the impact of the problem.
    If you think this is a new issue, please file a new issue.
    When you file an issue, make sure to add the entire stack trace, along with the version of Jenkins and relevant plugins.
    <a href="http://jenkins-ci.org/content/mailing-lists">The users list</a> might be also useful in understanding what has happened.</p><h2>Stack trace</h2><pre style="margin:2em; clear:both">javax.servlet.ServletException: java.lang.IllegalArgumentException: Github Webhook event of type pull_request is not supported. Only push events are current supported

I just updated the plugin.

These are the request headers:

Request URL: ###/github-webhook/
Request method: POST
Authorization: ********
content-type: application/x-www-form-urlencoded
Expect: 
User-Agent: GitHub-Hookshot/2f00e0f
X-GitHub-Delivery: 31deb900-1ba2-11e5-8476-6f14de4238e3
X-GitHub-Event: pull_request

Notice I omitted the actual URL to Jenkins instance.

Null pointer when testing credentials

When testing the credentials for access to the repository, to make comments, or to update commit statuses a null pointer is occurring because the queryParameter is incorrect.

builds when changes made to PR and a list of branches

What configuration would I need in order for changes to PR and a list of branches to trigger builds?

Currently I've got +refs/heads/:refs/remotes/origin/ +refs/pull/:refs/remotes/origin/pr/ in the Refspec and ${sha1} in the Branches to build.

It builds when changes to PR are made, however builds not triggered when changes to eg master branch are made

Adding plugin posts comment to all the pull request

I am trying to configure this plugin on our jenkins server and want to make sure things work correctly before rolling it out to the team. I am unable to get the plugin to work.
Every time I enable the plugin on a particular job (specific branch), it makes a post to all the open pull request with the message "Can one of the admins verify this patch?"
I removed the text now from the configuration, but I don't feel like turning on the plugin because it might just post empty messages on my behalf.

What is the best way to turn it off for all the pull request and just try it on a single Pull request provided by the branch in the jenkins job

Bizarre behavior after upgrading to 1.24.1&2

Apologies for opening a separate issue but it "may" or "may not" be related to #117.

After a restart of jenkins everything seems to work. But if I modified the job even just opening the "configure" page of a given job. The entire job simply no longer works. Log is posted below

Jun 24, 2015 3:49:00 PM org.jenkinsci.plugins.ghprb.GhprbRepository initGhRepository
SEVERE: Could not retrieve GitHub repository named [Org_here/private_repo_here] (Do you have properly set 'GitHub project' field in job configuration?)
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
    at org.kohsuke.github.Requester.handleApiError(Requester.java:494)
    at org.kohsuke.github.Requester._to(Requester.java:245)
    at org.kohsuke.github.Requester.to(Requester.java:191)
    at org.kohsuke.github.GitHub.getRepository(GitHub.java:321)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.initGhRepository(GhprbRepository.java:78)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.check(GhprbRepository.java:88)
    at org.jenkinsci.plugins.ghprb.Ghprb.run(Ghprb.java:134)
    at org.jenkinsci.plugins.ghprb.GhprbTrigger.run(GhprbTrigger.java:208)
    at hudson.triggers.Trigger.checkTriggers(Trigger.java:266)
    at hudson.triggers.Trigger$Cron.doRun(Trigger.java:215)
    at hudson.triggers.SafeTimerTask.run(SafeTimerTask.java:51)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/[Org_here/private_repo_here]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1672)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
    at org.kohsuke.github.Requester.parse(Requester.java:451)
    at org.kohsuke.github.Requester._to(Requester.java:224)
    ... 16 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/[Org_here/private_repo_here]
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1625)
    at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
    at org.kohsuke.github.Requester.parse(Requester.java:447)
    ... 17 more

To make it work again; I have to restart the entire jenkins

  • I'm using a Personal Auth Token to access the private key
  • account is owner in the owner team in an org. (trying to narrow it down)

How to change the status URL sent to Github?

We have an internal Jenkins running some testing on a Github project's PRs. There is, unfortunately, no possibility of being able to expose our Jenkins to the outside world. This is obviously problematic when Jenkins finds a problem -- it can set a "Failed" status on the PR commit, but none of our external collaborators can see the details of the actual problem (since they can't reach our internal Jenkins instance).

To work around that, we came up with the scheme of publishing our build logs to gists (see https://gist.github.com/cisco-usnic-bot). This allows our external collaborators to see the full build log via gist (since they can't see our Jenkins) -- it's quite useful.

I'd really like to be able to associate the gist URL with the commit status. Is there a way to do that?

Specifically, I see the Jenkins GHPRB Advanced config field named "Published Jenkins URL", which lets me change the base of the commit status URL that is sent back to Github. But GHPRB appends the rest of the Jenkins-form URL after that base URL (e.g., job/JENKINS_JOB_NAME/JOB_ID/).

Is there a way I can tell GHPRB to wholly replace the status URL with a URL that I provide? Since we use gists, we need to generate a unique URL during every job run -- i.e., we generate the gist URL in the Build/Execute Shell phase of our Jenkins job.

Thanks for any advice you can provide.

Build is failing - perhaps due to pull request parameters now being available as system parameters?

Hi,

We updated yesterday to the newest version on jenkins (newest version) and now get exceptions in our builds. I reverted to the last version of the plugin and our build works again.

Seems as if the parameters are now available as system variables and ant kind of chokes on the long description within the pull request (inspectIT/inspectIT#23).

Perhaps this output is helpful?

Thank you,
Stefan

15:14:14 GitHub pull request #23 of commit c93641510776bdc62c9d10d2f0ecfaf7d3109a98, no merge conflicts.
15:14:16 Setting status of c93641510776bdc62c9d10d2f0ecfaf7d3109a98 to PENDING with url http://jenkins.inspectit.rocks/job/inspectIT%20-%20Pull%20Request%20Check/84/ and message: 'Build started sha1 is merged.'
15:14:17 [EnvInject] - Loading node environment variables.
15:14:17 Building remotely on EC2 Slave (i-e9b1de48) (inspectIT) in workspace /home/ubuntu/jenkins/workspace/inspectIT - Pull Request Check
15:14:19  > git rev-parse --is-inside-work-tree # timeout=10
15:14:19 Fetching changes from the remote Git repository
15:14:19  > git config remote.origin.url [email protected]:inspectIT/inspectIT.git # timeout=10
15:14:19 Fetching upstream changes from [email protected]:inspectIT/inspectIT.git
15:14:19  > git --version # timeout=10
15:14:19 using GIT_SSH to set credentials Access
15:14:20  > git -c core.askpass=true fetch --tags --progress [email protected]:inspectIT/inspectIT.git +refs/pull/*:refs/remotes/origin/pr/* +refs/heads/master:refs/remotes/origin/master
15:14:22  > git rev-parse refs/remotes/origin/pr/23/merge^{commit} # timeout=10
15:14:22  > git rev-parse refs/remotes/origin/origin/pr/23/merge^{commit} # timeout=10
15:14:22 Checking out Revision 1c075d9812af3b2312548339ba92223c0b635a92 (refs/remotes/origin/pr/23/merge)
15:14:22  > git config core.sparsecheckout # timeout=10
15:14:22  > git checkout -f 1c075d9812af3b2312548339ba92223c0b635a92
15:14:23 First time build. Skipping changelog.
15:14:23 [inspectIT - Pull Request Check] $ /bin/sh -xe /tmp/hudson5643077811907038582.sh
15:14:23 + git rebase origin/master
15:14:23 First, rewinding head to replay your work on top of it...
15:14:23 Applying: INSPECTIT-1936: search documentation is now using the new documentation space on Atlassian Open Source instance.
15:14:23 + git ls-files --unmerged
15:14:23 + count=
15:14:23 + [ ! -z  ]
15:14:23 [resources] $ /home/ubuntu/.ant/bin/ant -file build.xml [email protected] -DghprbTriggerAuthorLogin= -DghprbTargetBranch=master -DghprbPullId=23 -DghprbTriggerAuthor= [email protected] -DghprbPullLink=https://github.com/inspectIT/inspectIT/pull/23 -Dsha1=origin/pr/23/merge -DghprbPullAuthorLoginMention=@stefansiegl "-DghprbPullDescription=GitHub pull request #23 of commit c93641510776bdc62c9d10d2f0ecfaf7d3109a98, no merge conflicts." -DghprbActualCommit=c93641510776bdc62c9d10d2f0ecfaf7d3109a98 -DghprbPullAuthorLogin=stefansiegl -DghprbSourceBranch=linkDocSpace "-DghprbActualCommitAuthor=Stefan Siegl" -DghprbTriggerAuthorLoginMention= '-DghprbPullLongDescription=โ€ฆon space on Atlassian Open Source instance.
15:14:23 
15:14:23 Note that I integrated a version exception if parsing or reading the version is not possible as this allows for a more structured approach when dealing with the versions.
15:14:23 
15:14:23 <!-- Reviewable:start -->
15:14:23 [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/inspectit/inspectit/23)
15:14:23 <!-- Reviewable:end -->
15:14:23 ' -DghprbTriggerAuthorEmail= -DGIT_BRANCH=linkDocSpace "-DghprbPullTitle=INSPECTIT-1936: search documentation is now using the new documentatiโ€ฆ" -DghprbCommentBody=null clean
15:14:23 Buildfile: /home/ubuntu/jenkins/workspace/inspectIT - Pull Request Check/Commons/resources/build.xml
15:14:24 
15:14:24 BUILD FAILED
15:14:24 Target "on" does not exist in the project "inspectIT - Commons". 
15:14:24 
15:14:24 Total time: 0 seconds
15:14:24 Build step 'Invoke Ant' marked build as failure
[...]

Context and commit status URL do not work

Hi, I have set the context and commit status URL in the Configure System section of Jenkins as shown below.

image

However, the context that comes through in the PRs is just default and the URL is the normal job URL that is the default. Is there any reason why this might be happening, have I missed something? Thanks.

image

[Question/Feature Request] Trigger Matching Branches

We have a setup where every pull request get's it's own set of jobs including a "master build" for that PR which receives the GHPRB triggers.

Since multiple jobs are "listening" to the triggers, when a PR is updated/synchronized, all "master build" which listed to the triggers get built.

Is there a way to "choose" the right "master build" by the PR branch name(pr/<pr-number>/head) or refspec (+refs/pull/*:refs/remotes/origin/pr/<pr-number>)?

If not, could this be added?

Plugin receives incoming webhook request, but does not build.

Using webhooks
ghprb logs on FINEST

Jul 10, 2015 11:02:19 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: pull_request
Jul 10, 2015 11:02:19 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Fulcrum Tests, using anonymous connection
Jul 10, 2015 11:02:19 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Checking PR #720 for federatedsample/Fulcrum
Jul 10, 2015 11:02:19 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: pull_request
Jul 10, 2015 11:02:19 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Leverage Tests, using anonymous connection
Jul 10, 2015 11:02:22 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: pull_request
Jul 10, 2015 11:02:22 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Fulcrum Tests, using anonymous connection
Jul 10, 2015 11:02:22 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Checking PR #720 for federatedsample/Fulcrum
Jul 10, 2015 11:02:22 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: pull_request
Jul 10, 2015 11:02:22 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Leverage Tests, using anonymous connection
Jul 10, 2015 11:05:00 AM FINE org.jenkinsci.plugins.ghprb.GhprbTrigger
Use webHooks is set, so not running trigger
Jul 10, 2015 11:06:00 AM FINE org.jenkinsci.plugins.ghprb.GhprbTrigger
Use webHooks is set, so not running trigger
Jul 10, 2015 11:06:35 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: issue_comment
Jul 10, 2015 11:06:35 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Fulcrum Tests, using anonymous connection
Jul 10, 2015 11:06:35 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Checking issue comment 'org.kohsuke.github.GHIssueComment@1063fe5' for repo federatedsample/Fulcrum
Jul 10, 2015 11:06:35 AM FINER org.jenkinsci.plugins.ghprb.GhprbRepository
Comment on issue #735 from User:fed-jsol: @mshwery on last commit I used object initializer and returned directly the DataTable.
Jul 10, 2015 11:06:35 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Fulcrum Tests, using anonymous connection
Jul 10, 2015 11:06:35 AM SEVERE org.jenkinsci.plugins.ghprb.GhprbRepository initGhRepository
Could not retrieve GitHub repository named federatedsample/Fulcrum (Do you have properly set 'GitHub project' field in job configuration?)
java.io.FileNotFoundException: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
    at org.kohsuke.github.Requester.handleApiError(Requester.java:494)
    at org.kohsuke.github.Requester._to(Requester.java:245)
    at org.kohsuke.github.Requester.to(Requester.java:191)
    at org.kohsuke.github.GitHub.getRepository(GitHub.java:321)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.initGhRepository(GhprbRepository.java:78)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.init(GhprbRepository.java:51)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.getGitHubRepo(GhprbRepository.java:312)
    at org.jenkinsci.plugins.ghprb.GhprbRepository.onIssueCommentHook(GhprbRepository.java:269)
    at org.jenkinsci.plugins.ghprb.GhprbWebHook.handleWebHook(GhprbWebHook.java:52)
    at org.jenkinsci.plugins.ghprb.GhprbRootAction.doIndex(GhprbRootAction.java:89)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
    at org.kohsuke.stapler.MetaClass$2.dispatch(MetaClass.java:165)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:366)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/federatedsample/Fulcrum
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
    at org.kohsuke.github.Requester.parse(Requester.java:451)
    at org.kohsuke.github.Requester._to(Requester.java:224)
    ... 80 more
Caused by: java.io.FileNotFoundException: https://api.github.com/repos/federatedsample/Fulcrum
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at org.kohsuke.github.Requester.parse(Requester.java:447)
    ... 81 more

Jul 10, 2015 11:06:35 AM SEVERE org.jenkinsci.plugins.ghprb.GhprbRootAction doIndex
Unable to process web hook for: Fulcrum Tests
java.lang.NullPointerException
    at org.jenkinsci.plugins.ghprb.GhprbRepository.onIssueCommentHook(GhprbRepository.java:269)
    at org.jenkinsci.plugins.ghprb.GhprbWebHook.handleWebHook(GhprbWebHook.java:52)
    at org.jenkinsci.plugins.ghprb.GhprbRootAction.doIndex(GhprbRootAction.java:89)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
    at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
    at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
    at org.kohsuke.stapler.MetaClass$2.dispatch(MetaClass.java:165)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.MetaClass$13.dispatch(MetaClass.java:411)
    at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
    at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
    at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
    at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
    at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
    at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
    at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
    at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
    at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
    at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
    at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:366)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

Jul 10, 2015 11:06:35 AM INFO org.jenkinsci.plugins.ghprb.GhprbWebHook handleWebHook
Got payload event: issue_comment
Jul 10, 2015 11:06:35 AM WARNING org.jenkinsci.plugins.ghprb.GhprbGitHubAuth getBuilder
credentialsId not set for context Leverage Tests, using anonymous connection

As you can see, it is receiving webhooks (and I can verify in github that the request payload is received with a 200 OK response) when there are comments or when there pull requests created.

But, after that, nothing happens. No build is triggered. This just started happening about 7 days ago (that was our last successful build via ghprb).

RunListener failed - Build Passes do not update commit statuses

I've had a good poke around at the config, but whilst the plugin is able to set the status of a build/commit to in progress or failure - successes cause the following:

Jul 08, 2015 9:05:20 AM hudson.model.Run execute
INFO: NetKAN #43 main build action completed: SUCCESS
Jul 08, 2015 9:05:20 AM hudson.model.listeners.RunListener report
WARNING: RunListener failed
java.lang.NoClassDefFoundError: hudson/tasks/test/TestObject
    at org.jenkinsci.plugins.ghprb.manager.factory.GhprbBuildManagerFactoryUtil.getBuildManager(GhprbBuildManagerFactoryUtil.java:37)
    at org.jenkinsci.plugins.ghprb.extensions.status.GhprbSimpleStatus.onBuildComplete(GhprbSimpleStatus.java:155)
    at org.jenkinsci.plugins.ghprb.GhprbBuilds.onCompleted(GhprbBuilds.java:145)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:27)
    at org.jenkinsci.plugins.ghprb.GhprbBuildListener.onCompleted(GhprbBuildListener.java:12)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
    at hudson.model.Run.execute(Run.java:1786)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:381)
Caused by: java.lang.ClassNotFoundException: hudson.tasks.test.TestObject
    at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1376)
    at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1326)
    at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1079)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 10 more

Jenkins: 1.619
GHPRB: 124.7

The actual problem we're seeing is the commit status not updating here:
KSP-CKAN/NetKAN#1869

However it has improved from 124.6 which was not updating the build at all for a pass (at least now it gives a green tick for the overall build).

Failures do update the commit status. Is there some way I can export the job config, because I'm not 100% confident what a correctly configured job looks like (Maintainer of old Jenkins host is MIA and the host went AWAL - so we're starting from scratch).

Thanks!

Can GHPRB detect when a commit is no longer on a PR?

Here's a scenario that has happened a few times:

  1. Author creates a PR with a chain of commits
  2. GHPRB kicks off a Jenkins job 1
  3. Author rebases and force-pushes a new chain of commits, completely replacing the first chain of commits
  4. GHPRB queues up Jenkins job 2 (because the first one is still running)
  5. Author rebases and force-pushes again, and completely replaces the first chain of commits a 2nd time
  6. GHPRB queues up Jenkins job 3 (because the first one is still running)

Of the two queued jobs, job 2 is now useless because the commits it will test are now no longer on the pull request (Jenkins job 1 is also useless, but there's not much we can do about that).

Is there a way to get GHPRB to check when it starts a new job to ensure that the commits it is testing are still associated with the pull request?

This would mean that Jenkins job 2 would be very quick, because GHPRB would realize that the commits it would have tested are no longer associated with the pull request, and GHPRB can skip the build. Jenkins job 3 would also do the same check, realize that the commits are still part of the pull request, and then continue to run the job.

Publisher occasionally fails due to being unable to determine sha1 of commit

I've occasionally seen the publisher fail test runs because it supposedly can't determine the sha1 of the commit, and yet on the very next line, it shows it successfully updating the relevant commit.

This doesn't always occur, but I haven't been able to figure out what triggers this bug. In this particular case, I had just turned on the "Execute concurrent builds if necessary" option in Jenkins, but it'd successfully checked out the patch, built and run all of the tests up to the point of publishing results.

Build log from one of the failures:

GitHub pull request #9592 of commit 9423f80d2011d2d5ef2e5e121f0e97f0d499bfb1, no merge conflicts.
Setting status of 9423f80d2011d2d5ef2e5e121f0e97f0d499bfb1 to PENDING with url [elided] and message: 'Build started, sha1 is merged'
Using conext: Jenkins GCE e2e
Building in workspace /var/lib/jenkins/jobs/kubernetes-pull-build-test-e2e-gce/workspace@3
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/GoogleCloudPlatform/kubernetes # timeout=10
Fetching upstream changes from https://github.com/GoogleCloudPlatform/kubernetes
 > git --version # timeout=10
 > git -c core.askpass=true fetch --tags --progress https://github.com/GoogleCloudPlatform/kubernetes +refs/pull/*:refs/remotes/origin/pr/*
 > git rev-parse refs/remotes/origin/pr/9592/merge^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/pr/9592/merge^{commit} # timeout=10
Checking out Revision 0af5cfe1266faebf8f0162a0efce08b590c0337c (refs/remotes/origin/pr/9592/merge)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 0af5cfe1266faebf8f0162a0efce08b590c0337c
First time build. Skipping changelog.

...

ERROR: Publisher 'Set build status on GitHub commit' aborted due to exception: 
java.io.IOException: Cannot determine sha1 of the commit. The status cannot be reported
    at org.jenkinsci.plugins.github.util.BuildDataHelper.getCommitSHA1(BuildDataHelper.java:31)
    at com.cloudbees.jenkins.GitHubCommitNotifier.updateCommitStatus(GitHubCommitNotifier.java:102)
    at com.cloudbees.jenkins.GitHubCommitNotifier.perform(GitHubCommitNotifier.java:84)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1769)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Setting status of 9423f80d2011d2d5ef2e5e121f0e97f0d499bfb1 to FAILURE with url [elided] and message: 'Build finished.'
Using conext: Jenkins GCE e2e
GCE e2e build/test **failed** for commit 9423f80d2011d2d5ef2e5e121f0e97f0d499bfb1.
...

Builds always set GitHub commit status to "No test result found"

For every passing build the message "No test result found" is passed to the GitHub status is passed:

image

I see that this line is generated by the source file https://github.com/jenkinsci/ghprb-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/manager/impl/GhprbBaseBuildManager.java .

My question is, does this test result parser only work for JUnit tests? I'm using a TAP test reporter and result parser and I would like this output to determine the test results sent to GitHub. Is there any way to do this or would I have to use JUnit for this plugin to use the test results in the commit status? Thanks.

Get the passphrase as a environment variable

I'm wondering if there is a way to get the trigger passphrase and to use it in the job as a environment variable.

Thanks i.A.

The origin of the whole issue: For now am creating a new job for every passphrase. I want to reduce the number of jobs in a way similar jobs are gathered together, the passphrase is analysed in a build step and then it launches its corresponding task.

[Question/Feature Request] Commenting @user when a build succeeds/fails

Is it possible to do the following?

  1. If the build fails, make a comment on the pull request telling the pull request author that the build failed?
    example: "Build failed, @isuda".
  2. If the build succeeds, make a comment on the pull request telling the pull request assignee that the build succeeded and is ready to merge.
    example: "All is well, @isuda".

This would be in conjunction with updating the github commit status.

Since builds take time to run it would be nice to notify the people responsible when the testing is completed, so that a person does not need to constantly check the pull request to see if it passed/succeeded.

Incorrect pull request URL

When using ghprb the HTML link to the pull request seems to be broken.

all-pull-request-builder__jenkins_

The link should be something like https://github.com/totango/main/pull/1206
But in reality it's something like: https://api.github.com/repos/totango/main/pulls/1206 (broken link)

Browsing the code, it seems that the issue stems from incorrect call to getUrl() here https://github.com/jenkinsci/ghprb-plugin/blob/master/src/main/java/org/jenkinsci/plugins/ghprb/GhprbPullRequest.java#L69

I think (well, guessing) that simply changing the call to getHtmlUrl() might solve the issue.
What's not clear is - how did this break and why am I the only person suffering from this?...
Another theory is that it's a configuration option I might have missed somewhere...

Perhaps this is something about incompatible versions of the plugins. Anyway the GitHub Pull Request Builder version is 1.16-8 (I tried downgrading to 1.12 but that didn't help).
And the version of GitHub plugin is 1.11

Hope that's enough info to help you help me ;)
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.