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

Automatically Scan Bitbucket Server Project for Repositories

      Hi,

      this plugin creates reliable Webhooks in the repositories hosted in a Bitbucket Server Instance, but one has to manually create at least a multibranch project for this to work. However, it would be nice, if there were an option for an automatic scan for each Repo in a Project, like in the old Plugin from CloudBee (which does not create a Webhook reliable (only like once in ~40 retrys) and also searches a new Maintainer, so I wouldn't bet on this horse anymore).

          [JENKINS-61431] Automatically Scan Bitbucket Server Project for Repositories

          Matthias Detsch created issue -

          Paul Schubert added a comment -

          +1

          This would be a major feature for us and probably many others. We are currently using https://github.com/jenkinsci/bitbucket-branch-source-plugin which has some bugs and is, as stated by Matthias, up for adoption, so we would like to switch to the official plugin by Atlassian. The only feature blocking us right now is this one, scanning Bitbucket-Projects for repositories with Jenkinsfiles and creating Jenkins multi branch pipeline projects for them (like it does now already, but currently only for one specific repo).

          Paul Schubert added a comment - +1 This would be a major feature for us and probably many others. We are currently using https://github.com/jenkinsci/bitbucket-branch-source-plugin which has some bugs and is, as stated by Matthias, up for adoption, so we would like to switch to the official plugin by Atlassian. The only feature blocking us right now is this one, scanning Bitbucket-Projects for repositories with Jenkinsfiles and creating Jenkins multi branch pipeline projects for them (like it does now already, but currently only for one specific repo).

          +1

          Padraig Lennon added a comment - +1
          Paul Schubert made changes -
          Link New: This issue is duplicated by JENKINS-62462 [ JENKINS-62462 ]

          Martin Karing added a comment -

          +1

          Martin Karing added a comment - +1
          Martin Henschke made changes -
          Labels Original: configuration pipeline plugin plugins user-experience New: configuration pipeline plugin plugins tracked-by-atlassian user-experience

          +1

          I currently have something like when the using the bitbucket-branch-source plugin to create multi-branch for all repos in FOO Bitbucket project. Being able to replicate that with the atlassian-bitbucket-server-integration-plugin would be great.

          organizations {
           bitbucket {
             serverUrl("https://bitbucket.example.com:8443")
             repoOwner("FOO")
             credentialsId("bitbucket_password_credential")
             traits {
               bitbucketBranchDiscovery{strategyId(0)}
               bitbucketPullRequestDiscovery{ strategyId(1)}
             }
           }
          }
          
          buildStrategies {
           buildRegularBranches()
           buildChangeRequests{ ignoreTargetOnlyChanges(false) ignoreUntrustedChanges(false) } }
          
          projectFactories {
           workflowMultiBranchProjectFactory{ scriptPath 'Jenkinsfile' scriptPath 'debian/Jenkinsfile' }
          }
          
          triggers { periodicFolderTrigger{ interval('5m') } }
          orphanedItemStrategy { discardOldItems { } }
          
          }
          
          

          Nicholas Brown added a comment - I currently have something like when the using the bitbucket-branch-source plugin to create multi-branch for all repos in FOO Bitbucket project. Being able to replicate that with the atlassian-bitbucket-server-integration-plugin would be great. organizations { bitbucket { serverUrl( "https: //bitbucket.example.com:8443" ) repoOwner( "FOO" ) credentialsId( "bitbucket_password_credential" ) traits { bitbucketBranchDiscovery{strategyId(0)} bitbucketPullRequestDiscovery{ strategyId(1)} } } } buildStrategies { buildRegularBranches() buildChangeRequests{ ignoreTargetOnlyChanges( false ) ignoreUntrustedChanges( false ) } } projectFactories { workflowMultiBranchProjectFactory{ scriptPath 'Jenkinsfile' scriptPath 'debian/Jenkinsfile' } } triggers { periodicFolderTrigger{ interval( '5m' ) } } orphanedItemStrategy { discardOldItems { } } }
          Martin Henschke made changes -
          Assignee New: Martin Henschke [ mhenschke_atlassian ]

          Martin Henschke added a comment - - edited

          Hi Matthias, and everyone who has commented on this issue- thank you for your input and suggestions! We are investigating an implementation of this at the moment.
          For now, we are still exploring what a technical design would look like, but we have a number of questions about the kind of configuration options you will need on such a project. Specifically:

          • Do you store your Jenkinsfile in a consistent location for every repository in a project? Would you expect the plugin to be able to "find" your Jenkinsfile anywhere in the project, or would the restriction of a consistent path be appropriate?
          • When scanning a project, would you want every repository with a Jenkinsfile to be matched, or just a subset? If so, what kind of criteria would you want to include/exclude repositories?
          • What config do you want to be automatically set on each project? How much would need to be individualized for each project?
          • Do you rely on many other plugins, apart from the Bitbucket Jenkins Integration plugin in your multibranch projects? If so, do you need/expect this configuration to be carried over to child projects? Which plugins do you use?
          • And more generally, would you be using this as a migration tool (so you can quickly generate a lot of Jenkinsfiles), for automatically handling job creation on an ongoing basis, or both?

          If you have time to answer these questions, it would be a great help. You can leave comments on this ticket, or by email. Thank you again!

          Martin Henschke added a comment - - edited Hi Matthias, and everyone who has commented on this issue- thank you for your input and suggestions! We are investigating an implementation of this at the moment. For now, we are still exploring what a technical design would look like, but we have a number of questions about the kind of configuration options you will need on such a project. Specifically: Do you store your Jenkinsfile in a consistent location for every repository in a project? Would you expect the plugin to be able to "find" your Jenkinsfile anywhere in the project, or would the restriction of a consistent path be appropriate? When scanning a project, would you want every repository with a Jenkinsfile to be matched, or just a subset? If so, what kind of criteria would you want to include/exclude repositories? What config do you want to be automatically set on each project? How much would need to be individualized for each project? Do you rely on many other plugins, apart from the Bitbucket Jenkins Integration plugin in your multibranch projects? If so, do you need/expect this configuration to be carried over to child projects? Which plugins do you use? And more generally, would you be using this as a migration tool (so you can quickly generate a lot of Jenkinsfiles), for automatically handling job creation on an ongoing basis, or both? If you have time to answer these questions, it would be a great help. You can leave comments on this ticket, or by email. Thank you again!

            mhenschke_atlassian Martin Henschke
            garionion Matthias Detsch
            Votes:
            28 Vote for this issue
            Watchers:
            35 Start watching this issue

              Created:
              Updated: