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

git plugin 3.6.4 regression with shared libraries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: git-plugin
    • Labels:
    • Environment:
      Jenkins ver. 2.73.3 running on docker (jenkins/jenkins:lts)
    • Similar Issues:

      Description

      Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which is not the last one of the branch.

      Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

      Behaviour of 3.6.3 (good one)

      Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
      > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to git@github.com:user/repo.git
      > git config remote.origin.url git@github.com:user/repo.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
      > git --version # timeout=10
      using GIT_SSH to set credentials github
      > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
      > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > git config remote.origin.url git@github.com:user/repo.git # timeout=10
      Fetching without tags
      Fetching upstream changes from git@github.com:user/repo.git
      > git --version # timeout=10
      using GIT_SSH to set credentials github
      > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
      Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
      > git config core.sparsecheckout # timeout=10
      > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
      Commit message: "Refactor developerPipeline.groovy"
      > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
      

      Behaviour of 3.6.4 (bad one)

      Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
      Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
      > git --version # timeout=10
      using GIT_SSH to set credentials github
      > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
      Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
      > git rev-parse --is-inside-work-tree # timeout=10
      Setting origin to git@github.com:user/repo.git
      > git config remote.origin.url git@github.com:user/repo.git # timeout=10
      Fetching origin...
      Fetching upstream changes from origin
      > git --version # timeout=10
      using GIT_SSH to set credentials github
      > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
      > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
      > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
      Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
      ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      WorkflowScript: Loading libraries failed
      

      Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

      The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

      Steps to reproduce the issue

      1) Configure the shared libraries

      2) Use them with pipeline:

      @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_the_last_one') _  
      
      

      3) Execute the pipeline and you should have the above output

      WORKAROUND: use git-plugin 3.6.3

        Attachments

          Issue Links

            Activity

            diegor Diego Russo created issue -
            diegor Diego Russo made changes -
            Field Original Value New Value
            Description Git plugin 3.6.4 has a regression when working with shared libraries. Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            \{noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            \{noformat}

            Behaviour of 3.6.4 (bad one)

            \{noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            \{noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            Cheers
            Git plugin 3.6.4 has a regression when working with shared libraries. Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            Cheers
            diegor Diego Russo made changes -
            Environment Jenkins ver. 2.73.3 running on docker (linux)
            diegor Diego Russo made changes -
            Description Git plugin 3.6.4 has a regression when working with shared libraries. Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            Cheers
            Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            Cheers
            diegor Diego Russo made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            diegor Diego Russo made changes -
            Description Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            Cheers
            Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            *WORKAROUND: use git-plugin 3.6.3*
            diegor Diego Russo made changes -
            Environment Jenkins ver. 2.73.3 running on docker (linux) Jenkins ver. 2.73.3 running on docker (jenkins/jenkins:lts)
            markewaite Mark Waite made changes -
            Assignee Mark Waite [ markewaite ] Stephen Connolly [ stephenc ]
            Hide
            markewaite Mark Waite added a comment - - edited

            Are you using git as the branch source or are you using github as the branch source?

            Are you using legacy SCM or modern SCM for the branch source?

            Can you provide steps to reconstruct the problem so that others can see the problem without guessing at the steps you took to create that job?

            I think I've created a branch which duplicates the failure. That configuration is using legacy SCM git as the branch source.

            Show
            markewaite Mark Waite added a comment - - edited Are you using git as the branch source or are you using github as the branch source? Are you using legacy SCM or modern SCM for the branch source? Can you provide steps to reconstruct the problem so that others can see the problem without guessing at the steps you took to create that job? I think I've created a branch which duplicates the failure . That configuration is using legacy SCM git as the branch source.
            diegor Diego Russo made changes -
            diegor Diego Russo made changes -
            Description Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954

            *WORKAROUND: use git-plugin 3.6.3*
            Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954


            Steps to reproduce the issue

            1) Configure the shared libraries
             !Screen Shot 2017-11-16 at 14.52.50.png|thumbnail!

            2) Use them with pipeline:

            {noformat}

            @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_HEAD') _

            {noformat}

            *WORKAROUND: use git-plugin 3.6.3*
            diegor Diego Russo made changes -
            Description Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the HEAD* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954


            Steps to reproduce the issue

            1) Configure the shared libraries
             !Screen Shot 2017-11-16 at 14.52.50.png|thumbnail!

            2) Use them with pipeline:

            {noformat}

            @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_HEAD') _

            {noformat}

            *WORKAROUND: use git-plugin 3.6.3*
            Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the last one* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954


            Steps to reproduce the issue

            1) Configure the shared libraries
             !Screen Shot 2017-11-16 at 14.52.50.png|thumbnail!

            2) Use them with pipeline:

            {noformat}

            @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_the_last_one') _

            {noformat}

            *WORKAROUND: use git-plugin 3.6.3*
            diegor Diego Russo made changes -
            Description Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the last one* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954


            Steps to reproduce the issue

            1) Configure the shared libraries
             !Screen Shot 2017-11-16 at 14.52.50.png|thumbnail!

            2) Use them with pipeline:

            {noformat}

            @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_the_last_one') _

            {noformat}

            *WORKAROUND: use git-plugin 3.6.3*
            Git plugin 3.6.4 has a regression when working with shared libraries when a user specifies a commit which *is not the last one* of the branch.

            Below the execution of the same pipeline with two version of the same plugin: the good one is 3.6.3 whilst the one which introduces the regression is 3.6.4.

            Behaviour of 3.6.3 (good one)
            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching without tags
            Fetching upstream changes from git@github.com:user/repo.git
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --no-tags --progress git@github.com:user/repo.git +refs/heads/*:refs/remotes/origin/*
            Checking out Revision a39ba3363968d030eca48fc7b32e78870f580e0e (a39ba3363968d030eca48fc7b32e78870f580e0e)
            > git config core.sparsecheckout # timeout=10
            > git checkout -f a39ba3363968d030eca48fc7b32e78870f580e0e
            Commit message: "Refactor developerPipeline.groovy"
            > git rev-list a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            {noformat}

            Behaviour of 3.6.4 (bad one)

            {noformat}
            Loading library xxx-jenkins-library@a39ba3363968d030eca48fc7b32e78870f580e0e
            Attempting to resolve a39ba3363968d030eca48fc7b32e78870f580e0e from remote references...
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git ls-remote -h -t git@github.com:user/repo.git # timeout=10
            Could not find a39ba3363968d030eca48fc7b32e78870f580e0e in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to git@github.com:user/repo.git
            > git config remote.origin.url git@github.com:user/repo.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=10
            using GIT_SSH to set credentials github
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            ERROR: No version a39ba3363968d030eca48fc7b32e78870f580e0e found for library xxx-jenkins-library
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            {noformat}

            Here the code of the plugin up to 3.6.4: https://github.com/jenkinsci/git-plugin/commits/git-3.6.4

            The culprit could be this commit: https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954


            *Steps to reproduce the issue*

            1) Configure the shared libraries
             !Screen Shot 2017-11-16 at 14.52.50.png|thumbnail!

            2) Use them with pipeline:

            {noformat}

            @Library('xxx-jenkins-library@sha1_of_commit_which_is_not_the_last_one') _

            {noformat}

            3) Execute the pipeline and you should have the above output

            *WORKAROUND: use git-plugin 3.6.3*
            Hide
            diegor Diego Russo added a comment -

            Mark Waite I've updated the description with steps to reproduce the issue.

            Show
            diegor Diego Russo added a comment - Mark Waite I've updated the description with steps to reproduce the issue.
            Hide
            diegor Diego Russo added a comment -

            If the SHA1 is the last one, git-plugin 3.6.4 works without any issue because of the command

            git ls-remote -h -t git@github.com:user/repo.git # timeout=10

            which return the remote HEADS of every branch

            Show
            diegor Diego Russo added a comment - If the SHA1 is the last one, git-plugin 3.6.4 works without any issue because of the command git ls-remote -h -t git@github.com:user/repo.git # timeout=10 which return the remote HEADS of every branch
            Hide
            diegor Diego Russo added a comment -

            Mark Waite I read from your branch:

            Git plugin 3.6.4 included a fix to allow tagged pipeline library references to load. My test kit was lacking that case. I'm not sure if that should be a recommended practice, since tags seem much more intuitive for that than SHA1 hashes, but it seems like it should work.

            Whilst tags are more intuitive, I would argue that they are weaker references than sha1 as tags can be easily moved to different commits. In terms of traceability that's not ideal.

            Show
            diegor Diego Russo added a comment - Mark Waite I read from your branch: Git plugin 3.6.4 included a fix to allow tagged pipeline library references to load. My test kit was lacking that case. I'm not sure if that should be a recommended practice, since tags seem much more intuitive for that than SHA1 hashes, but it seems like it should work. Whilst tags are more intuitive, I would argue that they are weaker references than sha1 as tags can be easily moved to different commits. In terms of traceability that's not ideal.
            Hide
            markewaite Mark Waite added a comment - - edited

            Diego Russo my results are different than yours, and I can't readily explain why they are different.

             

            Git plugin version Legacy SCM Modern SCM - Git Modern SCM - GitHub
            3.6.3 Fail (repo) Pass (repo) Fail (repo)
            3.6.4 Fail (repo) Pass (repo) Fail (repo)

             

            Your example seems to be using modern SCM (git) with a SHA1 hash that is not the most recent SHA1 on the branch, and it fails. My passing example uses modern SCM (git) with a SHA1 has that is not the most recent SHA1 on the branch, and it passes.

            Any guesses what's different between my case and your case?

            Show
            markewaite Mark Waite added a comment - - edited Diego Russo my results are different than yours, and I can't readily explain why they are different.   Git plugin version Legacy SCM Modern SCM - Git Modern SCM - GitHub 3.6.3 Fail ( repo ) Pass ( repo ) Fail ( repo ) 3.6.4 Fail ( repo ) Pass ( repo ) Fail ( repo )   Your example seems to be using modern SCM (git) with a SHA1 hash that is not the most recent SHA1 on the branch, and it fails. My passing example uses modern SCM (git) with a SHA1 has that is not the most recent SHA1 on the branch, and it passes. Any guesses what's different between my case and your case?
            Hide
            diegor Diego Russo added a comment -

            I tried also with github but it doesn't make any difference, it fails anyway. Can I see the series of command which git-plugin 3.6.4 executes when loading the libraries?

            Show
            diegor Diego Russo added a comment - I tried also with github but it doesn't make any difference, it fails anyway. Can I see the series of command which git-plugin 3.6.4 executes when loading the libraries?
            Hide
            stephenconnolly Stephen Connolly added a comment -

            The real question is why there is no branch containing the commit you are after:

            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/*
            > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10
            > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10
            Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e
            

            The checkout currently needs to have a branch name in order to ensure that in a clean workspace it pulls in the ref that contains the commit in its history. (Now we might be able to modify that behaviour if we migrate to a dedicated BranchSCMHead type rather than the current generic SCMHead, but right now we are using a generic SCMHead and consequently we need to have that specify a branch name in order to ensure that other stuff works)

            I suspect the workaround you need is just to ensure that there is a branch in /refs/heads that contains this commit anywhere in its history

            Show
            stephenconnolly Stephen Connolly added a comment - The real question is why there is no branch containing the commit you are after: > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* > git rev-parse a39ba3363968d030eca48fc7b32e78870f580e0e^\{commit} # timeout=10 > git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e # timeout=10 Could not find a branch containing commit a39ba3363968d030eca48fc7b32e78870f580e0e The checkout currently needs to have a branch name in order to ensure that in a clean workspace it pulls in the ref that contains the commit in its history. (Now we might be able to modify that behaviour if we migrate to a dedicated BranchSCMHead  type rather than the current generic SCMHead , but right now we are using a generic SCMHead  and consequently we need to have that specify a branch name in order to ensure that other stuff works) I suspect the workaround you need is just to ensure that there is a branch in /refs/heads that contains this commit anywhere in its history
            Hide
            diegor Diego Russo added a comment -

            The command git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e looks for a commit on local branches. If you see the workflow of 3.6.4, there is NO local checkout (whilst there is on 3.6.3).

            If we don't want to check out the code, we should modify the above command adding -r options which will include remote branches (which we got with git fetch). Maybe it's worth it to extend the look up to local and remote branches with -a

            If I specify -r or -a I'm able to find my commit on remotes

            $ git branch -r -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e
              origin/branchname cc4bc010d3d451f226ec67beb5fc634bedc64fca stuff
              origin/master     8313006494e4fb5bac57e6d57d59e8e807a7e91d Refactor sanityCheckPipeline.groovy
            

             

            Show
            diegor Diego Russo added a comment - The command git branch -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e looks for a commit on local branches. If you see the workflow of 3.6.4, there is NO local checkout (whilst there is on 3.6.3). If we don't want to check out the code, we should modify the above command adding -r options which will include remote branches (which we got with git fetch ). Maybe it's worth it to extend the look up to local and remote branches with -a If I specify -r or -a I'm able to find my commit on remotes $ git branch -r -v --no-abbrev --contains a39ba3363968d030eca48fc7b32e78870f580e0e origin/branchname cc4bc010d3d451f226ec67beb5fc634bedc64fca stuff origin/master 8313006494e4fb5bac57e6d57d59e8e807a7e91d Refactor sanityCheckPipeline.groovy  
            Hide
            diegor Diego Russo added a comment -

            Looking at the code, this line https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954#diff-33b2f30e4119d2fd0e0bb8653c0c58bdR818 should be changed from

            List<Branch> branches = client.getBranchesContaining(hash, false);

            to

            List<Branch> branches = client.getBranchesContaining(hash, true);

            In this way the search is done across all branches (remotes and locals)

            Show
            diegor Diego Russo added a comment - Looking at the code, this line https://github.com/jenkinsci/git-plugin/commit/addcc0a57f2a205f7a79efda4ca15e7b6d937954#diff-33b2f30e4119d2fd0e0bb8653c0c58bdR818 should be changed from List<Branch> branches = client.getBranchesContaining(hash, false); to List<Branch> branches = client.getBranchesContaining(hash, true); In this way the search is done across all branches (remotes and locals)
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Not quite so simple as we need to reconstruct the branch name from the remote name... but yes, seems we are not looking at the branches that we just fetched. I'll see if I can fix it next week

            Show
            stephenconnolly Stephen Connolly added a comment - Not quite so simple as we need to reconstruct the branch name from the remote name... but yes, seems we are not looking at the branches that we just fetched. I'll see if I can fix it next week
            Hide
            diegor Diego Russo added a comment -

            Stephen Connolly thanks for your help!

            Show
            diegor Diego Russo added a comment - Stephen Connolly thanks for your help!
            Hide
            takomyr Taras Kostyuk added a comment -

            One more use case is using refs/changes/08/8/1 for library version to use not yet committed library version from a Gerrit change.

            Once keeping a shared library in Gerrit create a Gerrit change.
            Create a pipeline job with a single line setting the library version like

            @Library('library_name@refs/changes/08/8/1')

            where refs/changes/08/8/1 can be taken from Download dropdown list on the change page in Gerrit UI.

            The described case also works in 3.6.3 Git plugin version but causes
            Could not find a branch containing commit
            while using 3.6.4 Git plugin version

            Show
            takomyr Taras Kostyuk added a comment - One more use case is using  refs/changes/08/8/1  for library version to use not yet committed library version from a Gerrit change. Once keeping a shared library in Gerrit create a Gerrit change. Create a pipeline job with a single line setting the library version like @Library('library_name@refs/changes/08/8/1') where  refs/changes/08/8/1  can be taken from Download dropdown list on the change page in Gerrit UI. The described case also works in 3.6.3 Git plugin version but causes Could not find a branch containing commit while using 3.6.4 Git plugin version
            jglick Jesse Glick made changes -
            Labels regression
            jglick Jesse Glick made changes -
            Link This issue blocks JENKINS-47824 [ JENKINS-47824 ]
            Hide
            jglick Jesse Glick added a comment -

            PR 557 makes it work for an existing test at least. Maybe something fancier is needed for more exotic setups.

            Show
            jglick Jesse Glick added a comment - PR 557 makes it work for an existing test at least. Maybe something fancier is needed for more exotic setups.
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 557 (Web Link)" [ 18300 ]
            markewaite Mark Waite made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            jglick Jesse Glick made changes -
            Link This issue relates to JENKINS-48385 [ JENKINS-48385 ]
            stephenconnolly Stephen Connolly made changes -
            Link This issue is blocked by JENKINS-48385 [ JENKINS-48385 ]
            Hide
            stephenconnolly Stephen Connolly added a comment -

            The full fix is blocked until we have the ability to define the refspecs of a SCMHead that does not correspond to a head in refs/heads in the remote repository

            Show
            stephenconnolly Stephen Connolly added a comment - The full fix is blocked until we have the ability to define the refspecs of a SCMHead that does not correspond to a head in refs/heads in the remote repository
            Hide
            stephenconnolly Stephen Connolly added a comment -

            WORKAROUND create a tag for the reference you want to checkout... and give the tag the same name as its commit hash!!!

            git tag a39ba3363968d030eca48fc7b32e78870f580e0e a39ba3363968d030eca48fc7b32e78870f580e0e
            git push --tags
            
            Show
            stephenconnolly Stephen Connolly added a comment - WORKAROUND create a tag for the reference you want to checkout... and give the tag the same name as its commit hash!!! git tag a39ba3363968d030eca48fc7b32e78870f580e0e a39ba3363968d030eca48fc7b32e78870f580e0e git push --tags
            Hide
            stephenconnolly Stephen Connolly added a comment - - edited

            Note that the above workaround will give you log warnings:

            warning: refname 'a39ba3363968d030eca48fc7b32e78870f580e0e' is ambiguous.
            Git normally never creates a ref that ends with 40 hex characters
            because it will be ignored when you just specify 40-hex. These refs
            may be created by mistake. For example,
            
              git checkout -b $br $(git rev-parse ...)
            
            where "$br" is somehow empty and a 40-hex ref is created. Please
            examine these refs and maybe delete them. Turn this message off by
            running "git config advice.objectNameWarning false"
            

            but the build should work fine and you can remove the tags after this issue has been fixed

            Show
            stephenconnolly Stephen Connolly added a comment - - edited Note that the above workaround will give you log warnings: warning: refname 'a39ba3363968d030eca48fc7b32e78870f580e0e' is ambiguous. Git normally never creates a ref that ends with 40 hex characters because it will be ignored when you just specify 40-hex. These refs may be created by mistake. For example, git checkout -b $br $(git rev-parse ...) where "$br" is somehow empty and a 40-hex ref is created. Please examine these refs and maybe delete them. Turn this message off by running "git config advice.objectNameWarning false " but the build should work fine and you can remove the tags after this issue has been fixed
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Also, as git will treat a 40-hex as a commit hash always you will get the commit correctly checked out... just with the warning

            Show
            stephenconnolly Stephen Connolly added a comment - Also, as git will treat a 40-hex as a commit hash always you will get the commit correctly checked out... just with the warning
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/5cfdeaa87dd9fe75c18ef2d6dee1f1d5c29f8ba0
            Log:
            JENKINS-48061 Partial fix for the easy case of non-head revision in history of branch

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/5cfdeaa87dd9fe75c18ef2d6dee1f1d5c29f8ba0 Log: JENKINS-48061 Partial fix for the easy case of non-head revision in history of branch
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Stephen Connolly
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/828ca74769783d2ccd2c16ce038a87cacc66e140
            Log:
            Merge pull request #561 from stephenc/jenkins-48061-partial

            JENKINS-48061 Partial fix for the easy case of non-head revision in history of branch

            Compare: https://github.com/jenkinsci/git-plugin/compare/a2db08cf3927...828ca7476978

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/828ca74769783d2ccd2c16ce038a87cacc66e140 Log: Merge pull request #561 from stephenc/jenkins-48061-partial JENKINS-48061 Partial fix for the easy case of non-head revision in history of branch Compare: https://github.com/jenkinsci/git-plugin/compare/a2db08cf3927...828ca7476978
            Hide
            xxthunder Karsten Günther added a comment -

            I had a similar issue with 3.7.0 while loading a library from a GitHub pull request and the workaround to go back to 3.6.3 helped. Is this related to this issue?

             

            Loading library ___@refs/pull/264/head
            Attempting to resolve refs/pull/264/head from remote references...
            Could not find refs/pull/264/head in remote references. Pulling heads to local for deep search...
            Setting origin to git@___________________.git
            Fetching origin...
            Could not find a branch containing commit 2d4c79a1ec75462c1cbd23c182cb2056ebeb7db7
            [Pipeline] End of Pipeline
            ERROR: No version refs/pull/264/head found for library ___
            Finished: FAILURE
            
            Show
            xxthunder Karsten Günther added a comment - I had a similar issue with 3.7.0 while loading a library from a GitHub pull request and the workaround to go back to 3.6.3 helped. Is this related to this issue?   Loading library ___@refs/pull/264/head Attempting to resolve refs/pull/264/head from remote references... Could not find refs/pull/264/head in remote references. Pulling heads to local for deep search... Setting origin to git@___________________.git Fetching origin... Could not find a branch containing commit 2d4c79a1ec75462c1cbd23c182cb2056ebeb7db7 [Pipeline] End of Pipeline ERROR: No version refs/pull/264/head found for library ___ Finished: FAILURE
            Hide
            markewaite Mark Waite added a comment -

            Karsten Günther it could be related. This bug is still in progress, not yet resolved in all cases. The message you're seeing does not match with any others reported in this bug.

            That message seems to indicate your loading a pull request as a library. Is that intentional?

            What's the use case where you're relying on "refs/pull" as a valid refspec to load a library? I'm accustomed to libraries being loaded by branch name, by tag, by SHA1. I'm not accustomed to someone loading a library from a pull request.

            Show
            markewaite Mark Waite added a comment - Karsten Günther it could be related. This bug is still in progress, not yet resolved in all cases. The message you're seeing does not match with any others reported in this bug. That message seems to indicate your loading a pull request as a library . Is that intentional? What's the use case where you're relying on "refs/pull" as a valid refspec to load a library? I'm accustomed to libraries being loaded by branch name, by tag, by SHA1. I'm not accustomed to someone loading a library from a pull request.
            Hide
            xxthunder Karsten Günther added a comment -

            Yes, we intentionally load a library from a pull request. The use case is simple: integration testing. We create jobs via JobDSL based on fixed test data and check for expected results. With that mechanism we validate our whole software verification pipeline.

            Show
            xxthunder Karsten Günther added a comment - Yes, we intentionally load a library from a pull request. The use case is simple: integration testing. We create jobs via JobDSL based on fixed test data and check for expected results. With that mechanism we validate our whole software verification pipeline.
            Hide
            robin_smith Robin Smith added a comment -

            I am finding the same problem as Karsten Günther - I would like to test changes to shared pipeline libraries in Jenkins before merging. Until version 3.6.3 of the plugin, this was possible by setting the following refspec in the Global Pipeline Libraries configuration, under your shared library:

            +refs/pull-requests/*/from:refs/remotes/@{remote}/pr/*
            

            And in the pipeline:

            @Library('my-pipeline-library@pr/<pull request ID>')
            

            This would allow you to run a build using the libraries from your PR, which we find very useful.

            It's not possible in 3.6.4 or 3.7.0:

             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull-requests/*/from:refs/remotes/origin/pr/*
             > git rev-parse pr/35^{commit} # timeout=10
            ERROR: Could not resolve pr/35
            hudson.plugins.git.GitException: Command "git rev-parse pr/35^{commit}" returned status code 128:
            stdout: pr/35^{commit}
            
            stderr: fatal: ambiguous argument 'pr/35^{commit}': unknown revision or path not in the working tree.
            
            Show
            robin_smith Robin Smith added a comment - I am finding the same problem as Karsten Günther - I would like to test changes to shared pipeline libraries in Jenkins before merging. Until version 3.6.3 of the plugin, this was possible by setting the following refspec in the Global Pipeline Libraries configuration, under your shared library: +refs/pull-requests/*/from:refs/remotes/@{remote}/pr/* And in the pipeline: @Library( 'my-pipeline-library@pr/<pull request ID>' ) This would allow you to run a build using the libraries from your PR, which we find very useful. It's not possible in 3.6.4 or 3.7.0: > git fetch --tags --progress origin +refs/heads /*:refs/remotes/origin/* +refs/pull-requests/*/ from:refs/remotes/origin/pr/* > git rev-parse pr/35^{commit} # timeout=10 ERROR: Could not resolve pr/35 hudson.plugins.git.GitException: Command "git rev-parse pr/35^{commit}" returned status code 128: stdout: pr/35^{commit} stderr: fatal: ambiguous argument 'pr/35^{commit}' : unknown revision or path not in the working tree.
            Hide
            hamiltb Bill Hamilton added a comment - - edited

            Mark Waite, I want to echo Karsten Günther and Robin Smith. I too want to test PSL changes. The Jenkinsfile in my PSL PR does:
            def utils_pkg=library("PSL@${branch}").ors.utils
            where branch is determined at runtime, and could be a PR build. So I expanded the refspec in the PSL configuration to this:
            +refs/pull//head:refs/remotes/@{remote}/pr/
            so when the build for my PR111 executes it is calling:
            def utils_pkg=library("PSL@pr/111").ors.utils
            This fails, with this output:
            > git fetch --tags --progress origin +refs/heads/:refs/remotes/origin/ +refs/pull//head:refs/remotes/origin/pr/
            > git rev-parse origin/pr/111^{commit} # timeout=30
            > git branch -v --no-abbrev --contains f39b737d67b11218dad26756e7c4b1f5900ff037 # timeout=30
            Could not find a branch containing commit f39b737d67b11218dad26756e7c4b1f5900ff037

            Also, I wouldnt consider this a minor bug. This is breaks our ability to unit test code changes to our PSL library, which is used by hundreds of customers in our organization. We have trained them to contribute to our PSL library via PRs. But all of the PRs they file fail because of this regression.

            Show
            hamiltb Bill Hamilton added a comment - - edited Mark Waite , I want to echo Karsten Günther and Robin Smith . I too want to test PSL changes. The Jenkinsfile in my PSL PR does: def utils_pkg=library("PSL@${branch}").ors.utils where branch is determined at runtime, and could be a PR build. So I expanded the refspec in the PSL configuration to this: +refs/pull/ /head:refs/remotes/@{remote}/pr/ so when the build for my PR111 executes it is calling: def utils_pkg=library("PSL@pr/111").ors.utils This fails, with this output: > git fetch --tags --progress origin +refs/heads/ :refs/remotes/origin/ +refs/pull/ /head:refs/remotes/origin/pr/ > git rev-parse origin/pr/111^{commit} # timeout=30 > git branch -v --no-abbrev --contains f39b737d67b11218dad26756e7c4b1f5900ff037 # timeout=30 Could not find a branch containing commit f39b737d67b11218dad26756e7c4b1f5900ff037 Also, I wouldnt consider this a minor bug. This is breaks our ability to unit test code changes to our PSL library, which is used by hundreds of customers in our organization. We have trained them to contribute to our PSL library via PRs. But all of the PRs they file fail because of this regression.
            stephenconnolly Stephen Connolly made changes -
            Hide
            stephenconnolly Stephen Connolly added a comment -

            If you want to checkout pull requests, why are you using Git for the pipeline shared library...

            Something like:

            Should allow checking out the shared library by PR, e.g. library("PSL@pr-111") should checkout the PR.

            Show
            stephenconnolly Stephen Connolly added a comment - If you want to checkout pull requests, why are you using Git for the pipeline shared library... Something like: Should allow checking out the shared library by PR, e.g. library("PSL@pr-111") should checkout the PR.
            Hide
            stephenconnolly Stephen Connolly added a comment -

            The only issue with using GitHub Branch Source is that you cannot checkout shared libraries by hash as https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java#L782-L804 does not implement hash resolution.

            Show
            stephenconnolly Stephen Connolly added a comment - The only issue with using GitHub Branch Source is that you cannot checkout shared libraries by hash as https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java#L782-L804 does not implement hash resolution.
            Show
            stephenconnolly Stephen Connolly added a comment - https://github.com/jenkinsci/github-branch-source-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java#L1163-L1218 matches PR-... https://github.com/jenkinsci/github-branch-source-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java#L1219-L1226 matches branches https://github.com/jenkinsci/github-branch-source-plugin/blob/master/src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java#L1227-L1254 matches tags
            Hide
            robin_smith Robin Smith added a comment -

            If the pipeline shared libraries are in Bitbucket, it's necessary to use Git to load them.

            Show
            robin_smith Robin Smith added a comment - If the pipeline shared libraries are in Bitbucket, it's necessary to use Git to load them.
            rsandell rsandell made changes -
            Assignee Stephen Connolly [ stephenc ] rsandell [ rsandell ]
            Hide
            hamiltb Bill Hamilton added a comment - - edited

            Stephen Connolly Stephen, I am using GitHib as the SCM for the shared library configuration. And none of the following work:
            library("PSL@pr-111")

            library("PSL@PR-111")

            This all worked before we upgraded to Jenkins 2.89.

            I added +refs/pull/*/head:refs/remotes/origin/* to the PSL Git refspec, since I noticed it was missing from the fetch. But it still doesnt work.

            Here is the log output if that helps:

            Loading library PSL@PR-111
            Attempting to resolve PR-111 from remote references...
            > git --version # timeout=30
            using GIT_ASKPASS to set credentials ORS folder scan user
            > git ls-remote -h -t https://git.autodesk.com/Pipeline-Community/PSL.git # timeout=30
            Could not find PR-111 in remote references. Pulling heads to local for deep search...
            > git rev-parse --is-inside-work-tree # timeout=30
            Setting origin to https://git.autodesk.com/Pipeline-Community/PSL.git
            > git config remote.origin.url https://git.autodesk.com/Pipeline-Community/PSL.git # timeout=30
            Fetching origin...
            Fetching upstream changes from origin
            > git --version # timeout=30
            using GIT_ASKPASS to set credentials ORS folder scan user
            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/*
            > git rev-parse PR-111^{commit} # timeout=30
            ERROR: Could not resolve PR-111
            hudson.plugins.git.GitException: Command "git rev-parse PR-111^{commit}" returned status code 128:
            stdout: PR-111^{commit}

            Show
            hamiltb Bill Hamilton added a comment - - edited Stephen Connolly Stephen, I am using GitHib as the SCM for the shared library configuration. And none of the following work: library("PSL@pr-111") library("PSL@PR-111") This all worked before we upgraded to Jenkins 2.89. I added +refs/pull/*/head:refs/remotes/origin/* to the PSL Git refspec, since I noticed it was missing from the fetch. But it still doesnt work. Here is the log output if that helps: Loading library PSL@PR-111 Attempting to resolve PR-111 from remote references... > git --version # timeout=30 using GIT_ASKPASS to set credentials ORS folder scan user > git ls-remote -h -t https://git.autodesk.com/Pipeline-Community/PSL.git # timeout=30 Could not find PR-111 in remote references. Pulling heads to local for deep search... > git rev-parse --is-inside-work-tree # timeout=30 Setting origin to https://git.autodesk.com/Pipeline-Community/PSL.git > git config remote.origin.url https://git.autodesk.com/Pipeline-Community/PSL.git # timeout=30 Fetching origin... Fetching upstream changes from origin > git --version # timeout=30 using GIT_ASKPASS to set credentials ORS folder scan user > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*/head:refs/remotes/origin/* > git rev-parse PR-111^{commit} # timeout=30 ERROR: Could not resolve PR-111 hudson.plugins.git.GitException: Command "git rev-parse PR-111^{commit}" returned status code 128: stdout: PR-111^{commit}
            stephenconnolly Stephen Connolly made changes -
            Attachment image-2018-03-08-09-35-47-511.png [ 41765 ]
            stephenconnolly Stephen Connolly made changes -
            stephenconnolly Stephen Connolly made changes -
            stephenconnolly Stephen Connolly made changes -
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Bill Hamilton respectfully but those console log lines are coming from GitSCMSource not GitHubSCMSource...

            For example...

            When I configure the shared library to use GitHubSCMSource, e.g. like this:

            I get a console log like this:

            Conversely, when I configure the shared library to use GitSCMSource, e.g. like this:

            I get a console log like this:

            Specifically the highlighted text

            Attempting to resolve PR-2 from remote references...
             > git --version # timeout=10
             > git ls-remote -h -t https://github.com/cloudbeers/multibranch-demo-lib.git # timeout=10
            

            Can only come from GitSCMSource as GitHubSCMSource does not invoke the super method

            So are you absolutely sure you have configured to use the GitHubSCMSource?

            Show
            stephenconnolly Stephen Connolly added a comment - Bill Hamilton respectfully but those console log lines are coming from GitSCMSource not GitHubSCMSource... For example... When I configure the shared library to use GitHubSCMSource, e.g. like this: I get a console log like this: Conversely, when I configure the shared library to use GitSCMSource, e.g. like this: I get a console log like this: Specifically the highlighted text Attempting to resolve PR-2 from remote references... > git --version # timeout=10 > git ls-remote -h -t https: //github.com/cloudbeers/multibranch-demo-lib.git # timeout=10 Can only come from GitSCMSource as GitHubSCMSource does not invoke the super method So are you absolutely sure you have configured to use the GitHubSCMSource?
            Hide
            hamiltb Bill Hamilton added a comment -

            Stephen Connolly Stephen, I did have it configured as GitHub...BUT, I also had a preceding PSL defined using Git, so they seemed to have conflicted. So I removed the preceding. I also tweaked the settings to be inline with yours. And finally I realized that one of our masters had an older version of GH Branch Source Plugin, it was 2.2.6 and needed 2.3.2. So I think we are all set, thank you

            Show
            hamiltb Bill Hamilton added a comment - Stephen Connolly Stephen, I did have it configured as GitHub...BUT, I also had a preceding PSL defined using Git, so they seemed to have conflicted. So I removed the preceding. I also tweaked the settings to be inline with yours. And finally I realized that one of our masters had an older version of GH Branch Source Plugin, it was 2.2.6 and needed 2.3.2. So I think we are all set, thank you
            Hide
            hamiltb Bill Hamilton added a comment -

            Mark WaiteStephen Connolly Guys, I just want to confirm the use cases that should be tested around this:
            Both the @Library directive, and the library() DSL step, should insure that specifying branches, PRs, tags, and hashes all work
            Thanks,
            -Bill

            Show
            hamiltb Bill Hamilton added a comment - Mark Waite Stephen Connolly Guys, I just want to confirm the use cases that should be tested around this: Both the @Library directive, and the library() DSL step, should insure that specifying branches, PRs, tags, and hashes all work Thanks, -Bill
            Hide
            markewaite Mark Waite added a comment -

            Thanks Bill Hamilton!

            Show
            markewaite Mark Waite added a comment - Thanks Bill Hamilton !
            Hide
            ssbarnea Sorin Sbarnea added a comment -

            Few minutes ago I raised https://issues.jenkins-ci.org/browse/JENKINS-50433 which states that there is no way to tell git plugin to pull gerrit branches because there is no way to convince it to remove "-h" from "git ls-remote".

            Any tricks/workarounds to make this work?

            Show
            ssbarnea Sorin Sbarnea added a comment - Few minutes ago I raised https://issues.jenkins-ci.org/browse/JENKINS-50433  which states that there is no way to tell git plugin to pull gerrit branches because there is no way to convince it to remove "-h" from "git ls-remote". Any tricks/workarounds to make this work?
            ssbarnea Sorin Sbarnea made changes -
            Remote Link This issue links to "PR 561 (Web Link)" [ 20328 ]
            rsandell rsandell made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            rsandell rsandell made changes -
            Remote Link This issue links to "PR 577 (Web Link)" [ 20365 ]
            Hide
            robin_smith Robin Smith added a comment - - edited

            rsandell will your changes fix loading shared libraries from a Bitbucket PR? Or should I raise a separate issue for that? It was possible to do this until version 3.6.4 of the plugin

            Show
            robin_smith Robin Smith added a comment - - edited rsandell  will your changes fix loading shared libraries from a Bitbucket PR? Or should I raise a separate issue for that? It was possible to do this until version 3.6.4 of the plugin
            Hide
            markewaite Mark Waite added a comment -

            Robin Smith you can test the plugin containing the pull request in your environment and help assure that everyone understands the fix.

            If you can do that, please also report your results on the pull request.

            Show
            markewaite Mark Waite added a comment - Robin Smith you can test the plugin containing the pull request in your environment and help assure that everyone understands the fix. If you can do that, please also report your results on the pull request.
            Hide
            robin_smith Robin Smith added a comment -

            Thanks Mark Waite, I'll do that now!

            Show
            robin_smith Robin Smith added a comment - Thanks Mark Waite , I'll do that now!
            Hide
            robin_smith Robin Smith added a comment -

            Mark Waite rsandell I still have the same problem, after installing that plugin:

             

            > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull-requests/*/from:refs/remotes/origin/pr/*
            > git rev-parse pr/33^{commit} # timeout=10
            ERROR: Could not resolve pr/33
            hudson.plugins.git.GitException: Command "git rev-parse pr/33^{commit}" returned status code 128:
            stdout: pr/33^{commit}
            
            stderr: fatal: ambiguous argument 'pr/33^{commit}': unknown revision or path not in the working tree.
            Use '--' to separate paths from revisions, like this:
            'git <command> [<revision>...] -- [<file>...]'
            
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609)
            at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:794)
            at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316)
            at jenkins.plugins.git.AbstractGitSCMSource$10.run(AbstractGitSCMSource.java:859)
            at jenkins.plugins.git.AbstractGitSCMSource$10.run(AbstractGitSCMSource.java:853)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:352)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:853)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:598)
            at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:80)
            at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153)
            at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134)
            at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125)
            at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065)
            at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
            at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
            at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
            at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
            at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
            at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
            at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
            at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
            at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:421)
            ERROR: No version pr/33 found for library forgerock-pipeline-libs
            org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
            WorkflowScript: Loading libraries failed
            
            1 error
            
            at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310)
            at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085)
            at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603)
            at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581)
            at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558)
            at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298)
            at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268)
            at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688)
            at groovy.lang.GroovyShell.parse(GroovyShell.java:700)
            at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129)
            at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517)
            at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480)
            at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269)
            at hudson.model.ResourceController.execute(ResourceController.java:97)
            at hudson.model.Executor.run(Executor.java:421)
            Finished: FAILURE
            

             

             

             

            Show
            robin_smith Robin Smith added a comment - Mark Waite rsandell I still have the same problem, after installing that plugin :   > git fetch --tags --progress origin +refs/heads /*:refs/remotes/origin/* +refs/pull-requests/*/ from:refs/remotes/origin/pr/* > git rev-parse pr/33^{commit} # timeout=10 ERROR: Could not resolve pr/33 hudson.plugins.git.GitException: Command "git rev-parse pr/33^{commit}" returned status code 128: stdout: pr/33^{commit} stderr: fatal: ambiguous argument 'pr/33^{commit}' : unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this : 'git <command> [<revision>...] -- [<file>...]' at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1996) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1964) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1960) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1597) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1609) at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.revParse(CliGitAPIImpl.java:794) at hudson.plugins.git.GitAPI.revParse(GitAPI.java:316) at jenkins.plugins.git.AbstractGitSCMSource$10.run(AbstractGitSCMSource.java:859) at jenkins.plugins.git.AbstractGitSCMSource$10.run(AbstractGitSCMSource.java:853) at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:352) at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:853) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:598) at org.jenkinsci.plugins.workflow.libs.SCMSourceRetriever.retrieve(SCMSourceRetriever.java:80) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.retrieve(LibraryAdder.java:153) at org.jenkinsci.plugins.workflow.libs.LibraryAdder.add(LibraryAdder.java:134) at org.jenkinsci.plugins.workflow.libs.LibraryDecorator$1.call(LibraryDecorator.java:125) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1065) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:421) ERROR: No version pr/33 found for library forgerock-pipeline-libs org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: Loading libraries failed 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:310) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1085) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:603) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:581) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:298) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:268) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:688) at groovy.lang.GroovyShell.parse(GroovyShell.java:700) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.doParse(CpsGroovyShell.java:129) at org.jenkinsci.plugins.workflow.cps.CpsGroovyShell.reparse(CpsGroovyShell.java:123) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.parseScript(CpsFlowExecution.java:517) at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.start(CpsFlowExecution.java:480) at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:269) at hudson.model.ResourceController.execute(ResourceController.java:97) at hudson.model.Executor.run(Executor.java:421) Finished: FAILURE      
            Hide
            krotscheck Michael Krotscheck added a comment -

            Another +1 here for the gerrit use case. We run our shared jenkins groovy library through CI/CD testing before merging to master, to make sure we don't introduce regressions. That requires checking out either based on the gerrit refspec (`refs/changes/*`) or directly on the sha from one of those refspecs. Neither of these works anymore.

            Our current system jenkins library configuration for refspecs is:

            • +refs/heads/:refs/remotes/@{remote}/
            • +refs/changes/:refs/changes/

            Relevant log output:
            using GIT_SSH to set credentials Key to access gerrit
            > git fetch --tags --progress origin +refs/heads/:refs/remotes/origin/ +refs/changes/:refs/changes/
            > git rev-parse refs/changes/58/30058/11^{commit} # timeout=10
            > git branch -a -v --no-abbrev --contains d471affea1e4847a3d06d974e373632181ff5872 # timeout=10
            Could not find a branch containing commit d471affea1e4847a3d06d974e373632181ff5872
            I've played around with various different refspec structures, but nothing obvious seems to work.

            Show
            krotscheck Michael Krotscheck added a comment - Another +1 here for the gerrit use case. We run our shared jenkins groovy library through CI/CD testing before merging to master, to make sure we don't introduce regressions. That requires checking out either based on the gerrit refspec (`refs/changes/*`) or directly on the sha from one of those refspecs. Neither of these works anymore. Our current system jenkins library configuration for refspecs is: +refs/heads/ :refs/remotes/@{remote}/ +refs/changes/ :refs/changes/ Relevant log output: using GIT_SSH to set credentials Key to access gerrit > git fetch --tags --progress origin +refs/heads/ :refs/remotes/origin/ +refs/changes/ :refs/changes/ > git rev-parse refs/changes/58/30058/11^{commit} # timeout=10 > git branch -a -v --no-abbrev --contains d471affea1e4847a3d06d974e373632181ff5872 # timeout=10 Could not find a branch containing commit d471affea1e4847a3d06d974e373632181ff5872 I've played around with various different refspec structures, but nothing obvious seems to work.
            Hide
            markewaite Mark Waite added a comment -

            Michael Krotscheck can you provide detailed steps that describe your working case, preferably using a public repository and without requiring that I install and configure a Gerrit server? I can't verify it works (or fails) at the moment, because it is not apparent to me how to duplicate the case you're describing. I could spend hours guessing, with the risk of wrong guesses, or I could follow steps you provide to reduce my guessing.

            I appreciate the desire to have the gerrit use case work, but I'm not yet sure that the gerrit use case should be done as a standard part of the plugin, rather than as an extension point that is enabled by installing an additional plugin to implement that extension. The more we can explore the use case you've been using, the better we are able to understand the best location to modify.

            Show
            markewaite Mark Waite added a comment - Michael Krotscheck can you provide detailed steps that describe your working case, preferably using a public repository and without requiring that I install and configure a Gerrit server? I can't verify it works (or fails) at the moment, because it is not apparent to me how to duplicate the case you're describing. I could spend hours guessing, with the risk of wrong guesses, or I could follow steps you provide to reduce my guessing. I appreciate the desire to have the gerrit use case work, but I'm not yet sure that the gerrit use case should be done as a standard part of the plugin, rather than as an extension point that is enabled by installing an additional plugin to implement that extension. The more we can explore the use case you've been using, the better we are able to understand the best location to modify.
            Hide
            krotscheck Michael Krotscheck added a comment - - edited

            Well, the short answer is no: I can't set up a whole public infrastructure for you that will allow you to test this use case. I mucked around to see if I can get a similar effect by trying this, however I can't seem to get the GIT_COMMIT environment variable into the declarative pipeline itself - that's probably an artifact of the Gerrit plugin and how it assigns a trigger events' parameters to a job.

            libraries {
                lib("kangaroo-jenkins@${env.GIT_COMMIT}")
            }

            But, what I can do, is tell you where the "bug" is and the appropriate gerrit workaround. The issue seems to be in AbstractGitSCMSource around 'Could not find a branch containing'.... The assumption the plugin makes is that remote branches will all live under refs/remotes/${context}/, and filters out anything else. As such, gerritt's usage of `refs/changes/` etc is entirely ignored.

            The workaround is - when declaring the library in jenkins - to also include the following refspec mappings. In our case, we're doing this in the System Library Configuration:

            +refs/heads/*:refs/remotes/@{remote}/*           # Remote master, for regular library usage.
            +refs/changes/*:refs/changes/*                   # So that rev-parse works on gerrit refspec parameters.
            +refs/changes/*:refs/remotes/@{remote}/changes/* # To bypass the filter exclusion in AbstractGitSCMSource

            The above makes the current plugin work for me (And now I know far more about refspecs than I ever wanted).

            EDIT: Also, I don't see why this couldn't work for bitbucket, github, etc. Others would have to confirm that though.

            Show
            krotscheck Michael Krotscheck added a comment - - edited Well, the short answer is no: I can't set up a whole public infrastructure for you that will allow you to test this use case. I mucked around to see if I can get a similar effect by trying this, however I can't seem to get the GIT_COMMIT environment variable into the declarative pipeline itself - that's probably an artifact of the Gerrit plugin and how it assigns a trigger events' parameters to a job. libraries {     lib("kangaroo-jenkins@${env.GIT_COMMIT}") } But, what I can do, is tell you where the "bug" is and the appropriate gerrit workaround. The issue seems to be in AbstractGitSCMSource around 'Could not find a branch containing'.... The assumption the plugin makes is that remote branches will all live under refs/remotes/${context}/, and filters out anything else. As such, gerritt's usage of `refs/changes/` etc is entirely ignored. The workaround is - when declaring the library in jenkins - to also include the following refspec mappings. In our case, we're doing this in the System Library Configuration: +refs/heads/*:refs/remotes/@{remote}/* # Remote master, for regular library usage. +refs/changes/*:refs/changes/* # So that rev-parse works on gerrit refspec parameters. +refs/changes/*:refs/remotes/@{remote}/changes/* # To bypass the filter exclusion in AbstractGitSCMSource The above makes the current plugin work for me (And now I know far more about refspecs than I ever wanted). EDIT: Also, I don't see why this couldn't work for bitbucket, github, etc. Others would have to confirm that though.
            Hide
            hughsaunders Hugh Saunders added a comment -

            In the code added in 3.6.4 there are 6 cases laid out for resolving the version, they are:

            • branch (or SHA that it points to)
            • tag (or SHA that it points to)
            • SHA

            (Abbreviated SHAs are also covered)

            The option thats conspicuously absent is a ref that isn't a branch, tag or SHA.

            A SHA is a direct object hash, a branch is a ref under refs/heads or refs/remotes/*/ and a Tag is a ref under refs/tags
            So where does a ref that isn't under heads, remotes or tags fit in? for example:

            refs/pull/90/merge

            Note that this type of ref used to work, with the appropriate refspec in global config. 

            I use

            +refs/pull/*:refs/remotes/@{remote}/pr/*

            and

            +refs/heads/*:refs/remotes/@{remote}/*

             

            Successful log (old version, sorry I don't know the exact version, I know thats super unhelpful.):

            GitHub pull request #705 of commit c5d1bbcf93933149cfd705f029c62d7da6926820, no merge conflicts.
            Setting status of c5d1bbcf93933149cfd705f029c62d7da6926820 to PENDING with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1768/ and message: 'Build started sha1 is merged.'
            Using context: CIT/issue-link
            Running in Durability level: PERFORMANCE_OPTIMIZED
            [Pipeline] library
            Loading library rpc-gating@origin/pr/705/merge
            Attempting to resolve origin/pr/705/merge from remote references...
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git ls-remote -h -t https://github.com/rcbops/rpc-gating.git # timeout=10
            Could not find origin/pr/705/merge in remote references. Pulling heads to local for deep search...
             > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to https://github.com/rcbops/rpc-gating.git
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/*
             > git rev-parse origin/pr/705/merge^{commit} # timeout=10
             > git branch -v --no-abbrev --contains bc2e7318899dab969fd1453a298f0682d540b850 # timeout=10
            Selected match: origin/pr/705/merge revision bc2e7318899dab969fd1453a298f0682d540b850
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching without tags
            Fetching upstream changes from https://github.com/rcbops/rpc-gating.git
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --no-tags --progress https://github.com/rcbops/rpc-gating.git +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/*
            JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://wiki.jenkins-ci.org/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData
            Checking out Revision bc2e7318899dab969fd1453a298f0682d540b850 (origin/pr/705/merge)
             > git config core.sparsecheckout # timeout=10
             > git checkout -f bc2e7318899dab969fd1453a298f0682d540b850
            Commit message: "Merge c5d1bbcf93933149cfd705f029c62d7da6926820 into d14c4e6560a066e0c3b69e8b779be18555be5fc3"
             > git rev-list 657eb68944c948731e98f6796aedc8290866e78e # timeout=10
            

             

            Failure log (post upgrade, git plugin 3.8.0):

            GitHub pull request #718 of commit d064ad16f1cc755ba8d2f4f9117d68b1278351db, no merge conflicts.
            Setting status of d064ad16f1cc755ba8d2f4f9117d68b1278351db to PENDING with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1784/ and message: 'Build started sha1 is merged.'
            Using context: CIT/issue-link
            Running in Durability level: PERFORMANCE_OPTIMIZED
            [Pipeline] library
            Loading library rpc-gating@origin/pr/718/merge
            Attempting to resolve origin/pr/718/merge from remote references...
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git ls-remote -h -t https://github.com/rcbops/rpc-gating.git # timeout=10
            Could not find origin/pr/718/merge in remote references. Pulling heads to local for deep search...
             > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to https://github.com/rcbops/rpc-gating.git
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/*
             > git rev-parse origin/pr/718/merge^{commit} # timeout=10
             > git branch -a -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b # timeout=10
            Could not find a branch containing commit 00bd1369667c19ed6566bf11118c2bf35767b69b
            [Pipeline] End of Pipeline
            [BFA] Scanning build for known causes...
            [BFA] No failure causes found
            [BFA] Done. 0s
            Setting status of d064ad16f1cc755ba8d2f4f9117d68b1278351db to FAILURE with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1784/ and message: 'Build finished. '
            Using context: CIT/issue-link
            ERROR: No version origin/pr/718/merge found for library rpc-gating
            Finished: FAILURE
            

            Note that manually executing the above commands does find a matching branch:

            12:30 $ git fetch --tags --progress origin '+refs/heads/*:refs/remotes/origin/*' '+refs/pull/*:refs/heads/origin/pr/*'
            remote: Counting objects: 1322, done.
            remote: Compressing objects: 100% (7/7), done.
            remote: Total 1322 (delta 757), reused 759 (delta 757), pack-reused 558
            Receiving objects: 100% (1322/1322), 231.92 KiB | 1.23 MiB/s, done.
            Resolving deltas: 100% (832/832), completed with 454 local objects.
            From github.com:rcbops/rpc-gating
             * [new ref]         refs/pull/1/head    -> origin/pr/1/head
             * [new ref]         refs/pull/10/head   -> origin/pr/10/head
            
            ...
            
            12:30 $ git branch -a -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b
              origin/pr/718/merge 00bd1369667c19ed6566bf11118c2bf35767b69b Merge d064ad16f1cc755ba8d2f4f9117d68b1278351db into d14c4e6560a066e0c3b69e8b779be18555be5fc3
            12:30 $ git branch -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b
              origin/pr/718/merge 00bd1369667c19ed6566bf11118c2bf35767b69b Merge d064ad16f1cc755ba8d2f4f9117d68b1278351db into d14c4e6560a066e0c3b69e8b779be18555be5fc3
            12:31 $
            
            Show
            hughsaunders Hugh Saunders added a comment - In the code added in 3.6.4 there are 6 cases laid out for resolving the version, they are: branch (or SHA that it points to) tag (or SHA that it points to) SHA (Abbreviated SHAs are also covered) The option thats conspicuously absent is a ref that isn't a branch, tag or SHA. A SHA is a direct object hash, a branch is a ref under refs/heads or refs/remotes/*/ and a Tag is a ref under refs/tags So where does a ref that isn't under heads, remotes or tags fit in? for example: refs/pull/90/merge Note that this type of ref used to work, with the appropriate refspec in global config.  I use +refs/pull/*:refs/remotes/@{remote}/pr/* and +refs/heads/*:refs/remotes/@{remote}/*   Successful log (old version, sorry I don't know the exact version, I know thats super unhelpful.): GitHub pull request #705 of commit c5d1bbcf93933149cfd705f029c62d7da6926820, no merge conflicts. Setting status of c5d1bbcf93933149cfd705f029c62d7da6926820 to PENDING with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1768/ and message: 'Build started sha1 is merged.' Using context: CIT/issue-link Running in Durability level: PERFORMANCE_OPTIMIZED [Pipeline] library Loading library rpc-gating@origin/pr/705/merge Attempting to resolve origin/pr/705/merge from remote references... > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git ls-remote -h -t https: //github.com/rcbops/rpc-gating.git # timeout=10 Could not find origin/pr/705/merge in remote references. Pulling heads to local for deep search... > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https: //github.com/rcbops/rpc-gating.git > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching origin... Fetching upstream changes from origin > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/* > git rev-parse origin/pr/705/merge^{commit} # timeout=10 > git branch -v --no-abbrev --contains bc2e7318899dab969fd1453a298f0682d540b850 # timeout=10 Selected match: origin/pr/705/merge revision bc2e7318899dab969fd1453a298f0682d540b850 > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching without tags Fetching upstream changes from https: //github.com/rcbops/rpc-gating.git > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --no-tags --progress https: //github.com/rcbops/rpc-gating.git +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/* JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https: //wiki.jenkins-ci.org/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData Checking out Revision bc2e7318899dab969fd1453a298f0682d540b850 (origin/pr/705/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f bc2e7318899dab969fd1453a298f0682d540b850 Commit message: "Merge c5d1bbcf93933149cfd705f029c62d7da6926820 into d14c4e6560a066e0c3b69e8b779be18555be5fc3" > git rev-list 657eb68944c948731e98f6796aedc8290866e78e # timeout=10   Failure log (post upgrade, git plugin 3.8.0): GitHub pull request #718 of commit d064ad16f1cc755ba8d2f4f9117d68b1278351db, no merge conflicts. Setting status of d064ad16f1cc755ba8d2f4f9117d68b1278351db to PENDING with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1784/ and message: 'Build started sha1 is merged.' Using context: CIT/issue-link Running in Durability level: PERFORMANCE_OPTIMIZED [Pipeline] library Loading library rpc-gating@origin/pr/718/merge Attempting to resolve origin/pr/718/merge from remote references... > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git ls-remote -h -t https: //github.com/rcbops/rpc-gating.git # timeout=10 Could not find origin/pr/718/merge in remote references. Pulling heads to local for deep search... > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https: //github.com/rcbops/rpc-gating.git > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching origin... Fetching upstream changes from origin > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/* > git rev-parse origin/pr/718/merge^{commit} # timeout=10 > git branch -a -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b # timeout=10 Could not find a branch containing commit 00bd1369667c19ed6566bf11118c2bf35767b69b [Pipeline] End of Pipeline [BFA] Scanning build for known causes... [BFA] No failure causes found [BFA] Done. 0s Setting status of d064ad16f1cc755ba8d2f4f9117d68b1278351db to FAILURE with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1784/ and message: 'Build finished. ' Using context: CIT/issue-link ERROR: No version origin/pr/718/merge found for library rpc-gating Finished: FAILURE Note that manually executing the above commands does find a matching branch: 12:30 $ git fetch --tags --progress origin '+refs/heads/*:refs/remotes/origin/*' '+refs/pull/*:refs/heads/origin/pr/*' remote: Counting objects: 1322, done. remote: Compressing objects: 100% (7/7), done. remote: Total 1322 (delta 757), reused 759 (delta 757), pack-reused 558 Receiving objects: 100% (1322/1322), 231.92 KiB | 1.23 MiB/s, done. Resolving deltas: 100% (832/832), completed with 454 local objects. From github.com:rcbops/rpc-gating * [ new ref] refs/pull/1/head -> origin/pr/1/head * [ new ref] refs/pull/10/head -> origin/pr/10/head ... 12:30 $ git branch -a -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b origin/pr/718/merge 00bd1369667c19ed6566bf11118c2bf35767b69b Merge d064ad16f1cc755ba8d2f4f9117d68b1278351db into d14c4e6560a066e0c3b69e8b779be18555be5fc3 12:30 $ git branch -v --no-abbrev --contains 00bd1369667c19ed6566bf11118c2bf35767b69b origin/pr/718/merge 00bd1369667c19ed6566bf11118c2bf35767b69b Merge d064ad16f1cc755ba8d2f4f9117d68b1278351db into d14c4e6560a066e0c3b69e8b779be18555be5fc3 12:31 $
            Hide
            markewaite Mark Waite added a comment -

            Hugh Saunders and Michael Krotscheck I would appreciate very much if you would test drive the plugin build from the pull request in your environments, with the additional trait "Discover other refs" as advised by rsandell .

            It worked for Robin Smith and I hope you can confirm that it works for you as well.

            Show
            markewaite Mark Waite added a comment - Hugh Saunders and Michael Krotscheck I would appreciate very much if you would test drive the plugin build from the pull request in your environments, with the additional trait "Discover other refs" as advised by rsandell . It worked for Robin Smith and I hope you can confirm that it works for you as well.
            markewaite Mark Waite made changes -
            Remote Link This issue links to "PR 577 (Web Link)" [ 20477 ]
            markewaite Mark Waite made changes -
            Remote Link This issue links to "PR 577 (Web Link)" [ 20477 ]
            markewaite Mark Waite made changes -
            Link This issue relates to JENKINS-48385 [ JENKINS-48385 ]
            Hide
            hughsaunders Hugh Saunders added a comment - - edited

            This failure was due to my config error, see my next comment.

             

            Hey Mark Waite, I built rsandell's branch at 887ac3394c48e844147de591277a0457adb345a3 but it didn't solve my problem. 

            Version:

            Git plugin
            This plugin integrates Git with Jenkins.
            3.8.1-SNAPSHOT (private-887ac339-hughsaunders)	
            Downgrade to 3.6.3

            Console:

            GitHub pull request #719 of commit f35de294eaebcbe5aecd824b444d1d901777814a, no merge conflicts.
            Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to PENDING with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1806/ and message: 'Build started sha1 is merged.'
            Using context: CIT/issue-link
            Running in Durability level: PERFORMANCE_OPTIMIZED
            [Pipeline] library
            Loading library rpc-gating@origin/pr/719/merge
            Attempting to resolve origin/pr/719/merge from remote references...
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git ls-remote -h https://github.com/rcbops/rpc-gating.git # timeout=10
            Could not find origin/pr/719/merge in remote references. Pulling heads to local for deep search...
             > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to https://github.com/rcbops/rpc-gating.git
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/*
             > git rev-parse origin/pr/719/merge^{commit} # timeout=10
             > git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1 # timeout=10
            Could not find a branch containing commit 10939c10d74f2284e1078a7371d49587d71858a1
            [Pipeline] End of Pipeline
            [BFA] Scanning build for known causes...
            [BFA] No failure causes found
            [BFA] Done. 0s
            Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to FAILURE with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1806/ and message: 'Build finished. '
            Using context: CIT/issue-link
            ERROR: No version origin/pr/719/merge found for library rpc-gating
            Finished: FAILURE

            Its frustrating because the ref is obviously valid as

             git rev-parse origin/pr/719/merge^{commit}

            successfully translates it to a SHA.

            As before, when running the commands manually, a branch is found:

            10:08 $ git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/*
            remote: Counting objects: 1319, done.
            remote: Compressing objects: 100% (12/12), done.
            remote: Total 1319 (delta 755), reused 753 (delta 752), pack-reused 555
            Receiving objects: 100% (1319/1319), 232.31 KiB | 1.40 MiB/s, done.
            Resolving deltas: 100% (830/830), completed with 453 local objects.
            From github.com:rcbops/rpc-gating
            * [new ref] refs/pull/1/head -> origin/pr/1/head
            * [new ref] refs/pull/10/head -> origin/pr/10/head
            * [new ref] refs/pull/100/head -> origin/pr/100/head
            ...
            10:08 $ git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1
            origin/pr/719/merge 10939c10d74f2284e1078a7371d49587d71858a1 Merge f35de294eaebcbe5aecd824b444d1d901777814a into b0359387d639b5d7df8267f4fa09c0bba798a286
            Show
            hughsaunders Hugh Saunders added a comment - - edited This failure was due to my config error, see my next comment.   Hey Mark Waite , I built rsandell 's branch at 887ac3394c48e844147de591277a0457adb345a3 but it didn't solve my problem.  Version: Git plugin This plugin integrates Git with Jenkins. 3.8.1-SNAPSHOT ( private -887ac339-hughsaunders) Downgrade to 3.6.3 Console: GitHub pull request #719 of commit f35de294eaebcbe5aecd824b444d1d901777814a, no merge conflicts. Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to PENDING with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1806/ and message: 'Build started sha1 is merged.' Using context: CIT/issue-link Running in Durability level: PERFORMANCE_OPTIMIZED [Pipeline] library Loading library rpc-gating@origin/pr/719/merge Attempting to resolve origin/pr/719/merge from remote references... > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git ls-remote -h https: //github.com/rcbops/rpc-gating.git # timeout=10 Could not find origin/pr/719/merge in remote references. Pulling heads to local for deep search... > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https: //github.com/rcbops/rpc-gating.git > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching origin... Fetching upstream changes from origin > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/* > git rev-parse origin/pr/719/merge^{commit} # timeout=10 > git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1 # timeout=10 Could not find a branch containing commit 10939c10d74f2284e1078a7371d49587d71858a1 [Pipeline] End of Pipeline [BFA] Scanning build for known causes... [BFA] No failure causes found [BFA] Done. 0s Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to FAILURE with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1806/ and message: 'Build finished. ' Using context: CIT/issue-link ERROR: No version origin/pr/719/merge found for library rpc-gating Finished: FAILURE Its frustrating because the ref is obviously valid as git rev-parse origin/pr/719/merge^{commit} successfully translates it to a SHA. As before, when running the commands manually, a branch is found: 10:08 $ git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/heads/origin/pr/* remote: Counting objects: 1319, done. remote: Compressing objects: 100% (12/12), done. remote: Total 1319 (delta 755), reused 753 (delta 752), pack-reused 555 Receiving objects: 100% (1319/1319), 232.31 KiB | 1.40 MiB/s, done. Resolving deltas: 100% (830/830), completed with 453 local objects. From github.com:rcbops/rpc-gating * [ new ref] refs/pull/1/head -> origin/pr/1/head * [ new ref] refs/pull/10/head -> origin/pr/10/head * [ new ref] refs/pull/100/head -> origin/pr/100/head ... 10:08 $ git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1 origin/pr/719/merge 10939c10d74f2284e1078a7371d49587d71858a1 Merge f35de294eaebcbe5aecd824b444d1d901777814a into b0359387d639b5d7df8267f4fa09c0bba798a286
            hughsaunders Hugh Saunders made changes -
            Hide
            hughsaunders Hugh Saunders added a comment - - edited

            Update... I forgot to add the new trait, which explains the failure in my above comment. 

            I retried, switching from github to git retrieval method and adding the new trait. I also removed the additional refspecs I had defined previously.

            Current config:

            Now library checkout from a PR works again 

            GitHub pull request #719 of commit f35de294eaebcbe5aecd824b444d1d901777814a, no merge conflicts.
            Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to PENDING with url https://rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1814/ and message: 'Build started sha1 is merged.'
            Using context: CIT/issue-link
            Running in Durability level: PERFORMANCE_OPTIMIZED
            [Pipeline] library
            Loading library rpc-gating@origin/pr/719/merge
            Attempting to resolve origin/pr/719/merge from remote references...
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git ls-remote https://github.com/rcbops/rpc-gating.git # timeout=10
            Could not find origin/pr/719/merge in remote references. Pulling heads to local for deep search...
             > git rev-parse --is-inside-work-tree # timeout=10
            Setting origin to https://github.com/rcbops/rpc-gating.git
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching origin...
            Fetching upstream changes from origin
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* +refs/origin/pull/*/merge:refs/remotes/origin/origin/pull/*/merge
             > git rev-parse origin/pr/719/merge^{commit} # timeout=10
             > git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1 # timeout=10
            Selected match: pr/719/merge revision 10939c10d74f2284e1078a7371d49587d71858a1
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url https://github.com/rcbops/rpc-gating.git # timeout=10
            Fetching without tags
            Fetching upstream changes from https://github.com/rcbops/rpc-gating.git
             > git --version # timeout=10
            using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc
             > git fetch --no-tags --progress https://github.com/rcbops/rpc-gating.git +refs/heads/*:refs/remotes/origin/* +refs/origin/pull/*/merge:refs/remotes/origin/origin/pull/*/merge
            JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https://wiki.jenkins-ci.org/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData
            Checking out Revision 10939c10d74f2284e1078a7371d49587d71858a1 (pr/719/merge)
             > git config core.sparsecheckout # timeout=10
             > git checkout -f 10939c10d74f2284e1078a7371d49587d71858a1
            Commit message: "Merge f35de294eaebcbe5aecd824b444d1d901777814a into b0359387d639b5d7df8267f4fa09c0bba798a286"
             > git rev-list --no-walk 1ab31cb8abfe1386c699bf6fbdb406f8105af82d # timeout=10
            

             

            Show
            hughsaunders Hugh Saunders added a comment - - edited Update... I forgot to add the new trait, which explains the failure in my above comment.  I retried, switching from github to git retrieval method and adding the new trait. I also removed the additional refspecs I had defined previously. Current config: Now library checkout from a PR works again  GitHub pull request #719 of commit f35de294eaebcbe5aecd824b444d1d901777814a, no merge conflicts. Setting status of f35de294eaebcbe5aecd824b444d1d901777814a to PENDING with url https: //rpc.jenkins.cit.rackspace.net/job/RPC-Pull-Request-Issue-Link_rpc_gating/1814/ and message: 'Build started sha1 is merged.' Using context: CIT/issue-link Running in Durability level: PERFORMANCE_OPTIMIZED [Pipeline] library Loading library rpc-gating@origin/pr/719/merge Attempting to resolve origin/pr/719/merge from remote references... > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git ls-remote https: //github.com/rcbops/rpc-gating.git # timeout=10 Could not find origin/pr/719/merge in remote references. Pulling heads to local for deep search... > git rev-parse --is-inside-work-tree # timeout=10 Setting origin to https: //github.com/rcbops/rpc-gating.git > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching origin... Fetching upstream changes from origin > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --tags --progress origin +refs/heads /*:refs/remotes/origin/* +refs/origin/pull/*/ merge:refs/remotes/origin/origin/pull/*/merge > git rev-parse origin/pr/719/merge^{commit} # timeout=10 > git branch -a -v --no-abbrev --contains 10939c10d74f2284e1078a7371d49587d71858a1 # timeout=10 Selected match: pr/719/merge revision 10939c10d74f2284e1078a7371d49587d71858a1 > git rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository > git config remote.origin.url https: //github.com/rcbops/rpc-gating.git # timeout=10 Fetching without tags Fetching upstream changes from https: //github.com/rcbops/rpc-gating.git > git --version # timeout=10 using GIT_ASKPASS to set credentials github_account_rpc_jenkins_svc > git fetch --no-tags --progress https: //github.com/rcbops/rpc-gating.git +refs/heads /*:refs/remotes/origin/* +refs/origin/pull/*/ merge:refs/remotes/origin/origin/pull/*/merge JENKINS-19022: warning: possible memory leak due to Git plugin usage; see: https: //wiki.jenkins-ci.org/display/JENKINS/Remove+Git+Plugin+BuildsByBranch+BuildData Checking out Revision 10939c10d74f2284e1078a7371d49587d71858a1 (pr/719/merge) > git config core.sparsecheckout # timeout=10 > git checkout -f 10939c10d74f2284e1078a7371d49587d71858a1 Commit message: "Merge f35de294eaebcbe5aecd824b444d1d901777814a into b0359387d639b5d7df8267f4fa09c0bba798a286" > git rev-list --no-walk 1ab31cb8abfe1386c699bf6fbdb406f8105af82d # timeout=10  
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "CloudBees Internal OSS-2663 (Web Link)" [ 20524 ]
            jamesdumay James Dumay made changes -
            Remote Link This issue links to "CloudBees Internal CD-484 (Web Link)" [ 20617 ]
            rsandell rsandell made changes -
            Link This issue is related to JENKINS-51134 [ JENKINS-51134 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitBranchSCMRevision.java
            src/main/java/jenkins/plugins/git/GitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMTelescope.java
            src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java
            src/test/java/jenkins/plugins/git/GitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/50e4690cd0e32c35111dfd52e6a1d26eb9995468
            Log:
            JENKINS-48061 Introduce GitBranchSCMHead

            And migrate old usage of plain SCMHead

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitBranchSCMRevision.java src/main/java/jenkins/plugins/git/GitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMTelescope.java src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java src/test/java/jenkins/plugins/git/GitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/50e4690cd0e32c35111dfd52e6a1d26eb9995468 Log: JENKINS-48061 Introduce GitBranchSCMHead And migrate old usage of plain SCMHead
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMRevision.java
            src/main/java/jenkins/plugins/git/GitSCMBuilder.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/2eee3e5afa0b759f124da6439bd4652bfd3399af
            Log:
            JENKINS-48061 Introduce GitRefSCMHead

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMRevision.java src/main/java/jenkins/plugins/git/GitSCMBuilder.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/2eee3e5afa0b759f124da6439bd4652bfd3399af Log: JENKINS-48061 Introduce GitRefSCMHead
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/d49fec4bb795a573112aae0bce2b979d19066eca
            Log:
            JENKINS-48061 GitSCMHeadMixin and discover all published refs

            Since it seems like the git protocol doesn't allow discovering unpublished refs
            anyway, we can do ahead and find the sha among all published refs instead

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/d49fec4bb795a573112aae0bce2b979d19066eca Log: JENKINS-48061 GitSCMHeadMixin and discover all published refs Since it seems like the git protocol doesn't allow discovering unpublished refs anyway, we can do ahead and find the sha among all published refs instead
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java
            http://jenkins-ci.org/commit/git-plugin/54c5a0306b690bdf5ae2676cdaf816d6970fcd48
            Log:
            JENKINS-48061 Use constants not literals

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java http://jenkins-ci.org/commit/git-plugin/54c5a0306b690bdf5ae2676cdaf816d6970fcd48 Log: JENKINS-48061 Use constants not literals
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            pom.xml
            src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java
            src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm.zip
            src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm_repositories.zip
            http://jenkins-ci.org/commit/git-plugin/54115890411a10e0a853da0ad4ec3d3c214e628c
            Log:
            JENKINS-48061 Add a test for buildstorm check

            This required a newer ish shared libraries plugin in the test scope
            which required a slightly newer jenkins core

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pom.xml src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm.zip src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm_repositories.zip http://jenkins-ci.org/commit/git-plugin/54115890411a10e0a853da0ad4ec3d3c214e628c Log: JENKINS-48061 Add a test for buildstorm check This required a newer ish shared libraries plugin in the test scope which required a slightly newer jenkins core
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/ac97524ab61e1cd2caf4ef9e1419bc410f3c0658
            Log:
            JENKINS-48061 Do something when it's a plain ref

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/ac97524ab61e1cd2caf4ef9e1419bc410f3c0658 Log: JENKINS-48061 Do something when it's a plain ref
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/eb8f3788eac9cca440c82f2f9f9f2903f634fd39
            Log:
            Merge commit '919b7bf3f194eefa739e68bf27e059abc002cc2a' into JENKINS-48061

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/eb8f3788eac9cca440c82f2f9f9f2903f634fd39 Log: Merge commit '919b7bf3f194eefa739e68bf27e059abc002cc2a' into JENKINS-48061
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMRevision.java
            src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java
            http://jenkins-ci.org/commit/git-plugin/79a5e1a0bbf5bb8f949c4108f059a3551d3e417e
            Log:
            JENKINS-48061 MIT headers and a todo

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMRevision.java src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java http://jenkins-ci.org/commit/git-plugin/79a5e1a0bbf5bb8f949c4108f059a3551d3e417e Log: JENKINS-48061 MIT headers and a todo
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            http://jenkins-ci.org/commit/git-plugin/ceabe36d1f379bad4e37573a9f6094e4e06e2525
            Log:
            JENKINS-48061 final GitBranchSCMHead.getRef

            let's not let anyone hijack branch for a non-branch

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/GitBranchSCMHead.java http://jenkins-ci.org/commit/git-plugin/ceabe36d1f379bad4e37573a9f6094e4e06e2525 Log: JENKINS-48061 final GitBranchSCMHead.getRef let's not let anyone hijack branch for a non-branch
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/68a956f9c3180e75b8c3c1b7d43ca2f870a82e9d
            Log:
            JENKINS-48061 Non GitSCMHeadMixin should be a branch

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/68a956f9c3180e75b8c3c1b7d43ca2f870a82e9d Log: JENKINS-48061 Non GitSCMHeadMixin should be a branch
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            pom.xml
            http://jenkins-ci.org/commit/git-plugin/0cc223cec6d13d64cf6ac4c94065afbe83b29ff8
            Log:
            JENKINS-48061 More finageling with dependencies

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pom.xml http://jenkins-ci.org/commit/git-plugin/0cc223cec6d13d64cf6ac4c94065afbe83b29ff8 Log: JENKINS-48061 More finageling with dependencies
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/1d3888812b647aa7a6ab256296551863760fdb61
            Log:
            Revert "JENKINS-48061 Non GitSCMHeadMixin should be a branch"

            This reverts commit 68a956f9c3180e75b8c3c1b7d43ca2f870a82e9d.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/1d3888812b647aa7a6ab256296551863760fdb61 Log: Revert " JENKINS-48061 Non GitSCMHeadMixin should be a branch" This reverts commit 68a956f9c3180e75b8c3c1b7d43ca2f870a82e9d.
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/1340f867c7de5f2474fa3866a3d5c9f4c38fcba5
            Log:
            JENKINS-48061 That logging might be a bit too informative

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/1340f867c7de5f2474fa3866a3d5c9f4c38fcba5 Log: JENKINS-48061 That logging might be a bit too informative
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/cb2e753cd81be123af628c7f502681ef6b2a9a34
            Log:
            JENKINS-48061 Motivate withoutRefspec

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/cb2e753cd81be123af628c7f502681ef6b2a9a34 Log: JENKINS-48061 Motivate withoutRefspec
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java
            http://jenkins-ci.org/commit/git-plugin/d21ba4ea1011168e53bf82feb2466295a3da118e
            Log:
            JENKINS-48061 Clean up after test

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java http://jenkins-ci.org/commit/git-plugin/d21ba4ea1011168e53bf82feb2466295a3da118e Log: JENKINS-48061 Clean up after test
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/bcd0e206edebd84a7f069bd0dd083d7b18158d6c
            Log:
            JENKINS-48061 Make the comment an actual comment

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/bcd0e206edebd84a7f069bd0dd083d7b18158d6c Log: JENKINS-48061 Make the comment an actual comment
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/2cc15228d0b34bfcc13d4f1e58dcd79344faaa3c
            Log:
            JENKINS-48061 Move HEAD check to top

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/2cc15228d0b34bfcc13d4f1e58dcd79344faaa3c Log: JENKINS-48061 Move HEAD check to top
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitSCMBuilder.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java
            src/test/java/jenkins/plugins/git/GitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/d6862539704655da7158385710e1a69e4ce9b20f
            Log:
            JENKINS-48061 regrouping and more tests

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitSCMBuilder.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java src/test/java/jenkins/plugins/git/GitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/d6862539704655da7158385710e1a69e4ce9b20f Log: JENKINS-48061 regrouping and more tests
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
            src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/config.jelly
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-nameMapping.html
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-ref.html
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help.html
            src/main/resources/jenkins/plugins/git/traits/Messages.properties
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            src/test/java/jenkins/plugins/git/traits/DiscoverOtherRefsTraitTest.java
            http://jenkins-ci.org/commit/git-plugin/75177c492f12ef59e65e118ea4b6c62daa7dd5c2
            Log:
            JENKINS-48061 Adding DiscoverOtherRefsTrait

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMSourceContext.java src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/config.jelly src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-nameMapping.html src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-ref.html src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help.html src/main/resources/jenkins/plugins/git/traits/Messages.properties src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java src/test/java/jenkins/plugins/git/traits/DiscoverOtherRefsTraitTest.java http://jenkins-ci.org/commit/git-plugin/75177c492f12ef59e65e118ea4b6c62daa7dd5c2 Log: JENKINS-48061 Adding DiscoverOtherRefsTrait
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
            src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/f67a66ec0900c83d6785955d32de32b1f17f4724
            Log:
            JENKINS-48061 Retrieve other refs

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMSourceContext.java src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/f67a66ec0900c83d6785955d32de32b1f17f4724 Log: JENKINS-48061 Retrieve other refs
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/887ac3394c48e844147de591277a0457adb345a3
            Log:
            JENKINS-48061 retrieveRevisions

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/887ac3394c48e844147de591277a0457adb345a3 Log: JENKINS-48061 retrieveRevisions
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            pom.xml
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
            src/main/java/jenkins/plugins/git/GitSCMTelescope.java
            http://jenkins-ci.org/commit/git-plugin/4a7cba88498ba5f5cdc1c4a76fac17fa0faa4f99
            Log:
            JENKINS-48061 Cleaned up comments and todos

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: pom.xml src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMSourceContext.java src/main/java/jenkins/plugins/git/GitSCMTelescope.java http://jenkins-ci.org/commit/git-plugin/4a7cba88498ba5f5cdc1c4a76fac17fa0faa4f99 Log: JENKINS-48061 Cleaned up comments and todos
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
            src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java
            http://jenkins-ci.org/commit/git-plugin/36a307a5e128e5f47d2284317a6cf1e0cb4595e5
            Log:
            JENKINS-48061 rename WantedOtherRefs to RefNameMapping

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMSourceContext.java src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java http://jenkins-ci.org/commit/git-plugin/36a307a5e128e5f47d2284317a6cf1e0cb4595e5 Log: JENKINS-48061 rename WantedOtherRefs to RefNameMapping
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            http://jenkins-ci.org/commit/git-plugin/6ffc5710f70a58e42873d2f3d94d887b557685a9
            Log:
            JENKINS-48061 Added a test to verify we can retrieve a commit
            that is not on the head of a custom ref

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java http://jenkins-ci.org/commit/git-plugin/6ffc5710f70a58e42873d2f3d94d887b557685a9 Log: JENKINS-48061 Added a test to verify we can retrieve a commit that is not on the head of a custom ref
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: rsandell
            Path:
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            http://jenkins-ci.org/commit/git-plugin/191cf5562d801a0d8749c847451595271872b6a8
            Log:
            JENKINS-48061 Resolve other ref before tag name

            So we don't have to check timestamps on the tag

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: rsandell Path: src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java http://jenkins-ci.org/commit/git-plugin/191cf5562d801a0d8749c847451595271872b6a8 Log: JENKINS-48061 Resolve other ref before tag name So we don't have to check timestamps on the tag
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            README.md
            pom.xml
            src/main/java/hudson/plugins/git/browser/AssemblaWeb.java
            src/main/java/hudson/plugins/git/browser/BitbucketWeb.java
            src/main/java/hudson/plugins/git/browser/CGit.java
            src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java
            src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java
            src/main/java/hudson/plugins/git/browser/GitLab.java
            src/main/java/hudson/plugins/git/browser/GitList.java
            src/main/java/hudson/plugins/git/browser/GitWeb.java
            src/main/java/hudson/plugins/git/browser/GithubWeb.java
            src/main/java/hudson/plugins/git/browser/Gitiles.java
            src/main/java/hudson/plugins/git/browser/GitoriousWeb.java
            src/main/java/hudson/plugins/git/browser/GogsGit.java
            src/main/java/hudson/plugins/git/browser/KilnGit.java
            src/main/java/hudson/plugins/git/browser/Phabricator.java
            src/main/java/hudson/plugins/git/browser/RedmineWeb.java
            src/main/java/hudson/plugins/git/browser/RhodeCode.java
            src/main/java/hudson/plugins/git/browser/Stash.java
            src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java
            src/main/java/hudson/plugins/git/browser/ViewGitWeb.java
            src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
            src/main/java/jenkins/plugins/git/GitBranchSCMHead.java
            src/main/java/jenkins/plugins/git/GitBranchSCMRevision.java
            src/main/java/jenkins/plugins/git/GitRefSCMHead.java
            src/main/java/jenkins/plugins/git/GitRefSCMRevision.java
            src/main/java/jenkins/plugins/git/GitSCMBuilder.java
            src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java
            src/main/java/jenkins/plugins/git/GitSCMSource.java
            src/main/java/jenkins/plugins/git/GitSCMSourceContext.java
            src/main/java/jenkins/plugins/git/GitSCMTelescope.java
            src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/config.jelly
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-nameMapping.html
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-ref.html
            src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help.html
            src/main/resources/jenkins/plugins/git/traits/Messages.properties
            src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java
            src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java
            src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java
            src/test/java/jenkins/plugins/git/GitSCMSourceTest.java
            src/test/java/jenkins/plugins/git/traits/DiscoverOtherRefsTraitTest.java
            src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm.zip
            src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm_repositories.zip
            http://jenkins-ci.org/commit/git-plugin/927c8295d326a755cc7443f1834d7ff9ede37ee2
            Log:
            Merge pull request #577 from rsandell/JENKINS-48061

            JENKINS-48061 Add new "Discover other refs" trait, GitBranchSCMHead and GitRefSCMHead

            Compare: https://github.com/jenkinsci/git-plugin/compare/bd8d2b9a9546...927c8295d326
            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: README.md pom.xml src/main/java/hudson/plugins/git/browser/AssemblaWeb.java src/main/java/hudson/plugins/git/browser/BitbucketWeb.java src/main/java/hudson/plugins/git/browser/CGit.java src/main/java/hudson/plugins/git/browser/FisheyeGitRepositoryBrowser.java src/main/java/hudson/plugins/git/browser/GitBlitRepositoryBrowser.java src/main/java/hudson/plugins/git/browser/GitLab.java src/main/java/hudson/plugins/git/browser/GitList.java src/main/java/hudson/plugins/git/browser/GitWeb.java src/main/java/hudson/plugins/git/browser/GithubWeb.java src/main/java/hudson/plugins/git/browser/Gitiles.java src/main/java/hudson/plugins/git/browser/GitoriousWeb.java src/main/java/hudson/plugins/git/browser/GogsGit.java src/main/java/hudson/plugins/git/browser/KilnGit.java src/main/java/hudson/plugins/git/browser/Phabricator.java src/main/java/hudson/plugins/git/browser/RedmineWeb.java src/main/java/hudson/plugins/git/browser/RhodeCode.java src/main/java/hudson/plugins/git/browser/Stash.java src/main/java/hudson/plugins/git/browser/TFS2013GitRepositoryBrowser.java src/main/java/hudson/plugins/git/browser/ViewGitWeb.java src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java src/main/java/jenkins/plugins/git/GitBranchSCMHead.java src/main/java/jenkins/plugins/git/GitBranchSCMRevision.java src/main/java/jenkins/plugins/git/GitRefSCMHead.java src/main/java/jenkins/plugins/git/GitRefSCMRevision.java src/main/java/jenkins/plugins/git/GitSCMBuilder.java src/main/java/jenkins/plugins/git/GitSCMHeadMixin.java src/main/java/jenkins/plugins/git/GitSCMSource.java src/main/java/jenkins/plugins/git/GitSCMSourceContext.java src/main/java/jenkins/plugins/git/GitSCMTelescope.java src/main/java/jenkins/plugins/git/traits/DiscoverOtherRefsTrait.java src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/config.jelly src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-nameMapping.html src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help-ref.html src/main/resources/jenkins/plugins/git/traits/DiscoverOtherRefsTrait/help.html src/main/resources/jenkins/plugins/git/traits/Messages.properties src/test/java/jenkins/plugins/git/AbstractGitSCMSourceTest.java src/test/java/jenkins/plugins/git/GitBranchSCMHeadTest.java src/test/java/jenkins/plugins/git/GitSCMFileSystemTest.java src/test/java/jenkins/plugins/git/GitSCMSourceTest.java src/test/java/jenkins/plugins/git/traits/DiscoverOtherRefsTraitTest.java src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm.zip src/test/resources/jenkins/plugins/git/GitBranchSCMHeadTest/testMigrationNoBuildStorm_repositories.zip http://jenkins-ci.org/commit/git-plugin/927c8295d326a755cc7443f1834d7ff9ede37ee2 Log: Merge pull request #577 from rsandell/ JENKINS-48061 JENKINS-48061 Add new "Discover other refs" trait, GitBranchSCMHead and GitRefSCMHead Compare: https://github.com/jenkinsci/git-plugin/compare/bd8d2b9a9546...927c8295d326 * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            rsandell rsandell made changes -
            Status In Review [ 10005 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            Jenkinsfile
            http://jenkins-ci.org/commit/hello-world-plugin/96ae30edf0efe2cd54b419c80815a41a60aa8e90
            Log:
            test JENKINS-48061 no tag, no branch

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: Jenkinsfile http://jenkins-ci.org/commit/hello-world-plugin/96ae30edf0efe2cd54b419c80815a41a60aa8e90 Log: test JENKINS-48061 no tag, no branch
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Mark Waite
            Path:
            Jenkinsfile
            http://jenkins-ci.org/commit/hello-world-plugin/cd774efec0b23bea3ee49511b7893ebb6c363d50
            Log:
            Use JENKINS-48061-no-tag-no-branch branch in test Jenkinsfile

            *NOTE:* This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

            Functionality will be removed from GitHub.com on January 31st, 2019.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Mark Waite Path: Jenkinsfile http://jenkins-ci.org/commit/hello-world-plugin/cd774efec0b23bea3ee49511b7893ebb6c363d50 Log: Use JENKINS-48061 -no-tag-no-branch branch in test Jenkinsfile * NOTE: * This service been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/ Functionality will be removed from GitHub.com on January 31st, 2019.
            Hide
            markewaite Mark Waite added a comment -

            Confirmed by testing a pre-release of git plugin 3.9.0 that the "modern Git" implementation is able to read Pipeline shared library references by SHA1.

            Confirmed by testing a pre-release of git plugin 3.9.0 that the "modern GitHub" implementation is unable to read Pipeline shared library references by SHA1. That was not intended to be covered in this fix, and is not covered in this fix.

            Confirmed by testing a pre-release of git plugin 3.9.0 that the "legacy Git" implementation is unable to read Pipeline shared library references by SHA1. That was not intended to be covered in this fix, and is not covered in this fix.

            Show
            markewaite Mark Waite added a comment - Confirmed by testing a pre-release of git plugin 3.9.0 that the "modern Git" implementation is able to read Pipeline shared library references by SHA1. Confirmed by testing a pre-release of git plugin 3.9.0 that the "modern GitHub" implementation is unable to read Pipeline shared library references by SHA1. That was not intended to be covered in this fix, and is not covered in this fix. Confirmed by testing a pre-release of git plugin 3.9.0 that the "legacy Git" implementation is unable to read Pipeline shared library references by SHA1. That was not intended to be covered in this fix, and is not covered in this fix.
            Hide
            markewaite Mark Waite added a comment -

            Included in git plugin 3.9.0 released 12 May 2018

            Show
            markewaite Mark Waite added a comment - Included in git plugin 3.9.0 released 12 May 2018
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            Hide
            diegor Diego Russo added a comment -

            All, thanks for your support and help in solving this ticket. Much appreciated.

            Show
            diegor Diego Russo added a comment - All, thanks for your support and help in solving this ticket. Much appreciated.

              People

              • Assignee:
                rsandell rsandell
                Reporter:
                diegor Diego Russo
              • Votes:
                8 Vote for this issue
                Watchers:
                16 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: