-
Bug
-
Resolution: Postponed
-
Critical
-
Powered by SuggestiMate
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'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.
Maybe svanoort or jglick would be able to help (given their work on https://issues.jenkins-ci.org/browse/JENKINS-26050)?
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.
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.
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.
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
We have the same problem. Pipeline 2.5 Parametrized Trigger plugin 2.35.2, Multijob plugin 1.28
Has anyone trying the solution provided by Simon? I have a similar requirement and prefer the way the multijob plugin reports on job executions.
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;
Can we include changes done by Simon and above fix in next release of MultiJob Plugin?
+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?
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?
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)
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?