jenkinsci/bitbucket-branch-source-plugin

Group repositories under project folders?

Opened this issue · 1 comments

bc-ble commented

Jenkins and plugins versions report

Environment
Jenkins 2.401.2

Our script console is disabled so this is the list of plugins we are additionally installing.

Non-Standard Plugins:
ansicolor
antisamy-markup-formatter
artifact-manager-s3
audit-trail
authorize-project
aws-secrets-manager-secret-source
cloudbees-bitbucket-branch-source
configuration-as-code
ec2-fleet
git
jersey2-api
jira
jobConfigHistory
job-dsl
kubernetes
kubernetes-cli
ldap
matrix-auth
p4
pipeline-aws
saml
slack
timestamper
workflow-aggregator
workflow-multibranch

What Operating System are you using (both controller, and any agents involved in the problem)?

Jenkins controller running in EKS using the jenkins/jenkins:lts-jdk11 from Docker Hub.

Reproduction steps

I'm using the below DSL with Jenkins configuration as code to generate an organization folder connected to our Bitbucket workspace. It's able to connect and discover all of the repos containing Jenkinsfiles as expected.

However, it creates a flat list of repos instead of nesting them under project folders.
Via the code as well as all of the examples I've found I'm not sure if this is a bug, something I'm missing, or simply a feature that doesn't exist.

organizationFolder('MyDepartment/Bitbucket') {
    displayName('Bitbucket')
    organizations {
        bitbucket {
            serverUrl('https://bitbucket.org')
            repoOwner('my_workspace_name')
            credentialsId('bitbucket')
            traits {
                webhookRegistrationTrait {
                    mode('ITEM')
                }
            }
        }
    }

    configure { node ->
        def traits = node / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits
        traits << 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait' {
            strategyId('3')
        }
        traits << 'com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait' {
            strategyId('1')
        }
        traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' {
            strategyId('1')
            trustID('2')
        }
    }
    properties {
        suppressFolderAutomaticTriggering {
            branches('.*')
            strategy('INDEXING')
        }
    }
    projectFactories {
        workflowMultiBranchProjectFactory {
            scriptPath 'Jenkinsfile'
        }
    }
    orphanedItemStrategy {
        discardOldItems {
            daysToKeep(90)
            numToKeep(0)
        }
    }
    configure { node ->
        node / triggers / 'com.cloudbees.hudson.plugins.folder.computed.PeriodicFolderTrigger' {
            spec('H H/4 * * *')
            interval(86400000)
        }
    }
}

Expected Results

I expected that repositories would be nested under their respective project folders.

Example:

Bitbucket/
├── ProjectA
│   ├── bar
│   └── foo
└── ProjectB
    └── baz

Actual Results

All repositories are under the root of the organization folder and none of the projects are listed

Bitbucket/
├── bar
├── baz
└── foo

Anything else?

No response

can i take up the issue ?