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

Randomly named additional subfolder when checking out git

      When checking out (looking in job's console output), local files are getting not directly to the JobName@script folder but also add a subfolder with name like ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e

      Checking out git git@...repo.git into /Users/user/.jenkins/workspace/JobName@script/ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e/jenkins/A.groovy

       

      Loading the main groovy file here:

      Project to build located directly in Job Name folder, without subfolders. But scripts put in subfolder.

       

      Now, when in A.groovy I am trying to import B.groovy 

      load("jenkins/B.groovy")
      or
      load(env.WORKSPACE + "@script/jenkins/B.groovy"

      I am getting an error 

      java.nio.file.NoSuchFileException:
      /Users/user/.jenkins/workspace/JobName@script/jenkins/B.groovy

      And don't see any way to get that subfolder name from environment or other way. Thus just can't load an external file.

          [JENKINS-68287] Randomly named additional subfolder when checking out git

          Bogdan Cho created issue -
          Bogdan Cho made changes -
          Description Original: When checking out (looking in job's console output), local files are getting not directly to the {{JobName@script folder but also add a subfolder with name like ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e}}

          {{}}
          {code:java}

          {code}
          {{Checking out git git@...repo.git into /Users/user/.jenkins/workspace/JobName@script/ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e/jenkins/A.groovy}}

           

          Now, when in A.groovy I am trying to import B.groovy

           
          {code:java}
          load("jenkins/B.groovy")
          or
          load(env.WORKSPACE + "@script/jenkins/B.groovy"){code}
           

          I am getting an error 
          {code:java}
          java.nio.file.NoSuchFileException:
          /Users/user/.jenkins/workspace/JobName@script/jenkins/B.groovy{code}
          And don't see any way to get that subfolder name from environment or other way. Thus just can't load an external file.
          New: When checking out (looking in job's console output), local files are getting not directly to the {{JobName@script folder but also add a subfolder with name like ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e}}
          {code:java}
          Checking out git git@...repo.git into /Users/user/.jenkins/workspace/JobName@script/ecb7a9317b1ad672698830264d9e0ce2b9b6f330c043bb85f48623f3cdcab65e/jenkins/A.groovy{code}
           

          Now, when in A.groovy I am trying to import B.groovy 
          {code:java}
          load("jenkins/B.groovy")
          or
          load(env.WORKSPACE + "@script/jenkins/B.groovy") {code}
          I am getting an error 
          {code:java}
          java.nio.file.NoSuchFileException:
          /Users/user/.jenkins/workspace/JobName@script/jenkins/B.groovy{code}
          And don't see any way to get that subfolder name from environment or other way. Thus just can't load an external file.
          Bogdan Cho made changes -
          Component/s New: groovy-plugin [ 15549 ]
          Component/s Original: git-plugin [ 15543 ]

          This seems similar to JENKINS-67857, which was caused by the SECURITY-2441 or SECURITY-2463 fixes in Jenkins Security Advisory 2022-02-15.

          Which type of project are you using? What setting in the project causes A.groovy to be loaded?

          Kalle Niemitalo added a comment - This seems similar to JENKINS-67857 , which was caused by the SECURITY-2441 or SECURITY-2463 fixes in Jenkins Security Advisory 2022-02-15 . Which type of project are you using? What setting in the project causes A.groovy to be loaded?

          This issue has component = groovy-plugin and labels = pipeline workspace, but the Groovy plugin documentation says "Currently the plugin does not support pipeline syntax", so it's not clear to me whether the issue affects pipeline projects or freestyle projects.

          Kalle Niemitalo added a comment - This issue has component = groovy-plugin and labels = pipeline workspace, but the Groovy plugin documentation says "Currently the plugin does not support pipeline syntax", so it's not clear to me whether the issue affects pipeline projects or freestyle projects.
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Component/s New: workflow-cps-plugin [ 21713 ]
          Component/s Original: groovy-plugin [ 15549 ]

          Mark Waite added a comment -

          Assigned to the workflow-cps plugin because that is the plugin that implements the load step.

          Mark Waite added a comment - Assigned to the workflow-cps plugin because that is the plugin that implements the load step.
          Bogdan Cho made changes -
          Attachment New: Screenshot 2022-04-17 at 09.50.58.png [ 57705 ]
          Bogdan Cho made changes -
          Attachment Original: Screenshot 2022-04-17 at 09.50.58.png [ 57705 ]

            Unassigned Unassigned
            bodich Bogdan Cho
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: