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

Branch Specifier regex fails - passed to git rev-parse?

    XMLWordPrintable

Details

    Description

      There is an issue with certain patterns passed using the : regex specifier.

      I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

      `:origin/release-\d

      {8}`

      Here is the output from the console using this pattern


      Started by user User Name
      Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
      > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
      > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
      Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
      > git --version # timeout=10
      using .gitcredentials to set credentials
      > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
      > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/:refs/remotes/origin/
      > git config --local --remove-section credential # timeout=10
      > git rev-parse :origin/release-\d{8}

      ^

      {commit} # timeout=10
      > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit}

      # timeout=10
      > git rev-parse :origin/release-\d

      {8}

      ^

      {commit}

      # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE

      If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.

      Attachments

        Activity

          trii2054 Josh Johnston created issue -
          trii2054 Josh Johnston made changes -
          Field Original Value New Value
          Description There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          Started by user User Name
          Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
          Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
           > git --version # timeout=10
          using .gitcredentials to set credentials
           > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
           > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
           > git config --local --remove-section credential # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          Finished: FAILURE


          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE


          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          trii2054 Josh Johnston made changes -
          Description There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE


          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {code}
              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE

          {code}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          trii2054 Josh Johnston made changes -
          Description There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {code}
              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE

          {code}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {noformat}
              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE

          {noformat}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          trii2054 Josh Johnston made changes -
          Description There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {noformat}
              Started by user User Name
              Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
               > git rev-parse --is-inside-work-tree # timeout=10
              Fetching changes from the remote Git repository
               > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
              Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
               > git --version # timeout=10
              using .gitcredentials to set credentials
               > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
               > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
               > git config --local --remove-section credential # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
               > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
              ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
              Finished: FAILURE

          {noformat}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {noformat}
          Started by user User Name
          Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
          Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
           > git --version # timeout=10
          using .gitcredentials to set credentials
           > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
           > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
           > git config --local --remove-section credential # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          Finished: FAILURE
          {noformat}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          trii2054 Josh Johnston made changes -
          Description There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {noformat}
          Started by user User Name
          Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
          Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
           > git --version # timeout=10
          using .gitcredentials to set credentials
           > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
           > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
           > git config --local --remove-section credential # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          Finished: FAILURE
          {noformat}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          There is an issue with certain patterns passed using the : regex specifier.

          I am trying to match a branch with the format release-YYYYMMDD so I am using the following pattern

          `:origin/release-\d{8}`

          Here is the output from the console using this pattern

          {quote}
          Started by user User Name
          Building on master in workspace /opt/bitnami/apps/jenkins/jenkins_home/jobs/kapx-site-demo/workspace
           > git rev-parse --is-inside-work-tree # timeout=10
          Fetching changes from the remote Git repository
           > git config remote.origin.url https://source.developers.google.com/p/kapx-site-demo # timeout=10
          Fetching upstream changes from https://source.developers.google.com/p/kapx-site-demo
           > git --version # timeout=10
          using .gitcredentials to set credentials
           > git config --local credential.helper store --file=/opt/bitnami/apache-tomcat/temp/git6326675135972302331.credentials # timeout=10
           > git -c core.askpass=true fetch --tags --progress https://source.developers.google.com/p/kapx-site-demo +refs/heads/*:refs/remotes/origin/*
           > git config --local --remove-section credential # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse refs/remotes/origin/:origin/release-\d{8}^{commit} # timeout=10
           > git rev-parse :origin/release-\d{8}^{commit} # timeout=10
          ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
          Finished: FAILURE
          {quote}

          If I change the pattern to something like this `:origin/release-\d*` it does not error, but it also is not specific enough since it would match any number of digits.
          trii2054 Josh Johnston made changes -
          Assignee Nicolas De Loof [ ndeloof ] Josh Johnston [ trii2054 ]
          markewaite Mark Waite made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          markewaite Mark Waite made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 161016 ] JNJira + In-Review [ 208420 ]

          People

            trii2054 Josh Johnston
            trii2054 Josh Johnston
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: