I am using MultiJob plugin 1.22 and Pipeline plugin 2.4. When I create empty Pipeline job and add it to new multi job, it does not show this job in the list (and does not build it).

          [JENKINS-38825] MultiJob does not build Pipeline jobs

          I need a possibility to orchestrate multiple pipelinejobs (exactly three ones, while the first must be completed and the other ones can run in parallel).
          Is there an issue regarding enabling Pipeline Jobs?

          Matthias Robert Wiora added a comment - I need a possibility to orchestrate multiple pipelinejobs (exactly three ones, while the first must be completed and the other ones can run in parallel). Is there an issue regarding enabling Pipeline Jobs?

          Simon Weber added a comment - - edited

          I'm happy to work on this if someone can point me in the right direction.

          Notably, the trigger plugin seems to work fine on its own (see https://issues.jenkins-ci.org/browse/JENKINS-38998?focusedCommentId=280639&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280639); this problem seems to be on multijob's end.

          Simon Weber added a comment - - edited I'm happy to work on this if someone can point me in the right direction. Notably, the trigger plugin seems to work fine on its own (see https://issues.jenkins-ci.org/browse/JENKINS-38998?focusedCommentId=280639&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-280639 ); this problem seems to be on multijob's end.

          Simon Weber added a comment -

          Maybe svanoort or jglick would be able to help (given their work on https://issues.jenkins-ci.org/browse/JENKINS-26050)?

          Simon Weber added a comment - Maybe svanoort or jglick would be able to help (given their work on https://issues.jenkins-ci.org/browse/JENKINS-26050)?

          Simon Weber added a comment -

          I made some progress on this today, mostly by switching from AbstractBuild/Project to Run/Job. I've got pipeline projects kicking off now, though there are problems propagating the result. I'll post back when I've got something workable.

          Simon Weber added a comment - I made some progress on this today, mostly by switching from AbstractBuild/Project to Run/Job. I've got pipeline projects kicking off now, though there are problems propagating the result. I'll post back when I've got something workable.

          Simon Weber added a comment -

          Alright, I've got things largely working. I'll clean things up and post some code tomorrow. I'll probably stop short of creating a PR, since my changes cut a lot of corners (eg removing some features around scm changes) in the interest of resolving the blocker.

          Simon Weber added a comment - Alright, I've got things largely working. I'll clean things up and post some code tomorrow. I'll probably stop short of creating a PR, since my changes cut a lot of corners (eg removing some features around scm changes) in the interest of resolving the blocker.

          Simon Weber added a comment -

          Ok, here's the changes: https://github.com/jenkinsci/tikal-multijob-plugin/compare/master...venmo:pipeline-compat.

          Be sure to read it over before trying it out: there are a variety of things I didn't take the time to support since we don't use them.

          Simon Weber added a comment - Ok, here's the changes: https://github.com/jenkinsci/tikal-multijob-plugin/compare/master...venmo:pipeline-compat . Be sure to read it over before trying it out: there are a variety of things I didn't take the time to support since we don't use them.

          Any news on this?

          Andrea Campolonghi added a comment - Any news on this?

          Hello,

          I just designed some multijobs which consist of jobs and pipelinejobs. Only the jobs show up and are triggered. I believe it's the same bug as above.

          I'm using Jenkins 2.67, Job DSL 1.61, Pipeline 2.5, Multijob plugin 1.25, Parametrized Trigger plugin 2.34.

          Alexandru Jieanu added a comment - Hello, I just designed some multijobs which consist of jobs and pipelinejobs. Only the jobs show up and are triggered. I believe it's the same bug as above. I'm using Jenkins 2.67, Job DSL 1.61, Pipeline 2.5, Multijob plugin 1.25, Parametrized Trigger plugin 2.34.

          We have same problem. Pipeline 2.11, Parametrized Trigger plugin 2.33, Multijob plugin 1.24

          Denis Zakharov added a comment - We have same problem. Pipeline 2.11, Parametrized Trigger plugin 2.33, Multijob plugin 1.24

          We have the same problem. Pipeline 2.5 Parametrized Trigger plugin 2.35.2, Multijob plugin 1.28

          Christoph Brass added a comment - We have the same problem. Pipeline 2.5 Parametrized Trigger plugin 2.35.2, Multijob plugin 1.28

          Iot Home added a comment -

          Has anyone trying the solution provided by Simon? I have a similar requirement and prefer the way the multijob plugin reports on job executions.

          Iot Home added a comment - Has anyone trying the solution provided by Simon? I have a similar requirement and prefer the way the multijob plugin reports on job executions.

          Suvir Pavin added a comment -

          Change mentioned by Simon works but there is one bug. MultiJob View Page doesn't show the job.

          View can be fixed by,

          // --- a/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java
          
          +++ b/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java
          
          @@ -7,12 +7,13 @@ import hudson.model.Item;
          
          import hudson.model.Result;
          
          import hudson.model.TopLevelItem;
          
          import hudson.model.ViewGroup;
          
          -import hudson.model.AbstractBuild;
          
          +import hudson.model.Run;
          
          import hudson.model.Descriptor;
          
          import hudson.model.Descriptor.FormException;
          
          import hudson.model.Hudson;
          
          import hudson.model.Job;
          
          import hudson.model.ListView;
          
          +import hudson.model.Run;
          
          import hudson.model.ViewDescriptor;
          
          import hudson.tasks.BuildStep;
          
          import hudson.tasks.Builder;
          
          @@ -41,7 +42,6 @@ import com.tikal.jenkins.plugins.multijob.MultiJobBuild.SubBuild;
          
          import com.tikal.jenkins.plugins.multijob.MultiJobBuilder;
          
          import com.tikal.jenkins.plugins.multijob.MultiJobProject;
          
          import com.tikal.jenkins.plugins.multijob.PhaseJobsConfig;
          
          -import hudson.model.AbstractProject;
          
          
          public class MultiJobView extends ListView {
          
          
          @@ -157,7 +157,7 @@ public class MultiJobView extends ListView {
          
                           currentPhaseName, isConditional);
          
                   out.add(phaseWrapper);
          
                   for (PhaseJobsConfig projectConfig : subProjects) {
          
          -            Item tli = Jenkins.getInstance().getItem(projectConfig.getJobName(), project.getParent(), AbstractProject.class);
          
          +            Item tli = Jenkins.getInstance().getItem(projectConfig.getJobName(), project.getParent(), Job.class);
          
                       if (tli instanceof MultiJobProject) {
          
                           MultiJobProject subProject = (MultiJobProject) tli;
          
                           BuildState jobBuildState = createBuildState(buildState,
          
          @@ -216,7 +216,7 @@ public class MultiJobView extends ListView {
          
                   if (lastParentSuccessBuild != null) {
          
                       for (SubBuild subBuild : lastParentSuccessBuild.getSubBuilds()) {
          
                           if (subBuild.getJobName().equals(project.getName())) {
          
          -                    AbstractBuild build = (AbstractBuild) project
          
          +                    Run build = (Run) project
          
                                       .getBuildByNumber(subBuild.getBuildNumber());
          
                               if (build != null
          
                                       && Result.SUCCESS.equals(build.getResult())) {
          
          @@ -233,10 +233,10 @@ public class MultiJobView extends ListView {
          
                   if (lastParentFailureBuild != null) {
          
                       for (SubBuild subBuild : lastParentFailureBuild.getSubBuilds()) {
          
                           if (subBuild.getJobName().equals(project.getName())) {
          
          -                    AbstractBuild build = (AbstractBuild) project
          
          +                    Run build = (Run) project
          
                                       .getBuildByNumber(subBuild.getBuildNumber());
          
                               if (build != null
          
          -                            && Result.FAILURE.equals(((AbstractBuild) build)
          
          +                            && Result.FAILURE.equals(((Run) build)
          
                                               .getResult())) {
          
                                   lastFailureBuildNumber = subBuild.getBuildNumber();
          
                                   break;
          
          
          

          Suvir Pavin added a comment - Change mentioned by Simon works but there is one bug. MultiJob View Page doesn't show the job. View can be fixed by, // --- a/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java +++ b/src/main/java/com/tikal/jenkins/plugins/multijob/views/MultiJobView.java @@ -7,12 +7,13 @@ import hudson.model.Item; import hudson.model.Result; import hudson.model.TopLevelItem; import hudson.model.ViewGroup; - import hudson.model.AbstractBuild; + import hudson.model.Run; import hudson.model.Descriptor; import hudson.model.Descriptor.FormException; import hudson.model.Hudson; import hudson.model.Job; import hudson.model.ListView; + import hudson.model.Run; import hudson.model.ViewDescriptor; import hudson.tasks.BuildStep; import hudson.tasks.Builder; @@ -41,7 +42,6 @@ import com.tikal.jenkins.plugins.multijob.MultiJobBuild.SubBuild; import com.tikal.jenkins.plugins.multijob.MultiJobBuilder; import com.tikal.jenkins.plugins.multijob.MultiJobProject; import com.tikal.jenkins.plugins.multijob.PhaseJobsConfig; - import hudson.model.AbstractProject; public class MultiJobView extends ListView { @@ -157,7 +157,7 @@ public class MultiJobView extends ListView {                  currentPhaseName, isConditional);          out.add(phaseWrapper);          for (PhaseJobsConfig projectConfig : subProjects) { -            Item tli = Jenkins.getInstance().getItem(projectConfig.getJobName(), project.getParent(), AbstractProject.class); +            Item tli = Jenkins.getInstance().getItem(projectConfig.getJobName(), project.getParent(), Job.class);              if (tli instanceof MultiJobProject) {                  MultiJobProject subProject = (MultiJobProject) tli;                  BuildState jobBuildState = createBuildState(buildState, @@ -216,7 +216,7 @@ public class MultiJobView extends ListView {          if (lastParentSuccessBuild != null ) {              for (SubBuild subBuild : lastParentSuccessBuild.getSubBuilds()) {                  if (subBuild.getJobName().equals(project.getName())) { -                    AbstractBuild build = (AbstractBuild) project +                    Run build = (Run) project                              .getBuildByNumber(subBuild.getBuildNumber());                      if (build != null                              && Result.SUCCESS.equals(build.getResult())) { @@ -233,10 +233,10 @@ public class MultiJobView extends ListView {          if (lastParentFailureBuild != null ) {              for (SubBuild subBuild : lastParentFailureBuild.getSubBuilds()) {                  if (subBuild.getJobName().equals(project.getName())) { -                    AbstractBuild build = (AbstractBuild) project +                    Run build = (Run) project                              .getBuildByNumber(subBuild.getBuildNumber());                      if (build != null -                            && Result.FAILURE.equals(((AbstractBuild) build) +                            && Result.FAILURE.equals(((Run) build)                                      .getResult())) {                          lastFailureBuildNumber = subBuild.getBuildNumber();                          break ;

          Suvir Pavin added a comment -

          Can we include changes done by Simon and above fix in next release of MultiJob Plugin?

          Suvir Pavin added a comment - Can we include changes done by Simon and above fix in next release of MultiJob Plugin?

          Tiejun Sha added a comment -

          +1 , we are eager to get this fix as well

          Tiejun Sha added a comment - +1 , we are eager to get this fix as well

          +1, to have this fixed in the next release

          Balázs Bábos added a comment - +1, to have this fixed in the next release

          Ximei Zhang added a comment -

          +1 we worked around it by adding a freestyle job in the multijob to trigger a pipeline job. But it would be great to have this fixed.

          Ximei Zhang added a comment - +1 we worked around it by adding a freestyle job in the multijob to trigger a pipeline job. But it would be great to have this fixed.

          Dear Ximei,

          Did you manage to pass all parameters somehow to the pipeline job too?

          Balázs Bábos added a comment - Dear Ximei, Did you manage to pass all parameters somehow to the pipeline job too?

          Ximei Zhang added a comment -

          Yeah pipeline job has no problem to get the param values from the freestyle job.

          Ximei Zhang added a comment - Yeah pipeline job has no problem to get the param values from the freestyle job.

          Hm. And how do you call the pipeline from the freestyle job actually? You are not using a post build step, are you?

          Balázs Bábos added a comment - Hm. And how do you call the pipeline from the freestyle job actually? You are not using a post build step, are you?

          Ximei Zhang added a comment -

          In the build step, i call builds on other project.

          Ximei Zhang added a comment - In the build step, i call builds on other project.

          Closing issue as part of tikal-multijob-plugin issues cleanup.
          If still relevant, please open a matching issue in https://github.com/jenkinsci/tikal-multijob-plugin/issues (you can refer to this issue in its description)

          Yoram Michaeli added a comment - Closing issue as part of tikal-multijob-plugin issues cleanup. If still relevant, please open a matching issue in https://github.com/jenkinsci/tikal-multijob-plugin/issues (you can refer to this issue in its description)

          Fixed in 1.32

          Yoram Michaeli added a comment - Fixed in 1.32

            Unassigned Unassigned
            andrey Andrey Chernih
            Votes:
            31 Vote for this issue
            Watchers:
            32 Start watching this issue

              Created:
              Updated:
              Resolved: