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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Blocker
    • Resolution: Unresolved
    • Component/s: bitbucket-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.60.2, bitbucket-plugin 1.1.8
    • Similar Issues:

      Description

      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"

        Attachments

          Issue Links

            Activity

            Hide
            basdrm Bret S added a comment -

            One of our employees has submitted a PR with a fix:  https://github.com/jenkinsci/bitbucket-plugin/pull/56

            Show
            basdrm Bret S added a comment - One of our employees has submitted a PR with a fix:  https://github.com/jenkinsci/bitbucket-plugin/pull/56
            Hide
            dmitryb Dmitry Bigunyak added a comment -

            I have encountered exactly the same problem!
            In my case URIs look like this:

            Jun 21, 2018 11:51:20 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe
            Trying to match https://mybitbucket.com/bitbucket/scm/path/myproject.git<-->https://mybitbucket.com/bitbucket/path/myproject
            

            When the provided PR with a fix can be merged?

            Show
            dmitryb Dmitry Bigunyak added a comment - I have encountered exactly the same problem! In my case URIs look like this: Jun 21, 2018 11:51:20 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbe Trying to match https: //mybitbucket.com/bitbucket/scm/path/myproject.git<-->https://mybitbucket.com/bitbucket/path/myproject When the provided PR with a fix can be merged?
            Hide
            steg Steve Gomez added a comment -

            ?

            Show
            steg Steve Gomez added a comment - ?
            Hide
            dmitryb Dmitry Bigunyak added a comment -

            Any chance this ticket gets someone's attention?

            Show
            dmitryb Dmitry Bigunyak added a comment - Any chance this ticket gets someone's attention?

              People

              • Assignee:
                Unassigned
                Reporter:
                basdrm Bret S
              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: