-
Type:
Improvement
-
Resolution: Won't Fix
-
Priority:
Minor
-
Component/s: delivery-pipeline-plugin
-
None
-
Environment:jenkins 1.609.1
delivery-pipeline-plugin 0.9.4
copy artifact 1.35.2
priority-sorter 3.4
job-dsl 1.35
I am constructing a delivery pipeline where each stage is longer than the previous one. I want each of the later stages to run on the latest version that has passed all previous stages, skipping older versions. I am triggering each job from a previous one as a post build step so this results in multiple upstream triggers. The delivery pipeline plugin selects the oldest of these rather than the newest. It would be very helpful to have an option to use the newest instead (like the copy artifact plugin "Which for multiple upstream" option).
The below Job DSL code demonstrates the issue. I have used the priority sorter plugin to ensure earlier steps are run in preference. I manually triggered "Sleep_small" a few times. The attached image shows that when Sleep_medium combines multiple upstreams from Sleep_small, it picks the oldest (6), rather than the latest (8). This applies to the view and the PIPELINE_VERSION parameter which is 6 for all of the jobs.
// Requires delivery pipeline, priority sorter plugins def Sleep_factory(def dslFactory, def jobName, def time, def next_job_name, def priorityValue, def create_version) { dslFactory.job(jobName) { wrappers { deliveryPipelineVersion('${BUILD_NUMBER}') } steps { shell("sleep ${time}") shell("echo \$PIPELINE_VERSION") } if (next_job_name != null) { publishers { downstream(next_job_name) } } configure { project -> project / 'properties' / 'jenkins.advancedqueue.priority.strategy.PriorityJobProperty' { useJobPriority('true') priority(priorityValue) } } } } Sleep_factory(this, "Sleep_small", 1, "Sleep_Medium", 1, true) Sleep_factory(this, "Sleep_medium", 10, "Sleep_Large", 2, false) Sleep_factory(this, "Sleep_large", 100, "Sleep_xl", 3, false) Sleep_factory(this, "Sleep_xl", 1000, null, 4, false) deliveryPipelineView("Test_pipeline") { showAggregatedPipeline() pipelines { component("Pipeline", "Sleep_small") } }