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

GitSCMFile::content() doesn't handle symlinks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • git-plugin
    • None
    • Jenkins 2.50
      SCM API Plugin 2.1.1
      Git plugin 3.1.0

      When using GitSCMFile::content() on an object that is symlink the content returned is the path to the symlinked file.

      While this might be the intended behavior this might cause problems. For example when using the workflow-multibranch (tested with 2.14) with a Jenkinsfile that is a symlink, this behavior causes the resulting main script to be the path of the symlinked file instead of the file content. E.g. the main script would be "build/Jenkinsfile" (if Jenkinsfile is a link to build/Jenkinsfile)

      The behavior is easy reproducible:

      • create a multi branch pipeline
      • as branch sources use an arbitrary git repository where the Jenkinsfile is a symlink (within the repository)
      • run the Job (the job will fail with an exception)
      • when looking at the replay - the main script will be the path to the symlinked file

            Unassigned Unassigned
            bmiklautz Bernhard Miklautz
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: