jenkinsci / jenkinsci/copyartifact-plugin

[JENKINS-16847] Support for copying artifacts from other builds being part of the same MultiJob (previous phases)

Open
#369 8 comments 0 reactions 0 assignees View on GitHub
component:copyartifact-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
67
Forks
122
Avg merge
2h 8m
Merged PRs (30d)
1

Description

Currently there is no easy way of selecting the right build to copy artifacts from if the project we want to copy from is part of MultiJob.

The "Last Successful Build" is prone for selecting the wrong build if the project was build again in the meantime between the MultiJob start and current moment

and "Upstream Project That Triggered this Build" does not work as previously executed builds in the same MultiJob are not considered "upstream" (are not listed as "causes").

A patch to TriggeredBuildSelector has been created to explicitly support MultiJob plugin pipelines and query it for builds already completed, treating them as if they were "causes". Somewhat dirty (for in for loop ), but works correctly and for the number of projects in a pipeline does not matter much.

See attachment and a corresponding pull request.

---
Originally reported by trojanbug, imported from: Support for copying artifacts from other builds being part of the same MultiJob (previous phases)


  • status: Open
  • priority: Major
  • component(s): copyartifact-plugin
  • resolution: Unresolved
  • votes: 3
  • watchers: 9
  • imported: 20260107-133739

Raw content of original issue

Currently there is no easy way of selecting the right build to copy artifacts from if the project we want to copy from is part of MultiJob.

The "Last Successful Build" is prone for selecting the wrong build if the project was build again in the meantime between the MultiJob start and current moment
and "Upstream Project That Triggered this Build" does not work as previously executed builds in the same MultiJob are not considered "upstream" (are not listed as "causes").

A patch to TriggeredBuildSelector has been created to explicitly support MultiJob plugin pipelines and query it for builds already completed, treating them as if they were "causes". Somewhat dirty (for in for loop ), but works correctly and for the number of projects in a pipeline does not matter much.

See attachment and a corresponding pull request.

1 attachment

- [copyartifact-plugin-trojanbug.zip](https://issues.jenkins.io/secure/attachment/23195/copyartifact-plugin-trojanbug.zip)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing TriggeredBuildSelector and the attached copyartifact-plugin-trojanbug.zip patch, then compare it with the corresponding pull request mentioned in the issue. Confirm how completed builds from earlier MultiJob phases are exposed and selected. Done means the appropriate prior build is treated like an upstream cause without falling back to an unrelated last successful build.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
ci-cd
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.