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: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • 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

            basdrm Bret S created issue -
            basdrm Bret S made changes -
            Field Original Value New Value
            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).  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):
            {code:java}
            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}{code}
             
            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):
            {code:java}
            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}{code}
             

            Expected behavior:

            Plugin should support URIs with a path that doesn't start with "/scm"
            steg Steve Gomez made changes -
            Assignee Steve Gomez [ steg ]
            steg Steve Gomez made changes -
            Assignee Steve Gomez [ steg ]
            roxymur Roxana Muresan made changes -
            Link This issue is blocked by JENKINS-54272 [ JENKINS-54272 ]
            tzach_solomon Tzach Solomon made changes -
            Assignee Tzach Solomon [ tzach_solomon ]
            tzach_solomon Tzach Solomon made changes -
            Released As https://plugins.jenkins.io/bitbucket/
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            tzach_solomon Tzach Solomon made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

              People

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

                Dates

                Created:
                Updated:
                Resolved: