I'm trying to create two Jenkins jobs that both leverage the GitHub Pull Request Builder plugin in order to run multiple status checks, but I'm having trouble getting the status check from my downstream job to show up in my GitHub project.
Here's the summarized CI flow I'd like to setup:
SUCCESS
, should invoke Downstream job via a post-build actionStep 3 is where I'm having issues. Downstream runs properly, but it does not post a status. The status is not even available under the Branches section of my GitHub project's settings. I'm not sure how GHPRB does the initial creation of the status check, but there are references to the context messaging in the Console Output:
14:58:23 Started by upstream project "upstream" build number 209
14:58:23 originally caused by:
14:58:23 GitHub pull request #114 of commit f1ff2819a5308f7819275e732cf44a2cc2ec31dc, no merge conflicts.
14:58:23 [EnvInject] - Loading node environment variables.
14:58:23 Building on master in workspace /store/jenkins/jobs/downstream/workspace
14:58:23 > git rev-parse --is-inside-work-tree # timeout=10
14:58:23 Fetching changes from the remote Git repository
14:58:23 > git config remote.origin.url <removed for privacy> # timeout=10
14:58:23 Fetching upstream changes from <removed for privacy>
14:58:23 > git --version # timeout=10
14:58:23 > git -c core.askpass=true fetch --tags --progress <removed for privacy> +refs/pull/*:refs/remotes/origin/pr/*
14:58:24 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
14:58:24 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
14:58:24 Checking out Revision eac390c51a1b8b591bfe879421bd5fad0421a1ec (refs/remotes/origin/master)
14:58:24 > git config core.sparsecheckout # timeout=10
14:58:24 > git checkout -f eac390c51a1b8b591bfe879421bd5fad0421a1ec
14:58:24 First time build. Skipping changelog.
14:58:24 [build] $ /store/jenkins/tools/hudson.tasks.Ant_AntInstallation/ant_1.8.2/bin/ant -DghprbStatusUrl= "-DghprbSUCCESSMessage=Packaging organization successfully cleaned" -DghprbStartedStatus=Undeploying -DghprbAddTestResults=false "-DghprbCommitStatusContext=Cleaning Packaging" "-DghprbERRORMessage=An error occurred during undeployment" -DghprbUpstreamStatus=true "-DghprbTriggeredStatus=Preparing destructive changes" "-DghprbFAILUREMessage=Packaging organization failed to clean properly" -DghprbShowMatrixStatus=false
Here are the relevant configuration sections for both Jenkins jobs:
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎
✔︎
Downstream
origin
+refs/pull/*:refs/remotes/origin/pr/*
*/master
✔︎
What am I missing? It should be noted that I do not have the Jobs DSL plugin installed so I cannot leverage the extension that GHPRB provides.
Configure your pipelineOn the Datalog Tagging tab, check “GitHub project”, and put your project URL in the field. On the Build Triggers tab, check “GitHub Pull Request Builder”. Then the GitHub API credentials is automatically filled in. Make sure the Admin list is filled in with at least one admin name.
After extensive trial and error, this comment shed some light on my issue.
ghprbGhRepository
, ghprbPullId
, ghprbActualCommit
and sha1
.The correct configurations for both jobs are as follows:
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎
✔︎
Downstream
ghprbGhRepository=${ghprbGhRepository}
ghprbPullId=${ghprbPullId}
ghprbActualCommit=${ghprbActualCommit}
sha1=${sha1}
origin
+refs/pull/*:refs/remotes/origin/pr/*
${sha1}
✔︎
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With