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

Parameter values of build selector change when upgrading CopyArtifact

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Hi,

      We have a problem when passing Build selector for Copy Artifact as a parameter filter for an older job/build.

      Suppose 3 Jobs:

      • Job 1: DepJob
      • Job 2: SubJob
        • Build selector for Copy Artifact Parameter: SELECT_ME
          • Default selector : Specific build
          • Build number : 123
        • Build step: Copy artifacts from another project:
          • Project Name : DepJob
          • Which build : Specified by a build parameter
            • Parameter Name : SELECT_ME
      • Job 3: MainJob
        • Build selector for Copy Artifact Parameter: SELECT_DEPJOB
          • Default selector : Specific build
          • Build number : 123
        • Build step: Copy artifacts from another project:
          • Project Name : SubJob
          • Which build : Latest successful build
          • Parameter filters : SELECT_ME=$SELECT_DEPJOB

      Quick issue description

      When last successful build of SubJob has been built with an older version of the Copy Artifact Plugin, then MainJob cannot find the artifacts although they exist!

      Details

      1. DepJob has a build 123.
      2. SubJob performs some builds with Copy Artifact Plugin version 1.26:
        • Build selector for Copy Artifact Parameter:
          • SELECT_ME: Specific build -> 123
      3. Update Copy Artifact Plugin
      4. MainJob performs build with Copy Artifact Plugin version 1.31:
        • Build selector for Copy Artifact Parameter:
          • SELECT_DEPJOB: Specific build -> 123
      5. MainJob build fails since it cannot find atifacts with SELECT_ME: Specific build -> 123 in the old builds of SubJob!

      This is a blocker for us since we have a very large project which uses this kind of constructions for packaging all sub-projects (aka sub jobs).

      We recently updated the Copy Artifact Plugin, but we still need lots of artifacts the old(er) sub-projects (for which currently no rebuilt is needed).

        Attachments

          Activity

          Hide
          rsennewald Ray Sennewald added a comment -

          Hi ikedam. I found an existing ticket for what I was wanting to implement for MultiJob: https://issues.jenkins-ci.org/browse/JENKINS-16847. Any chance you could review my work there?

          Show
          rsennewald Ray Sennewald added a comment - Hi ikedam. I found an existing ticket for what I was wanting to implement for MultiJob: https://issues.jenkins-ci.org/browse/JENKINS-16847 . Any chance you could review my work there?
          Hide
          ikedam ikedam added a comment -

          You can use "Downstream build of" to pick a build in a same multijob.

          • Pass the build number of the multijob build to downstream builds.
            • Use as a parameter for "Downstream build of").
          • Fingerprint files with a same content in the parent multijob build and the child build to copy artifacts from.
            • Fingerprinting is required for "Downstream build of" to find downstream builds.
            • You need Fingerprint plugin to fingerprint in multijob.
            • ${BUILD_ID} of the parent multijob build is good for the content of the file.

          I know this is just a workaround as it's not easy to use.
          The best way is to introduce a new buld selector to multijob-plugin.

          Show
          ikedam ikedam added a comment - You can use "Downstream build of" to pick a build in a same multijob. Pass the build number of the multijob build to downstream builds. Use as a parameter for "Downstream build of"). Fingerprint files with a same content in the parent multijob build and the child build to copy artifacts from. Fingerprinting is required for "Downstream build of" to find downstream builds. You need Fingerprint plugin to fingerprint in multijob. ${BUILD_ID} of the parent multijob build is good for the content of the file. I know this is just a workaround as it's not easy to use. The best way is to introduce a new buld selector to multijob-plugin.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
          http://jenkins-ci.org/commit/copyartifact-plugin/bdbfc6f1b7bc86d6184547c23c7e1d59ceb3feb3
          Log:
          JENKINS-24626 Added auto-completion for project names in "Downstream build of".

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java http://jenkins-ci.org/commit/copyartifact-plugin/bdbfc6f1b7bc86d6184547c23c7e1d59ceb3feb3 Log: JENKINS-24626 Added auto-completion for project names in "Downstream build of".
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
          http://jenkins-ci.org/commit/copyartifact-plugin/06322b202497b3468a85c97c2033d05c771060b4
          Log:
          Merge pull request #50 from ikedam/feature/JENKINS-24626_AutoCompleteForDownstreamOf

          JENKINS-24626 Added auto-completion for project names in "Downstream build of".

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/c9809c881745...06322b202497

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java http://jenkins-ci.org/commit/copyartifact-plugin/06322b202497b3468a85c97c2033d05c771060b4 Log: Merge pull request #50 from ikedam/feature/ JENKINS-24626 _AutoCompleteForDownstreamOf JENKINS-24626 Added auto-completion for project names in "Downstream build of". Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/c9809c881745...06322b202497
          Hide
          ikedam ikedam added a comment -

          Released 1.32, which provides "Downstream build of" selector.
          It will be available in a day.
          Please try that.

          Show
          ikedam ikedam added a comment - Released 1.32, which provides "Downstream build of" selector. It will be available in a day. Please try that.

            People

            • Assignee:
              ikedam ikedam
              Reporter:
              tom_ghyselinck Tom Ghyselinck
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: