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

Parameter values of build selector change when upgrading CopyArtifact

      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).

          [JENKINS-24626] Parameter values of build selector change when upgrading CopyArtifact

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
          src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/83219279e24f36c14cd8d049a7a2d9c316d0e275
          Log:
          JENKINS-24626 Added tests for DownstreamBuildSelector.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/83219279e24f36c14cd8d049a7a2d9c316d0e275 Log: JENKINS-24626 Added tests for DownstreamBuildSelector.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help.html
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_de.html
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_ja.html
          src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-parameters.html
          http://jenkins-ci.org/commit/copyartifact-plugin/0d970525e59d0e3ab6fd4a477b9c224fa6a8ece0
          Log:
          JENKINS-24626 Add notices for compatibility of BuildSelectorParameter.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help.html src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_de.html src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_ja.html src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-parameters.html http://jenkins-ci.org/commit/copyartifact-plugin/0d970525e59d0e3ab6fd4a477b9c224fa6a8ece0 Log: JENKINS-24626 Add notices for compatibility of BuildSelectorParameter.

          Code changed in jenkins
          User: ikedam
          Path:
          src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help.html
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_de.html
          src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_ja.html
          src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-parameters.html
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/config.jelly
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/config_ja.properties
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamBuildNumber.html
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamBuildNumber_ja.html
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html
          src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html
          src/main/resources/hudson/plugins/copyartifact/Messages.properties
          src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties
          src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java
          http://jenkins-ci.org/commit/copyartifact-plugin/e80d72c7cde37bc53699acfaddbcd95b21f0522a
          Log:
          Merge pull request #44 from ikedam/feature/JENKINS-24626_DownstreamOf

          JENKINS-24626 Added a selector "Downstream of"

          Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/a7ce03cff19f...e80d72c7cde3

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: ikedam Path: src/main/java/hudson/plugins/copyartifact/DownstreamBuildSelector.java src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help.html src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_de.html src/main/resources/hudson/plugins/copyartifact/BuildSelectorParameter/help_ja.html src/main/resources/hudson/plugins/copyartifact/CopyArtifact/help-parameters.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/config.jelly src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/config_ja.properties src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamBuildNumber.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamBuildNumber_ja.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName.html src/main/resources/hudson/plugins/copyartifact/DownstreamBuildSelector/help-upstreamProjectName_ja.html src/main/resources/hudson/plugins/copyartifact/Messages.properties src/main/resources/hudson/plugins/copyartifact/Messages_ja.properties src/test/java/hudson/plugins/copyartifact/DownstreamBuildSelectorTest.java http://jenkins-ci.org/commit/copyartifact-plugin/e80d72c7cde37bc53699acfaddbcd95b21f0522a Log: Merge pull request #44 from ikedam/feature/ JENKINS-24626 _DownstreamOf JENKINS-24626 Added a selector "Downstream of" Compare: https://github.com/jenkinsci/copyartifact-plugin/compare/a7ce03cff19f...e80d72c7cde3

          ikedam added a comment -

          Let me have one more week to make a new release (1.32).
          I'm working on fixes for other bugs.

          I can provide a snapshot version that includes this feature if you want.
          Let me know if you need this feature soon.

          ikedam added a comment - Let me have one more week to make a new release (1.32). I'm working on fixes for other bugs. I can provide a snapshot version that includes this feature if you want. Let me know if you need this feature soon.

          Hi ikedam,

          Thank you for the update.

          Next week would be fine for us!
          This week we can still use other builds for testing.

          Thank you in advance!

          Tom Ghyselinck added a comment - Hi ikedam , Thank you for the update. Next week would be fine for us! This week we can still use other builds for testing. Thank you in advance!

          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?

          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?

          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.

          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.

          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".

          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".

          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

          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

          ikedam added a comment -

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

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

            ikedam ikedam
            tom_ghyselinck Tom Ghyselinck
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: