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

CopyArtifact with parameter selection fails when parameters changed

      Copy Artifact fails from (source) projects when
      their build parameters changed between different builds

      e.g. When ProjectY copies artifacts from ProjectX with parameter MY_X_PARAM=test
      ProjectY CopyArtifact fails when
      build #1 for ProjectX used no parameters,
      build #2 for ProjectX has (choice) parameter MY_X_PARAM=test

          [JENKINS-17702] CopyArtifact with parameter selection fails when parameters changed

          ikedam added a comment -

          Could not reproduce. I tested with Jenkins 1.480.3 + Copyartifact 1.26:

          1. Create a free style project "ProjectX"
            • Create a file "artifact.txt" with its content "without_parameter"
            • Archive artifact.txt
          2. Run ProjectX
          3. Update ProjectX
            • Add a choice parameter "MY_X_PARAM" with values only "test".
            • Change the content of artifact.txt to "parameter=${MY_X_PARAM}"
          4. Run ProjectX (with MY_X_PARAM=test)
          5. Create a free style project "ProjectY"
            • Add "Copy artifact from another project"
              • Project name: "ProjectX"
              • Which build: Latest successful build
              • Parameter filters: MY_X_PARAM=test
            • Output the contents of artifact.txt
          6. Run ProjectY

          Result:

          • The build of ProjectY succeeded.
          • The output was: parameter=test

          Please report the detailed step to reproduce.
          I'll close this issue in a month.

          ikedam added a comment - Could not reproduce. I tested with Jenkins 1.480.3 + Copyartifact 1.26: Create a free style project "ProjectX" Create a file "artifact.txt" with its content "without_parameter" Archive artifact.txt Run ProjectX Update ProjectX Add a choice parameter "MY_X_PARAM" with values only "test". Change the content of artifact.txt to "parameter=${MY_X_PARAM}" Run ProjectX (with MY_X_PARAM=test) Create a free style project "ProjectY" Add "Copy artifact from another project" Project name: "ProjectX" Which build: Latest successful build Parameter filters: MY_X_PARAM=test Output the contents of artifact.txt Run ProjectY Result: The build of ProjectY succeeded. The output was: parameter=test Please report the detailed step to reproduce. I'll close this issue in a month.

          Hi,

          Thank you for the reply!

          The procedure is correct as you tested it, but maybe two important differences with our setup:

          1. We use List Subversion tags (and more) parameter in ProjectX:

            Name : MY_X_PARAM
            Repository URL : svn+ssh://subversion.company.com/repo/branches
            Tags filter :
            Default value : test
            Maximum tags to display :

            Sort newest first : enabled
            Sort Z to A : disabled

          2. In step 3, we also changed the artifacts: artifact.txt -> artifact2.txt
            The ProjectY Copy artifacts from another project configuration:

            Project name : ProjectX
            Which build : Specified by a build parameter
            Parameter Name : PROJECT_X_BUILD
            Artifacts to copy : artifact2.txt
            Target directory : packages
            Parameter filters : MY_X_PARAM=${USE_X_PARAM}

            where

            PROJECT_X_BUILD: Build selector for Copy Artifact, defaulting to Last successful build
            USE_X_PARAM: Choice parameter with choices test, ...

          I hope this update helps to reproduce the issue!

          Thank you very much in advance!

          With best regards,
          Tom.

          Tom Ghyselinck added a comment - Hi, Thank you for the reply! The procedure is correct as you tested it, but maybe two important differences with our setup: We use List Subversion tags (and more) parameter in ProjectX : Name : MY_X_PARAM Repository URL : svn+ssh://subversion.company.com/repo/branches Tags filter : Default value : test Maximum tags to display : Sort newest first : enabled Sort Z to A : disabled In step 3 , we also changed the artifacts: artifact.txt -> artifact2.txt The ProjectY Copy artifacts from another project configuration: Project name : ProjectX Which build : Specified by a build parameter Parameter Name : PROJECT_X_BUILD Artifacts to copy : artifact2.txt Target directory : packages Parameter filters : MY_X_PARAM=${USE_X_PARAM} where PROJECT_X_BUILD : Build selector for Copy Artifact , defaulting to Last successful build USE_X_PARAM : Choice parameter with choices test , ... I hope this update helps to reproduce the issue! Thank you very much in advance! With best regards, Tom.

          ikedam added a comment -

          Could not reproduce even with the new information. I tested with Jenkins 1.480.3 + Copyartifact 1.26 + Subversion 1.39 (bundled with Jenkins 1.480.3):

          1. Create a free style project "ProjectX"
            • Create a file "artifact.txt" with its content "without_parameter"
            • Archive artifact.txt
          2. Run ProjectX
          3. Update ProjectX
            • Add a List Subversion tags parameter:
            • Change the name of the artifact to "artifact2.txt" (both copyartifact and archive) and its content to "parameter=${MY_X_PARAM}"
          4. Run ProjectX with MY_X_PARAM=HUDSON-1467
          5. Create a free style project "ProjectY"
            • Add a string parameter "USE_X_PARAM"
            • Add a Build selector for Copy Artifact parameter "PROJECT_X_BUILD"
            • Add "Copy artifact from another project"
              • Project name: "ProjectX"
              • Which build: Specified by a build parameter
              • Parameter Name: PROJECT_X_BUILD
              • Artifacts to copy: artifact2.txt
              • Target directory: packages
              • Parameter filters: MY_X_PARAM=${USE_X_PARAM}
            • Output the contents of packages/artifact2.txt
          6. Run ProjectY with USE_X_PARAM=HUDSON-1467 and PROJECT_X_BUILD=Latest successful build

          Result:

          • The build of ProjectY succeeded.
          • The output was: parameter=HUDSON-1467

          ikedam added a comment - Could not reproduce even with the new information. I tested with Jenkins 1.480.3 + Copyartifact 1.26 + Subversion 1.39 (bundled with Jenkins 1.480.3): Create a free style project "ProjectX" Create a file "artifact.txt" with its content "without_parameter" Archive artifact.txt Run ProjectX Update ProjectX Add a List Subversion tags parameter: Name: MY_X_PARAM Repository URL: https://svn.jenkins-ci.org/branches/ Change the name of the artifact to "artifact2.txt" (both copyartifact and archive) and its content to "parameter=${MY_X_PARAM}" Run ProjectX with MY_X_PARAM=HUDSON-1467 Create a free style project "ProjectY" Add a string parameter "USE_X_PARAM" Add a Build selector for Copy Artifact parameter "PROJECT_X_BUILD" Add "Copy artifact from another project" Project name: "ProjectX" Which build: Specified by a build parameter Parameter Name: PROJECT_X_BUILD Artifacts to copy: artifact2.txt Target directory: packages Parameter filters: MY_X_PARAM=${USE_X_PARAM} Output the contents of packages/artifact2.txt Run ProjectY with USE_X_PARAM=HUDSON-1467 and PROJECT_X_BUILD=Latest successful build Result: The build of ProjectY succeeded. The output was: parameter=HUDSON-1467

            Unassigned Unassigned
            tom_ghyselinck Tom Ghyselinck
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: