• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • groovy-plugin
    • None
    • Win7x64 master
      Win7x64 slaves
      Jenkins 1.609.2
      groovy-plugin 1.27
      Groovy Version = groovy-2.3.9

      During the execution of a "Groovy script" step, there's a temp file in the workspace.

      When one has a job with a "Execute Groovy script" step set to run a "Groovy command" with a lengthy bit of groovy code, the step first writes the contents of the "Groovy command" box to a temp file in the Jenkins workspace on the slave, then it runs it, and finally it deletes it.

      The problem is that it shouldn't be putting this temporary file in the Jenkins workspace - the Jenkins workspace is the private area for the build itself, not as a temporary scratch space for Jenkins plugins.
      As JENKINS-183 said: "This is not polite; the user expects that the workspace contains just the checkout and build products. Stray files can confuse scripts."
      Basically, if a groovy step's script code lists the contents of the Jenkins workspace, it shouldn't find a temporary file there.

      This is a problem for me because my groovy build step runs code that takes a copy of the entire Jenkins workspace and stores it elsewhere - and this copy of the workspace now has a file called "hudson3029275062562187384.groovy" in it that I didn't ask to be there. The fact that JENKINS-3269 ensures that the file gets deleted isn't much comfort because the file is there at the moment I'm looking, even if it gets deleted immediately after I stop looking :-/

      Conclusion:
      The plugin should create its temporary files in the slave's temporary directory (/tmp or %TEMP%), not in the Jenkins workspace directory itself.

          [JENKINS-36272] Groovy plugin puts temp file in workspace

          There are no comments yet on this issue.

            vjuranek vjuranek
            pjdarton pjdarton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: