Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group repositories under project folders? #733

Open
bc-ble opened this issue Jul 5, 2023 · 2 comments
Open

Group repositories under project folders? #733

bc-ble opened this issue Jul 5, 2023 · 2 comments

Comments

@bc-ble
Copy link

bc-ble commented Jul 5, 2023

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

@bc-ble bc-ble added the bug label Jul 5, 2023
@Fragnite-hub
Copy link

can i take up the issue ?

@nfalco79
Copy link
Member

nfalco79 commented Dec 8, 2024

This is not a bug but how the plugin works. Projects are not taken into account. Bitbucket use them to group repositories and only recently has add functionality to facilitate apply common settings.

@nfalco79 nfalco79 removed the bug label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants