Join Plugin


This plugin allows a job to be run after all the immediate downstream jobs have completed.   In this way,  the execution can branch out and perform many steps in parallel, and then run a final aggregation step just once after all the parallel work is finished.
The plugin is useful for creating a 'diamond' shape project dependency.   This means there is a single parent job that starts several downstream jobs.   Once those jobs are finished, a single aggregation job runs.   More complex interactions are not possible with this plugin.

The downstream projects are specified using Hudson's normal project relationship mechanism. 

Plugin Information

Plugin ID join
Latest Release 1.13-h-2
Latest Release Date Oct 24, 2013
Sources Github
Support Eclipse Hudson Forum
Issue Tracking Eclipse Bugzilla



Example:

Our build consists of four jobs - test, testDown1, testDown2 and testJoin. Basically they have to run in sequence, but testDown1 and testDown2 could be run in parallel.(Maybe something like build - run tests - metrics - release). The logical overview of our jobs would be:

First we have to define our four jobs. With normal Hudson job dependency ("Build other projects") we add testDown1 and testDown2 to test. This is the fork in the diagram.

Adding the testJoin in that way is not possible, because would start it immediately after finishing the test-job. This is where this plugin jumps into: the test-job configures the Join Trigger and specifies the job to run after the join. The plugin is now able to start the testJoin job - but it needs to know when the forked jobs have finished. That's why we add the Join Trigger Upstream Notifier to these jobs.

Now the plugin gets the list of all forked jobs by its base job (test), gets informed by all forked jobs, waits for all "own" jobs to be completed and then starts the final job (testJoin).

Configuration of the base job (test):



Configuration of forked jobs - testDown1 + testDown2:

No configuration required.

Having multiple forks&joins in Hudson

The first example shows the use of this plugin for creating one 'diamond' job dependency. Having multiple diamonds is also easy (I whished it would be in real world ) But the resulting logical overview is a little bit different:
You have two base jobs (testA and testB) and Hudson forks them in the first step. Each of the diamonds has its own fork (2A and 2B). But ALL forked jobs inform the SAME observer (here shown as join bar JobJoin Observer). This ONE observer has two joins configured: the A-diamond and the B-diamond. And each fragment waits for recieving all the notifications it needs.

Example:

  1. Hudson starts
  2. Hudson starts testB
  3. Hudson starts testA
  4. testA finishes
  5. Hudson starts downA1
  6. Hudson starts downA2
  7. testB finishes
  8. Hudson starts downB2
  9. Hudson starts downB1
  10. downA2 finishes
  11. downA2 notifies the plugin
  12. PlugIn: downA2 belongs to diamond A
  13. PlugIn: diamond A requires downA1 and downA2
  14. PlugIn: diamond A is missing downA1, so do nothing
  15. downB2 finishes
  16. downB2 notifies the plugin
  17. PlugIn: downB2 belongs to diamond B
  18. PlugIn: diamond B requires downB1 and downB2
  19. PlugIn: diamond B is missing downB1, so do nothing
  20. downB1 finishes
  21. downB1 notifies the plugin
  22. PlugIn: downB1 belongs to diamond B
  23. PlugIn: diamond B requires downB1 and downB2
  24. PlugIn: all notifications recieved, so start joinB
  25. downA1 finishes
  26. downA1 notifies the plugin
  27. PlugIn: downA1 belongs to diamond A
  28. PlugIn: diamond A requires downA1 and downA2
  29. PlugIn: all notifications recieved, so start joinA

Changelog

Version 1.9 - September 13, 2010

  • Fix NPE on newer versions of Hudson when adding a post-build action like the copy-archiver or the parameterized-trigger plugin (7344)
  • Run parametrized-trigger after join should work again on Hudson version newer than 1.341 (5602)
  • Respect disabled projects: Start join projects when all non-disabled downstream projects are finished (5972).

Version 1.7 - January 16, 2010

  • Avoid error if parameterized-trigger plugin is installed, but current project doesn't use a parameterized BuildTrigger. (5159)

Version 1.6 - September 30, 2009

  • The join plugin will now wait for downstream builds triggered by the parameterized-trigger plugin, in addition to the built-in downstream projects, before performing the join actions.
  • Implement the getRequiredMonitorService method to indicate no dependency on the previous build. This should allow more parallelism when using concurrent builds.

Version 1.5 - September 18, 2009

  • Fix problem where email recipients were cleared on job save (4384)

Version 1.4 - September 2, 2009

  • Fix NPE for builds that are automatically upgraded from version 1.2 or earlier (4370)
  • Re-add Maven projects as applicable for the Join plugin. Matrix (multi-config) projects remain incompatible.  Feedback of using this plugin with Maven projects is sought.

Version 1.3 - August 31, 2009

  • Remove console log warnings from builds that are not using the join plugin (report)
  • Provide initial support for running arbitrary post-build actions as part of the join process. The parameterized-build plugin is the first candidate (3959)
  • Only offer Join plugin with Freestyle builds, due to report of Matrix build incompatibility. (report)

Version 1.2 - June 28, 2009

  • Downstream failure detection was broken previous to this version. Previously, the join projects were started no matter what the result of the downstream builds. With this fix, failed downstream builds block the join projects from being started (report)

Version 1.1 - May 30, 2009

  • Fix a NPE that occurs when the join plugin is enabled, but no downstream jobs are specified (report)
  • Start the join projects immediately if there are no downstream jobs specified.

Version 1.0 - May 23, 2009

  • Basic support for joining. After the downstream jobs finish, a comma separated list of jobs can be started as the join jobs.

Labels:

plugin-trigger plugin-trigger Delete
tier2-plugin tier2-plugin Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Sep 01, 2009

    Christian Hartmann says:

    Hi there, I just installed Hudson 1.322 and the Join Pugin 1.3 but now I've got...

    Hi there,

    I just installed Hudson 1.322 and the Join Pugin 1.3 but now I've got the following error running my builds:

    ERROR: Processing failed due to a bug in the code. Please report this to users@hudson.dev.java.net
    java.lang.NullPointerException
    at join.JoinTrigger.prebuild(JoinTrigger.java:70)

    With Hudson 1.320 and the Join Plugin 1.2 everything was fine.

    Can anybody help?

    Regards,

    Christian

    1. Sep 02, 2009

      David MacPhee says:

      Hi,    Definately something going on here, however on encountering th...

      Hi,

         Definately something going on here, however on encountering the same problem I looked at the jobs configure area. There is now a post join action. On populating this the exception is no longer happening.

      Hope this helps people move forward and with debugging.

      Dave

  2. Oct 21, 2009

    Shannon Qian says:

    I am using Join Plugin 1.6 in Hudson1.328. And I met with the following exceptio...

    I am using Join Plugin 1.6 in Hudson1.328. And I met with the following exception:

    FATAL: null
    java.lang.NullPointerException
    at join.JoinTrigger.TryGetParameterizedDownstreamNames(JoinTrigger.java:94)
    at join.JoinTrigger.perform(JoinTrigger.java:82)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
    at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:501)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:487)
    at hudson.model.AbstractBuild$AbstractRunner.performAllBuildStep(AbstractBuild.java:475)
    at hudson.model.Build$RunnerImpl.post2(Build.java:181)
    at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:459)
    at hudson.model.Run.run(Run.java:1143)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:123)

    below is my configure:
    I tried for three times:
    1. fill in "Projects to build once, after all downstream projects have finished" with "Run post-build actions at join" unchecked.
    2. have "Run post-build actions at join" configued with the former blank.
    3. have both configured
    But none succeeds.

    1. Oct 21, 2009

      Shannon Qian says:

      I read your source codes and came out with some work-around. The plugin fu...

      I read your source codes and came out with some work-around.

      The plugin function can work after the parameterized-trigger is simply disabled.

      I am afraid there's some conflict of Join-plugin against parameterized-trigger when the former intends to work together with the latter.

  3. Mar 24, 2010

    Mark Wolff says:

    We use join as the email notifier after the Windows, Linux, Mac, etc, builds all...

    We use join as the email notifier after the Windows, Linux, Mac, etc, builds all finished.  Unfortunately, the name of the person I want to mail is in the parametrized trigger variables and is not passed to the join.  Is this a feature in plan for this plug-in? 

    1. Aug 03, 2010

      Jean-Luc Pinardon says:

      I was really interesting with the Join Plugin until some new constraints makes m...

      I was really interesting with the Join Plugin until some new constraints makes me test the Parameterized Trigger Build plugin. Both works well, but they clearly seem to not be able to work altogether... It is a real problem, because both plugins are really important ones for complex job sequences.

  4. Sep 16, 2010

    Samer El Helou says:

    Hello, I have installed the latest version of the Join Plugin, but I can't seem ...

    Hello, I have installed the latest version of the Join Plugin, but I can't seem to make the Post-Join Actions jobs run. Is there any special configuartion for jobs to be able to run this mode?
    Thanks

  5. Nov 05, 2010

    Dan Fuller says:

    Is there any way to pass the bulid numbers from the downstream jobs to the join ...

    Is there any way to pass the bulid numbers from the downstream jobs to the join job?  Possibly in combination with the Parameterized Build plugin.

  6. Jan 03, 2011

    Hetal Shah says:

    I have created the job with the Option "Build multi-configuration project". But ...

    I have created the job with the Option "Build multi-configuration project". But in that case the join trigger is not available. In case of other job which I have created with the Option "Build a free-style software project" it is available. Is there any special configuration needs to be done to enable it for "Build multi-configuration project" ?

    Thanks,
    Hetal

    1. Jan 07, 2011

      Stefan Wolf says:

      The join trigger is not jet available for multi-configuration projects. Please o...

      The join trigger is not jet available for multi-configuration projects. Please open a feature request in jira. When I have time I will investigate this.

    2. Jan 08, 2011

      Michael Donohue says:

      This is now filed in JIRA as HUDSON-8443

      This is now filed in JIRA as HUDSON-8443

  7. Jan 06, 2011

    bill koester says:

    I am trying to use the join plugin as follows:      job-a ...

    I am trying to use the join plugin as follows:

         job-a

    job-b job-c

        job-d

    job-a build other projects are  job-b and job-c with join trigger job-d

    When job-a builds job-b and job-c get built and then job-d runs when both are complete. This is the expected behavior and works as advertised.

    However, if job-b is started by an SCM change or manually then it builds job-b but does not build job-d.

    The two scenarios I need to cover are:

    1) job-a is triggered manually or by SCM then job-b and job-c need to build in parallel and job-d must run when both are done. This works

    2) if one of the parallel jobs is triggered manually or by SCM then just that job needs to build AND job-d needs to build when it completes. This does not work.

    Can the join plugin support both of these situations?

    1. Jan 07, 2011

      Stefan Wolf says:

      This is probably possible but needs some code change. One possibility would be t...

      This is probably possible but needs some code change. One possibility would be to add a checkbox where one can choose this behaviour. Please open a jira ticket.

    2. Jan 08, 2011

      Michael Donohue says:

      This is now in JIRA as HUDSON-8450

      This is now in JIRA as HUDSON-8450

  8. Jan 09, 2011

    Daniel Adrian says:

    I'm trying to use the join plugin to define a flow of jobs but I have a slight p...

    I'm trying to use the join plugin to define a flow of jobs but I have a slight problem :)

    I have a job A, B and C;

    I define a job ABC to "build other projects" - job A and B, and after they complete I trigger job C. It all works well.

    Now I have another job, D. And I define another job called ABCD.

    I define job ABCD to "build other project"  - job ABC, and trigger job -D.

    The problem is when I run job ABCD.

    When building ABCD. It triggers a build of job ABC. - Expected behavior.

    Right after job ABC is triggered the build of jobs A and B are triggered but it also triggers job D, as if job ABC has been completed (and I suppose it has, becuase it's all defined in the post-build).

    Is this a bug, misuse or a limitation? If the latter anyone has an idea how to implement my flow?

    Thanks!

    1. Jan 14, 2011

      Hendryk Bockelmann says:

      For me it is the same problem ... I want to use a 'double diamond' job dependenc...

      For me it is the same problem ... I want to use a 'double diamond' job dependency, i.e. I want to have some jobs in a 'diamond' job dependency as shown above and then also a kind of master job which initialises all the diamonds (like the ABCD job) and after all diamonds (the ABC job with C as join) are finished there should be the master join (the D job in your example).

      As I understand the join trigger plugin, it is not possible to do this?!?!? The ABCD job waits for the triggered jobs to be finished (ABC in your case) and then directly starts the join job D - it does not pay any attention to the fact that ABC itself triggers and joins ...

      Unfortunately I don't see any possibility to overcome the problem.

      @maintainer of the plugin: is it possible to define (in your second example above) a job 'join' that joins the joinA and joinB jobs and is the JoinTrigger of 'Hudson fork 1'???

      addendum: I now have a solution for the problem which is not perfect but at least it works ... you can set job ABCD to trigger job ABC but NOT use the join on job D. Instead setup job D to be build after job C finished successfully. The only drawback I see is that job D gets triggered even if you do not start ABCD but only ABC ...

  9. Feb 21, 2011

    Sebastien Le Duc says:

    Is there a way to have the first job (the ones triggering the parallel jobs) blo...

    Is there a way to have the first job (the ones triggering the parallel jobs) blocked until all downstream jobs are done?

    The issue I am facing is that I would like to guarantee that all the parallel jobs use the same SVN revision as the first job.

  10. Jul 01, 2011

    Tim Gover says:

    Hello, I'm trying to use the join plugin to label a branch in Git if a set of bu...

    Hello, I'm trying to use the join plugin to label a branch in Git if a set of builds and tests were successful. How can I find out the status of the downstream jobs the ran before the join ?

  11. Dec 26, 2011

    Irfan Sayed says:

    is there any option like "Trigger even if some downstream projects are failed" ...

    is there any option like "Trigger even if some downstream projects are failed"

    i need to build the join projects even if , downstream jobs are failed