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

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

    XMLWordPrintable

    Details

    • Similar Issues:

      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

          Hide
          trii2054 Josh Johnston added a comment -
          Show
          trii2054 Josh Johnston added a comment - PR made against master https://github.com/jenkinsci/git-plugin/pull/302
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Joshua Johnston
          Path:
          src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java
          src/test/java/hudson/plugins/git/TestBranchSpec.java
          src/test/java/hudson/plugins/git/util/DefaultBuildChooserTest.java
          http://jenkins-ci.org/commit/git-plugin/94dff14649c5989677406ad1a19115560a812dc8
          Log:
          JENKINS-26842 Handle regex branch spec which does not contain '*'

          Apply code changes via patch ignoring mismatched whitespace

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Joshua Johnston Path: src/main/java/hudson/plugins/git/util/DefaultBuildChooser.java src/test/java/hudson/plugins/git/TestBranchSpec.java src/test/java/hudson/plugins/git/util/DefaultBuildChooserTest.java http://jenkins-ci.org/commit/git-plugin/94dff14649c5989677406ad1a19115560a812dc8 Log: JENKINS-26842 Handle regex branch spec which does not contain '*' Apply code changes via patch ignoring mismatched whitespace
          Hide
          markewaite Mark Waite added a comment -

          To be included in git plugin 2.3.5

          Show
          markewaite Mark Waite added a comment - To be included in git plugin 2.3.5
          Hide
          markewaite Mark Waite added a comment -

          I confirmed this bug is fixed in the 2.3.6 snapshot version of the git plugin.

          The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin. Problems detected in the pre-release should be e-mailed to Mark Waite and Nicolas De Loof.

          I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.

          Show
          markewaite Mark Waite added a comment - I confirmed this bug is fixed in the 2.3.6 snapshot version of the git plugin. The git plugin and git client plugin are being tested in hopes of releasing new versions before the end of June. If you're willing to assist with the testing, please download and install a pre-release build of the git client plugin and the git plugin . Problems detected in the pre-release should be e-mailed to Mark Waite and Nicolas De Loof . I wrote some test ideas if you would like suggestions of areas that need testing. The git plugin supports many different use cases and its automated tests only evaluate a very few of those use cases.
          Hide
          markewaite Mark Waite added a comment -

          Fixed in git plugin 2.4.0 released 18 Jul 2015.

          Show
          markewaite Mark Waite added a comment - Fixed in git plugin 2.4.0 released 18 Jul 2015.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: