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

Multibranch pipeline with SCM browser does not have SCM links

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • Jenkins 2.8
      Ubuntu Server 14.04

      Multibranch pipeline jobs do not have links to SCM commits and diffs (multibranch-scm-nolinks.png) even if the corresponding SCM browser is configured like the following

      def teamName = 'team'
      def repoName = 'repo'
      
      stage 'Checkout'
      checkout([
          $class: 'GitSCM',
          branches: [[name: env.BRANCH_NAME]],
          browser: [
              $class: 'BitbucketWeb',
              repoUrl: "https://bitbucket.org/${teamName}/${repoName}.git"
          ],
          doGenerateSubmoduleConfigurations: false,
          extensions: [[$class: 'CleanBeforeCheckout']],
          submoduleCfg: [],
          userRemoteConfigs: [[
              credentialsId: 'jenkins_bitbucket_ssh',
              name: 'origin',
              url: "git@bitbucket.org:${teamName}/${repoName}.git"
          ]]
      ])
      

      ... although ordinary jobs do have (multibranch-scm-links.png)

          [JENKINS-35483] Multibranch pipeline with SCM browser does not have SCM links

          Jesse Glick added a comment -

          Not sure about the root cause here, but anyway from a multibranch Pipeline job you should use simply checkout scm. Configuration of extensions etc. should be done on the branch source, not in the script.

          Jesse Glick added a comment - Not sure about the root cause here, but anyway from a multibranch Pipeline job you should use simply checkout scm . Configuration of extensions etc. should be done on the branch source, not in the script.

          ... anyway from a multibranch Pipeline job you should use simply checkout scm

          jglick, could you please clarify a bit, how to specify custom extensions in that case, i.e.

          browser: [
              $class: 'BitbucketWeb',
              repoUrl: "https://bitbucket.org/${teamName}/${repoName}"
          ],
          extensions: scm.extensions + [
              [$class: 'CleanBeforeCheckout'],
              [$class: 'LocalBranch'],
              [$class: 'PruneStaleBranch']
          ],
          

          I've not managed to find out how to do it with just checkout scm.

          Sergey Zhemzhitsky added a comment - ... anyway from a multibranch Pipeline job you should use simply checkout scm jglick , could you please clarify a bit, how to specify custom extensions in that case, i.e. browser: [ $class: 'BitbucketWeb', repoUrl: "https://bitbucket.org/${teamName}/${repoName}" ], extensions: scm.extensions + [ [$class: 'CleanBeforeCheckout'], [$class: 'LocalBranch'], [$class: 'PruneStaleBranch'] ], I've not managed to find out how to do it with just checkout scm .

          Jesse Glick added a comment -

          Extensions may be specified in the branch source, though not yet for GitHub (already filed separately).

          Jesse Glick added a comment - Extensions may be specified in the branch source, though not yet for GitHub (already filed separately).

          Is there an example of this for subversion? I can get the Fisheye to work fine if I set it up in the checkout step, but then I end up with two identical commits in the summary page with only one of the two commits having the link. If I set changelog: flase, it gets rid of the second reported commit, but then I lose the Fisheye link. Seems like there needs to be a way to specify the browser in the multibranch setup page.

          Provides a link but shows up as a second identical commit:

          checkout(changelog: false, scm: [$class: 'SubversionSCM',
          					locations: [scm.locations[0].withLocal("${base_path}/fw")],
          					workspaceUpdater: scmUpdater,
          					browser: [$class: 'FishEyeSVN', rootModule: '?cs=${svnrev}',
          						url: 'https://fisheye.mycompany.com/browse/this_project/'],
          					excludedRegions: scm.excludedRegions,
          					excludedUsers: scm.excludedUsers,
          					excludedRevprop: scm.excludedRevprop,
          					excludedCommitMessages: scm.excludedCommitMessages,
          					includedRegions: scm.includedRegions,
          					ignoreDirPropChanges: scm.ignoreDirPropChanges,
          					filterChangelog: scm.filterChangelog,
          					additionalCredentials: scm.additionalCredentials])
          

          Steve Hanawalt added a comment - Is there an example of this for subversion? I can get the Fisheye to work fine if I set it up in the checkout step, but then I end up with two identical commits in the summary page with only one of the two commits having the link. If I set changelog: flase, it gets rid of the second reported commit, but then I lose the Fisheye link. Seems like there needs to be a way to specify the browser in the multibranch setup page. Provides a link but shows up as a second identical commit: checkout(changelog: false , scm: [$class: 'SubversionSCM' , locations: [scm.locations[0].withLocal( "${base_path}/fw" )], workspaceUpdater: scmUpdater, browser: [$class: 'FishEyeSVN' , rootModule: '?cs=${svnrev}' , url: 'https: //fisheye.mycompany.com/browse/this_project/' ], excludedRegions: scm.excludedRegions, excludedUsers: scm.excludedUsers, excludedRevprop: scm.excludedRevprop, excludedCommitMessages: scm.excludedCommitMessages, includedRegions: scm.includedRegions, ignoreDirPropChanges: scm.ignoreDirPropChanges, filterChangelog: scm.filterChangelog, additionalCredentials: scm.additionalCredentials])

          Extensions may be specified in the branch source, though not yet for GitHub (already filed separately).

          And not yet for Subversion either.

          Lionel Orellana added a comment - Extensions may be specified in the branch source, though not yet for GitHub (already filed separately). And not yet for Subversion either.

            Unassigned Unassigned
            szhem Sergey Zhemzhitsky
            Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: