ghprb-plugin: Bug: Downstream job fails to update upstream pr

I have one job building PR’s and it works great, updates commit status on GitHub as expected. It also triggers the downstream job correctly, but the downstream job is not able to update the commit status of the pr that triggered the upstream job.

In the upstream job I have checked the advanced option: Display build errors on downstream builds? In the downstream job I have checked: Set GitHub commit status with custom context and message (Must configure upstream job using GHPRB trigger)

In the jenkins log I get:

INFO: downstream_job #62 main build action completed: SUCCESS
Apr 21, 2016 11:03:00 AM org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatusListener updateEnvironmentVars
SEVERE: Unable to connect to GitHub repo
java.lang.NullPointerException
    at org.kohsuke.github.GitHub.getRepository(GitHub.java:334)
    at org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatusListener.updateEnvironmentVars(GhprbUpstreamStatusListener.java:78)
    at org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatusListener.onCompleted(GhprbUpstreamStatusListener.java:119)
    at org.jenkinsci.plugins.ghprb.upstream.GhprbUpstreamStatusListener.onCompleted(GhprbUpstreamStatusListener.java:34)
    at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:201)
    at hudson.model.Run.execute(Run.java:1783)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

I’ve tried upgrading to version 1.31.4, but the issue is the same.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 4
  • Comments: 23

Most upvoted comments

I have the exact same issue. The problem is that the various ghprb* parameters are not set on the downstream job. I added them manually in the trigger Downstream Parametrized job, and it seems to be working now.

Thanks @masterzen, it works! For anyone that stumbles upon this in the future, here are the parameters that make this work (maybe some of them are unnecessary but didn’t feel like trying subsets of this):

sha1=${sha1}
ghprbActualCommit=${ghprbActualCommit}
ghprbAuthorRepoGitUrl=${ghprbAuthorRepoGitUrl}
ghprbCredentialsId=${ghprbCredentialsId}
ghprbPullId=${ghprbPullId}
ghprbGhRepository=${ghprbGhRepository}
ghprbSourceBranch=${ghprbSourceBranch}
ghprbTargetBranch=${ghprbTargetBranch}

Have no idea what I did but it works not. @m-kostrzewa it seems you don’t need SCM configuration in the downstream jobs. Looks good now.

BTW: the parameters workaround does work…

I hit the same issue and I’d like to avoid the workaround with additional 8 parameters. I’m using plugin 1.36.2 on jenkins 2.46.2.

Ugh. Yeah. Having to add 8 parameters to every downstream job sucks. It’s tedious for one and it’s a slew of parameters that people who just want to do a non-GH-PR driven build have to wade through.

Is there no better way to get upstream/downstream GH-PR notification working?