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

Support for copying artifacts from other builds being part of the same MultiJob (previous phases)

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • copyartifact-plugin
    • None

      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.

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

          Krzysztof Trojan created issue -

          Could you please take a look if the contribution could be made part of the next version, I would prefer not to depend on branched code in my builds.

          Krzysztof Trojan added a comment - Could you please take a look if the contribution could be made part of the next version, I would prefer not to depend on branched code in my builds.
          Krzysztof Trojan made changes -
          Assignee New: Alan Harder [ mindless ]

          Created a pull request (finally on my machine ):
          https://github.com/jenkinsci/copyartifact-plugin/pull/16

          Krzysztof Trojan added a comment - Created a pull request (finally on my machine ): https://github.com/jenkinsci/copyartifact-plugin/pull/16

          Alan Harder added a comment -

          Please ask on the dev alias for someone to accept the pull request, or to get access so you can submit it yourself, thanks!

          Alan Harder added a comment - Please ask on the dev alias for someone to accept the pull request, or to get access so you can submit it yourself, thanks!
          Alan Harder made changes -
          Assignee Original: Alan Harder [ mindless ]

          I would also be very interested in this feature

          Emmanuel Grumbach added a comment - I would also be very interested in this feature

          Ray Sennewald added a comment -

          I've added a pull request for this functionality, albeit with a new Selector (MultiJobSelector). I've also added support for grabbing the artifact from a PhaseJob in another PhaseJob or in the parent MultiJob itself: https://github.com/jenkinsci/copyartifact-plugin/pull/49.

          Ray Sennewald added a comment - I've added a pull request for this functionality, albeit with a new Selector (MultiJobSelector). I've also added support for grabbing the artifact from a PhaseJob in another PhaseJob or in the parent MultiJob itself: https://github.com/jenkinsci/copyartifact-plugin/pull/49 .

          Ray, while useful, adding a new selector makes it possible to run the job only within MultiJob.

          What if one wanted to use also in regular pipelines (project triggered both as part of MultiJob and by another project) ?
          In the sense the original concept would I think work better ?

          Krzysztof Trojan added a comment - Ray, while useful, adding a new selector makes it possible to run the job only within MultiJob. What if one wanted to use also in regular pipelines (project triggered both as part of MultiJob and by another project) ? In the sense the original concept would I think work better ?
          Krzysztof Trojan made changes -
          Description Original: 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. Complete project as I did not have a decent diff on the machine I am writing this on (sorry!).
          New: 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.

            Unassigned Unassigned
            trojanbug Krzysztof Trojan
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: