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

Bitbucket plugin is not triggering the job(s) when ssh and https have different hostnames

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: bitbucket-plugin
    • Labels:
      None
    • Environment:
      Jenkins-2.176.3
      Bitbucket Plugin 1.1.11 (latest)
      Bitbucket Server 5.8.2
    • Similar Issues:

      Description

      Bitbucket is not triggering matching jobs.

      The log statements in Jenkins are showing this after pushing to ci-test.git Repo:

      ...
      Considering candidate job xx-freestyle-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-freestyle-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git<-->https://atc.mygroup.net/scopecom/ci-test 
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-freestyle-triggered-by-bitbucket SCM doesnt match remote repo {1}
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering candidate job xx-pipeline-triggered-by-bitbucket
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-pipeline-triggered-by-bitbucket
      ...
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git<-->https://atc.mygroup.net/scopecom/ci-test 
      Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-pipeline-triggered-by-bitbucket SCM doesnt match remote repo {1}
      ...

      I´ve already merged https://github.com/jenkinsci/bitbucket-plugin/pull/59 - but I still have an issue caused by different hostnames.

      In our setup we have

      The final check is comparing the hostname(s) - and the project/repo paths.

      I dont know why the Bitbucket team decided for different hostnames for the same thing - but I need an "official" solution to be able to use this plugin.
      One idea could be to add some global configuration, where hostname equivilents may be defined (in a map for example)
      So I would add there
      git.mygroup.net == atc.mygroup.net
      Another idea would be to add a checkbox like "ignore hostname, compare project/repo only".

      The plugin should consider this alternatives - and perform the comparison accordingly.

        Attachments

          Issue Links

            Activity

            torstenreinhard Torsten Reinhard created issue -
            torstenreinhard Torsten Reinhard made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-54272 [ JENKINS-54272 ]
            torstenreinhard Torsten Reinhard made changes -
            Description +Bitbucket is not triggering matching jobs.+

            The log statements in Jenkins are showing
            {code:java}
            ...
            Considering candidate job xx-freestyle-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-freestyle-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git&lt;--&gt;https://atc.mygroup.net/scopecom/ci-test
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-freestyle-triggered-by-bitbucket SCM doesnt match remote repo {1}
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering candidate job xx-pipeline-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-pipeline-triggered-by-bitbucket
            ...
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git&lt;--&gt;https://atc.mygroup.net/scopecom/ci-test
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-pipeline-triggered-by-bitbucket SCM doesnt match remote repo {1}
            ...{code}
            I´ve already merged https://github.com/jenkinsci/bitbucket-plugin/pull/59 - but I still have an issue caused by different hostnames.
            In our setup we have
            ssh://git.mygroup.net:7999/../project/repo.git and
            https://atc.mygroup.net/....project/repo.git

            The final check is comparing the hostname(s) - and the project/repo paths.
            I dont know why they decided for different hostnames for the same thing - but I need an "official" solution to be able to use this plugin.
            One idea could be to add some global configuration, where hostname equivilents may be defined (in a map for example)
            So I would add there
            git.mygroup.net == atc.mygroup.net - and the plugin will consider this alternativeNames.
            +Bitbucket is not triggering matching jobs.+

            The log statements in Jenkins are showing this after pushing to ci-test.git Repo:
            {code:java}
            ...
            Considering candidate job xx-freestyle-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-freestyle-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git&lt;--&gt;https://atc.mygroup.net/scopecom/ci-test
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-freestyle-triggered-by-bitbucket SCM doesnt match remote repo {1}
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering candidate job xx-pipeline-triggered-by-bitbucket
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeConsidering to poke xx-pipeline-triggered-by-bitbucket
            ...
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProberepo scheme: ssh
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbeTrying to match ssh://git@git.mygroup.net:7999/scopecom/ci-test.git&lt;--&gt;https://atc.mygroup.net/scopecom/ci-test
            Sep 19, 2019 11:31:49 AM FINE com.cloudbees.jenkins.plugins.BitbucketJobProbexx-pipeline-triggered-by-bitbucket SCM doesnt match remote repo {1}
            ...{code}
            I´ve already merged https://github.com/jenkinsci/bitbucket-plugin/pull/59 - but I still have an issue caused by different hostnames.

            In our setup we have
            * ssh://git.mygroup.net:7999/../project/repo.git and
            * https://atc.mygroup.net/....project/repo.git

            The final check is comparing the hostname(s) - and the project/repo paths.

            I dont know why the Bitbucket team decided for different hostnames for the same thing - but I need an "official" solution to be able to use this plugin.
            One idea could be to add some global configuration, where hostname equivilents may be defined (in a map for example)
            So I would add there
            git.mygroup.net == atc.mygroup.net
            Another idea would be to add a checkbox like "ignore hostname, compare project/repo only".

            The plugin should consider this alternatives - and perform the comparison accordingly.
            tzach_solomon Tzach Solomon made changes -
            Released As https://plugins.jenkins.io/bitbucket/
            Assignee Tzach Solomon [ tzach_solomon ]
            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:
              torstenreinhard Torsten Reinhard
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: