Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Duplicate
-
Component/s: bitbucket-branch-source-plugin, job-dsl-plugin
-
Labels:None
-
Environment:Jenkins 2.92, bitbucket-branch 2.2.7, cloudbees-folder 6.2.1, job-dsl 1.66
-
Similar Issues:
Description
Same as JENKINS-48336 and JENKINS-48337, traits is not implemented to be used with DSL.
Workaround is to use configure blocks:
configure { organizationFolder -> organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.BranchDiscoveryTrait'{ strategyId('3') } } configure { organizationFolder -> organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.OriginPullRequestDiscoveryTrait'{ strategyId('2') } } configure { organizationFolder -> organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait'{ strategyId('2') } } configure { organizationFolder -> organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.SSHCheckoutTrait'{ credentialsId('my_id') } } configure { organizationFolder -> organizationFolder / navigators / 'com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMNavigator' / traits << 'com.cloudbees.jenkins.plugins.bitbucket.WebhookRegistrationTrait'{ mode('DISABLE') } }
Attachments
Issue Links
- duplicates
-
JENKINS-45860 Support traits for ScmNavigators
-
- Closed
-
There's more traits missing: ForkPullRequestDiscoveryTrait, BranchDiscoveryTrait, and probably more. I could not figure out why some traits show up in the API explorer while others do not. Otherwise, I'd be happy to prepare a pull request.