Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38825

MultiJob does not build Pipeline jobs

    Details

    • Similar Issues:

      Description

      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).

        Attachments

          Issue Links

            Activity

            Hide
            mwiora 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?

            Show
            mwiora 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?
            Hide
            simonmweber 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.

            Show
            simonmweber 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.
            Hide
            simonmweber Simon Weber added a comment -

            Maybe Sam Van Oort or Jesse Glick would be able to help (given their work on https://issues.jenkins-ci.org/browse/JENKINS-26050)?

            Show
            simonmweber Simon Weber added a comment - Maybe Sam Van Oort or Jesse Glick would be able to help (given their work on https://issues.jenkins-ci.org/browse/JENKINS-26050)?
            Hide
            simonmweber 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.

            Show
            simonmweber 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.
            Hide
            simonmweber 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.

            Show
            simonmweber 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.
            Hide
            simonmweber 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.

            Show
            simonmweber 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.
            Hide
            acampolonghi Andrea Campolonghi added a comment -

            Any news on this?

            Show
            acampolonghi Andrea Campolonghi added a comment - Any news on this?
            Hide
            alexandrujieanu 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.

            Show
            alexandrujieanu 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.
            Hide
            zakharovdi Denis Zakharov added a comment -

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

            Show
            zakharovdi Denis Zakharov added a comment - We have same problem. Pipeline 2.11, Parametrized Trigger plugin 2.33, Multijob plugin 1.24
            Hide
            christophbrass Christoph Brass added a comment -

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

            Show
            christophbrass Christoph Brass added a comment - We have the same problem. Pipeline 2.5 Parametrized Trigger plugin 2.35.2, Multijob plugin 1.28
            Hide
            theiamdude 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.

            Show
            theiamdude 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.
            Hide
            suvir_pavin 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;
            
            
            
            Show
            suvir_pavin 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 ;
            Hide
            suvir_pavin Suvir Pavin added a comment -

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

            Show
            suvir_pavin Suvir Pavin added a comment - Can we include changes done by Simon and above fix in next release of MultiJob Plugin?
            Hide
            freemail165 Tiejun Sha added a comment -

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

            Show
            freemail165 Tiejun Sha added a comment - +1 , we are eager to get this fix as well
            Hide
            lordbbk Balázs Bábos added a comment -

            +1, to have this fixed in the next release

            Show
            lordbbk Balázs Bábos added a comment - +1, to have this fixed in the next release
            Hide
            ximei 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.

            Show
            ximei 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.
            Hide
            lordbbk Balázs Bábos added a comment -

            Dear Ximei,

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

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

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

            Show
            ximei Ximei Zhang added a comment - Yeah pipeline job has no problem to get the param values from the freestyle job.
            Hide
            lordbbk 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?

            Show
            lordbbk 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?
            Hide
            ximei Ximei Zhang added a comment -

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

            Show
            ximei Ximei Zhang added a comment - In the build step, i call builds on other project.
            Hide
            yorammi 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)

            Show
            yorammi 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)
            Hide
            yorammi Yoram Michaeli added a comment -

            Fixed in 1.32

            Show
            yorammi Yoram Michaeli added a comment - Fixed in 1.32

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: