Pipeline & GH pull requests

99 views
Skip to first unread message

Graham Hay

unread,
Sep 29, 2016, 10:44:25 AM9/29/16
to Jenkins Users
Is there any way to get the id of a pull request, in the brave new pipeline world? It was exposed as $ghprbPullId when using the GHPRB plugin.

I'm using a GH Org Folder & Multibranch, with a Jenkinsfile.

Also, what do I have to do to get something to appear in the pull requests folder (see attached)? There are open PRs.

Thanks,

Graham
pull_requests.png

Graham Hay

unread,
Oct 26, 2016, 8:00:56 AM10/26/16
to jenkins...@googlegroups.com
The answer was to tick this box:
Inline images 1
under Project Sources -> Repository Sources -> GitHub Org -> Advanced in the folder configuration. I then got PR builds, with a branch named as "PR-${prNumber}".

I think the fork PR version was ticked by default, but that's not our workflow.

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/fnphR6M-420/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f8e8c340-3171-458b-af5b-bdf59dc7157e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Graham Hay

unread,
Feb 9, 2017, 11:56:02 AM2/9/17
to Jenkins Users
I'm still having trouble with this (not since Oct, obviously, I took a break).

When I push a new (feature) branch, it immediately starts building: because I have "Build origin branches" ticked (I assume I need that to get master to build?). That build fails, because it's expecting the branch name to be "PR-*", but I can deal with that in the Jenkinsfile. However, when I do open the PR it still doesn't create the build, I had to re-scan the repo (closing & re-opening the PR had no effect).

Even once the PR build was set up correctly, it didn't seem to be triggered by a force push, something I do pretty regularly on a feature branch (clean history, and all that). Again, a re-scan woke it up.

All this works seamlessly (mostly) with the old GHPRB plugin. Am I "doing it wrong" (I don't think my use case is particularly unusual), or is this pipeline stuff just not ready for real use yet? I'm using LTS, and the latest versions of all the plugins.

Thanks,

Graham

Graham Hay

unread,
Feb 10, 2017, 6:13:19 AM2/10/17
to jenkins...@googlegroups.com
Also, is there any way to prevent multiple pipeline builds for the same branch (e.g. master) running concurrently? That was opt-in, in the old world.

Inline images 1

On 29 September 2016 at 15:44, Graham Hay <graha...@gmail.com> wrote:

--

Graham Hay

unread,
Feb 16, 2017, 10:18:56 AM2/16/17
to jenkins...@googlegroups.com
In case anyone else is playing along (or for future me), I fixed the first problem by specifying "master" instead of "*" for branches to build:

Inline images 1


It noticed force pushes after that too. And I discovered that the plugin was listening, but the right event wasn't being sent by the webhook; so I added it (at the org level):

Inline images 2
There doesn't seem to be any way to turn off concurrent builds, but there is an issue here tracking it.

Reply all
Reply to author
Forward
0 new messages