question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: Downstream job fails to update upstream pr

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:22

github_iconTop GitHub Comments

7reactions
masterzencommented, Jul 12, 2016

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.

2reactions
m-kostrzewacommented, Feb 28, 2017

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}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Upstream pipeline status does not update if a downstream job ...
Problem. If a downstream pipeline has a flaky test and fails, then the status upstream is not updated if it is retried.
Read more >
Jenkins - Not to have failed upstream job if downstream job fails
I have a master job which triggers multiply downstream jobs. If some of the downstream jobs fail, I don't want to have failed...
Read more >
Upstream rebuilds with Jenkins Job Builder - atodorov.org
On the picture you can see that codec-rpm-PR-runtest was successful but codec-rpm-rebuild-bdcs was not. The actual error when compiling bdcs is:.
Read more >
Fix Git's "fatal: no upstream branch" error quickly example
Here's a quick fix for Git's "fatal: The current branch has no upstream branch" error, along with a brief explanation of why this...
Read more >
Jenkins: marking an upstream job as failed if its downstream ...
If you have a build pipeline inside your Jenkins setup you might have so called upstream jobs which trigger downstream jobs. If such...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found