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

Copying artifacts from project in sub-folder using parameter doesn't work

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Let say we have the following job structure

      Builds > TRUNK > TRUNK-Installer

      Builds > PerformanceTest

      where Builds and TRUNK are the folders
      PerformanceTest has a parameter called SOURCE_VERSION
       

      Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

      ${SOURCE_VERSION}/${SOURCE_VERSION}-Installer

      Now the PerformanceTest with parameter SOURCE_VERSION=TRUNK fails with

      17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
      17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.

       
      BUT
      if I change Project name for just

      TRUNK/TRUNK-Installer

      It will work like a charm

      Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47

        Attachments

          Activity

          andreyt Andrey T created issue -
          andreyt Andrey T made changes -
          Field Original Value New Value
          Description Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/DPA-${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/DPA-TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/DPA-TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/DPA-TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/DPA-TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          andreyt Andrey T made changes -
          Description Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/DPA-TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/DPA-TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/DPA-TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          andreyt Andrey T made changes -
          Description Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/DPA-TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          andreyt Andrey T made changes -
          Description Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          Let say we have the following job structure

          Builds > TRUNK > TRUNK-Installer

          Builds > PerformanceTest

          where Builds and TRUNK are the folders
          PerformanceTest has a parameter called SOURCE_VERSION
           

          Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

          {code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

          Now the PerformanceTest with parameter SOURCE_VERSION=TRUNK fails with
          {code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
          17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
           
          *BUT*
          if I change Project name for just
          {code}TRUNK/TRUNK-Installer{code}

          It will work like a charm
          {code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}
          Hide
          andreyt Andrey T added a comment - - edited

          It seems that I've missed the configuration of "Builds > TRUNK > TRUNK-Installer" Permission to copy artifacts option
          Used a wildcard and it started to work.

          The trick is hidden here hudson/plugins/copyartifact/CopyArtifact.java line 414.

          if (job != null && !expandedProject.equals(project)
                      // If projectName is parameterized, need to do permission check on source project.
                      && !canReadFrom(job, build)) {
                      job = null; // Disallow access
                  }
          

          If a build selected using a parameter it then checks for permissions.
          I'm not sure why it's not checked when there are no parameters involved because it confused me a lot...

          Show
          andreyt Andrey T added a comment - - edited It seems that I've missed the configuration of "Builds > TRUNK > TRUNK-Installer" Permission to copy artifacts option Used a wildcard and it started to work. The trick is hidden here hudson/plugins/copyartifact/CopyArtifact.java line 414. if (job != null && !expandedProject.equals(project) // If projectName is parameterized, need to do permission check on source project. && !canReadFrom(job, build)) { job = null ; // Disallow access } If a build selected using a parameter it then checks for permissions. I'm not sure why it's not checked when there are no parameters involved because it confused me a lot...
          andreyt Andrey T made changes -
          Priority Critical [ 2 ] Minor [ 4 ]
          andreyt Andrey T made changes -
          Resolution Not A Defect [ 7 ]
          Status Open [ 1 ] Resolved [ 5 ]
          ikedam ikedam made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            andreyt Andrey T
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: