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

BUILD_SELECTOR is not passed to matrix subprojects

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: copyartifact-plugin
    • Labels:
    • Environment:
      Jenkins: 2.5, Linux x64, Java 1.8.0_91, matrix-project 1.6, copyartifact 1.38
    • Similar Issues:

      Description

      A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script

      echo "%BUILD_SELECTOR%"

      prints as expected:

      00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
      00:00:00.095 
      00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38">  <fallbackToLastSuccessful>true</fallbackToLastSuccessful>  <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy>  <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>" 
      00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38">  <fallbackToLastSuccessful>true</fallbackToLastSuccessful>  <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy>  <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
      00:00:00.095 
      00:00:00.095 C:\Jenkins\workspace\******>exit 0 
      00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
      00:00:09.371 Copied 603 artifacts from "******" build number 10
      

      When using the same setup (Build selector parameter; windows batch script and copy artifact step) in an matrix job, we get the following result:

      00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
      00:00:00.096 
      00:00:00.096 C:\Jenkins\workspace\******>echo "" 
      00:00:00.096 ""
      00:00:00.097 
      00:00:00.097 C:\Jenkins\workspace\******>exit 0 
      00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
      00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
      

      It looks as if the parameter is not passed to the subproject created automatically for each combination. When specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.

        Attachments

          Issue Links

            Activity

            phi1010 Phillip Kuhrt created issue -
            phi1010 Phillip Kuhrt made changes -
            Field Original Value New Value
            Description A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script {code}echo "%BUILD_SELECTOR%"{code}
            prints as expected:
            {code}
            00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>exit 0
            00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:09.371 Copied 603 artifacts from "******" build number 10
            {code}

            When using the same setup in an matrix job (Build selector parameter; windows batch script and copy artifact step), we get the following result:

            {code}
            00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.096
            00:00:00.096 C:\Jenkins\workspace\******>echo ""
            00:00:00.096 ""
            00:00:00.097
            00:00:00.097 C:\Jenkins\workspace\******>exit 0
            00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
            {code}

            It looks as if the parameter is not passed to the subproject created automatically for each combination. Specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.
            A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script {code}echo "%BUILD_SELECTOR%"{code}
            prints as expected:
            {code}
            00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>exit 0
            00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:09.371 Copied 603 artifacts from "******" build number 10
            {code}

            When using the same setup (Build selector parameter; windows batch script and copy artifact step) in an matrix job, we get the following result:

            {code}
            00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.096
            00:00:00.096 C:\Jenkins\workspace\******>echo ""
            00:00:00.096 ""
            00:00:00.097
            00:00:00.097 C:\Jenkins\workspace\******>exit 0
            00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
            {code}

            It looks as if the parameter is not passed to the subproject created automatically for each combination. Specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.
            phi1010 Phillip Kuhrt made changes -
            Environment Jenkins: 2.5

            {code}
            java.class.path /usr/share/jenkins/jenkins.war
            java.class.version 52.0

            os.name Linux
            os.version 3.16.0-4-amd64

            java.runtime.name Java(TM) SE Runtime Environment
            java.runtime.version 1.8.0_91-b14
            java.specification.name Java Platform API Specification
            java.specification.vendor Oracle Corporation
            java.specification.version 1.8
            java.vendor Oracle Corporation
            java.vendor.url http://java.oracle.com/
            java.vendor.url.bug http://bugreport.sun.com/bugreport/
            java.version 1.8.0_91
            java.vm.info mixed mode
            java.vm.name Java HotSpot(TM) 64-Bit Server VM
            java.vm.specification.name Java Virtual Machine Specification
            java.vm.specification.vendor Oracle Corporation
            java.vm.specification.version 1.8
            java.vm.vendor Oracle Corporation
            java.vm.version 25.91-b14

            matrix-project 1.6 true false
            copyartifact 1.38 true false
            {code}
            Jenkins: 2.5, Linux x64, Java 1.8.0_91, matrix-project 1.6, copyartifact 1.38
            phi1010 Phillip Kuhrt made changes -
            Description A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script {code}echo "%BUILD_SELECTOR%"{code}
            prints as expected:
            {code}
            00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>exit 0
            00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:09.371 Copied 603 artifacts from "******" build number 10
            {code}

            When using the same setup (Build selector parameter; windows batch script and copy artifact step) in an matrix job, we get the following result:

            {code}
            00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.096
            00:00:00.096 C:\Jenkins\workspace\******>echo ""
            00:00:00.096 ""
            00:00:00.097
            00:00:00.097 C:\Jenkins\workspace\******>exit 0
            00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
            {code}

            It looks as if the parameter is not passed to the subproject created automatically for each combination. Specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.
            A parameter of the type "Build selector for Copy Artifact" works fine when using it in an freestyle job, it copies the artifacts and the windows script {code}echo "%BUILD_SELECTOR%"{code}
            prints as expected:
            {code}
            00:00:00.059 [IntegrationTest] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>echo "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095 "<TriggeredBuildSelector plugin="copyartifact@1.38"> <fallbackToLastSuccessful>true</fallbackToLastSuccessful> <upstreamFilterStrategy>UseNewest</upstreamFilterStrategy> <allowUpstreamDependencies>true</allowUpstreamDependencies></TriggeredBuildSelector>"
            00:00:00.095
            00:00:00.095 C:\Jenkins\workspace\******>exit 0
            00:00:00.107 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:09.371 Copied 603 artifacts from "******" build number 10
            {code}

            When using the same setup (Build selector parameter; windows batch script and copy artifact step) in an matrix job, we get the following result:

            {code}
            00:00:00.053 [******] $ cmd /c call C:\Users\JENKIN~1\AppData\Local\Temp\hudson******.bat
            00:00:00.096
            00:00:00.096 C:\Jenkins\workspace\******>echo ""
            00:00:00.096 ""
            00:00:00.097
            00:00:00.097 C:\Jenkins\workspace\******>exit 0
            00:00:00.110 Setting MSBUILD_12_HOME=C:\Program Files (x86)\MSBuild\12.0\Bin\
            00:00:00.112 ERROR: Unable to find a build for artifact copy from: Build2/BuildConfiguration=Debug,Slave=******
            {code}

            It looks as if the parameter is not passed to the subproject created automatically for each combination. When specifying the Build selector directly (without variable, choosing "Upstream build that triggered this job" instead of "Specified by build selector"), the artifacts are copied.
            Hide
            ikedam ikedam added a comment -

            Sounds the issue reported in JENKINS-34758.
            matrix-project 1.7 fixed the issue.
            Please try that.

            Show
            ikedam ikedam added a comment - Sounds the issue reported in JENKINS-34758 . matrix-project 1.7 fixed the issue. Please try that.
            ikedam ikedam made changes -
            Link This issue duplicates JENKINS-34758 [ JENKINS-34758 ]
            ikedam ikedam made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Duplicate [ 3 ]
            Hide
            phi1010 Phillip Kuhrt added a comment -

            Yes, that fixed it.
            Thank you.

            Show
            phi1010 Phillip Kuhrt added a comment - Yes, that fixed it. Thank you.
            phi1010 Phillip Kuhrt made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 171323 ] JNJira + In-Review [ 210077 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                phi1010 Phillip Kuhrt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: