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

Bitbucket Plugin - HTTPS URI not matched when path does not start with "/scm"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • bitbucket-plugin
    • None
    • Jenkins 2.60.2, bitbucket-plugin 1.1.8

      I am unable to use a bitbucket-hook with a Bitbucket server URI that contains a path that does not start with "/scm".  The GitStatus.looselyMatches comparison fails.

       

      Before the GitStatus.looselyMatches comparison, a URI is stripped of "/scm" so that the comparison does not fail (as of 1.1.8 via https://github.com/jenkinsci/bitbucket-plugin/commit/031673033c4616bdb2930feb204795b288c9fb14).  This only applies if the path begins with "/scm" and does not take into account URIs that do not.  Refer to https://github.com/jenkinsci/bitbucket-plugin/blob/master/src/main/java/com/cloudbees/jenkins/plugins/BitbucketJobProbe.java#L92

       

      Example failure log (redacted):

      Jan 25, 2018 9:51:54 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe
      
      Trying to match https://foo.bar.com/stash/scm/baz.git<–>https://foo.bar.com/stash/baz
      
      Jan 25, 2018 9:51:54 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe
      
      hookTest SCM doesnt match remote repo {1}

       

      Expected behavior:

      Plugin should support URIs with a path that doesn't start with "/scm"

            tzach_solomon Tzach Solomon
            basdrm Bret S
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: