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

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

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • copyartifact-plugin
    • None

      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

          [JENKINS-58642] Copying artifacts from project in sub-folder using parameter doesn't work

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

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

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

              Created:
              Updated:
              Resolved: