ghprb icon indicating copy to clipboard operation
ghprb copied to clipboard

One Pull Request to Trigger Multiple Jobs

Open samreisner opened this issue 10 years ago • 16 comments

I'd like to have one pull request initiate two separate jobs in Jenkins. I've configured the builds and when only one of the two is enabled, it builds, but once I enable both, only one will build.

Running plugin version 1.9 due to the Enterprise rate limit issue #127 Jenkins version 1.532.2.3 Github Enterprise

Thanks.

samreisner avatar Apr 13 '14 02:04 samreisner

I also have the same demand:one pull request initiate some separate jobs in Jenkins all of the jobs can work But only one of the results is showed in GitHub, which I want to show all the results, How to do ?

Jenkins version 1.557 Github Enterprise

wulonghui avatar Apr 21 '14 03:04 wulonghui

@WuLonghui all the results are there, it's just the GitHub UI only shows the latest. The APIs will have all of them updates.

valdisrigdon avatar May 27 '14 14:05 valdisrigdon

@samreisner Can you re-try this with the latest version?

valdisrigdon avatar May 27 '14 14:05 valdisrigdon

I'm having the same issue with 1.16-8 (and jenkins 1.602). I have 2 jobs configured to run for pull requests, but only one of them gets triggered.

verkestk avatar Mar 25 '15 15:03 verkestk

It seems to be working now, I have multiple jobs running for each pull request (just remember to change the "Commit Status Context" to have multiple statuses in Github)

mathroc avatar Oct 05 '15 12:10 mathroc

I'm still running into this issue (Jenkins ver. 1.638, GHPRB 1.30.4).

I have two jobs configured (and now using different commit status context), but only one of them gets triggered. The other job doesn't build at all...

@mathroc - how did you get yours working?

Does anyone know of any workarounds?

jameschao avatar Feb 24 '16 15:02 jameschao

@jameschao I've not done much, I just duplicated an existing job, changed the commit status context and change the build steps to some other tests and it worked. I have a up to 5 jobs on some projects for each PR; each one is always triggered and status is set on github for each one

mathroc avatar Apr 19 '16 09:04 mathroc

@mathroc - yeah, I was able to get it working through duplicating the jobs. But when I created a new job it didn't work. I haven't played with it since my original message so not sure if it's all good now.

jameschao avatar Apr 19 '16 14:04 jameschao

For us also only one job is selected randomly. (Jenkins 1.651.2, ghprb 1.31.4)

markus2330 avatar May 15 '16 17:05 markus2330

I tested ghprb 1.33.1 on Jenkins 1.651.3 today and hit the same issue. The first job I set up with one GitHub status context runs correctly, but other jobs (both copied from the first) don't launch new jobs.

FINEST level logging on ghprb shows this during polling (no webhooks being used):

Aug 22, 2016 8:03:01 AM INFO org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
Pull request #5 was updated/initialized on domcleal/test at 8/22/16 8:02 AM by Dominic Cleal (PR update)
Aug 22, 2016 8:03:01 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Checking for comments after: 8/22/16 7:42 AM
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 6:58 AM
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:37 AM
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:38 AM
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:42 AM
Aug 22, 2016 8:03:02 AM FINE org.jenkinsci.plugins.ghprb.GhprbPullRequest
New commit. Sha: Head[87cbb5c08a7eaad2bdfb16a884bae19accd22f1e => 48de577620611beb56a37ae1cd066e53945d3ec1] Base[7068bf6ea156c84b26dc19df0ceea55b784c9e35 => 7068bf6ea156c84b26dc19df0ceea55b784c9e35]
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Running the build
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
PR is not null, checking if mergable
Aug 22, 2016 8:03:02 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Running build...
Aug 22, 2016 8:03:03 AM INFO org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
Pull request #5 was updated/initialized on domcleal/test at 8/22/16 8:02 AM by Dominic Cleal (PR update)
Aug 22, 2016 8:03:03 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Checking for comments after: 8/22/16 7:42 AM
Aug 22, 2016 8:03:03 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 6:58 AM
Aug 22, 2016 8:03:03 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:37 AM
Aug 22, 2016 8:03:03 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:38 AM
Aug 22, 2016 8:03:03 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:42 AM
Aug 22, 2016 8:03:03 AM FINE org.jenkinsci.plugins.ghprb.GhprbPullRequest
New commit. Sha: Head[87cbb5c08a7eaad2bdfb16a884bae19accd22f1e => 48de577620611beb56a37ae1cd066e53945d3ec1] Base[7068bf6ea156c84b26dc19df0ceea55b784c9e35 => 7068bf6ea156c84b26dc19df0ceea55b784c9e35]
Aug 22, 2016 8:03:04 AM INFO org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
Pull request #5 was updated/initialized on domcleal/test at 8/22/16 8:02 AM by Dominic Cleal (PR update)
Aug 22, 2016 8:03:04 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Checking for comments after: 8/22/16 7:42 AM
Aug 22, 2016 8:03:04 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 6:58 AM
Aug 22, 2016 8:03:04 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:37 AM
Aug 22, 2016 8:03:04 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:38 AM
Aug 22, 2016 8:03:04 AM FINEST org.jenkinsci.plugins.ghprb.GhprbPullRequest
Comment was made at: 8/22/16 7:42 AM
Aug 22, 2016 8:03:04 AM FINE org.jenkinsci.plugins.ghprb.GhprbPullRequest
New commit. Sha: Head[87cbb5c08a7eaad2bdfb16a884bae19accd22f1e => 48de577620611beb56a37ae1cd066e53945d3ec1] Base[7068bf6ea156c84b26dc19df0ceea55b784c9e35 => 7068bf6ea156c84b26dc19df0ceea55b784c9e35]
Aug 22, 2016 8:04:01 AM INFO org.jenkinsci.plugins.ghprb.GhprbPullRequest updatePR
Pull request #5 was updated on repo domcleal/test but there aren't any new comments nor commits; that may mean that commit status was updated.
[..]

All notifications happen three times which indicates that it's monitoring for all three jobs, though after noting that the PR has updated, only the first seems to actually run the linked job. There don't seem to be any log messages indicating why the other jobs aren't started.

domcleal avatar Aug 22 '16 12:08 domcleal

Seems that enabling web hooks works more reliably than polling. With the exception of one job that still isn't running automatically, all of my others are being run when a webhook is received for a single PR.

domcleal avatar Aug 22 '16 13:08 domcleal

I'm also running into this issue.

larroy avatar Sep 12 '17 12:09 larroy

Can anyone explain how they achieved getting multiple Jenkins jobs triggered for one PR with this plugin? The documentation is somewhat opaque.

ianvernon avatar Nov 29 '17 05:11 ianvernon

I'm also running into this issue.

hierony94 avatar Dec 21 '17 04:12 hierony94

@ianvernon - the only way I've gotten this to work is to trigger only 1 job that then explicitly runs the other jobs. It's not the best, but it gets the job done.

verkestk avatar Mar 01 '18 22:03 verkestk

How to make this work:

In the job configuration, go to:

Build Triggers -> GitHub Pull Request Builder -> Trigger Setup...

Change Commit Status Context to be unique for each job.

audleman avatar Mar 02 '18 21:03 audleman