-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
Jenkins 2.176.1
Job DSL 1.76
Bitbucket Branch Source 2.7.0
Bitbucket Branch Source plugin has introduced unique symbols, so we are able to configure traits by using Job DSL dynamic API instead of configure block. Unfortunately, ForkPullRequestDiscoveryTrait (bitbucketForkDiscovery) is unavailable. For now the only possible option is to still use configure block:
branchSources { branchSource { source { bitbucket { bitbucketServerUrl('https://stash.server.org') credentialsId('bitbucket-credentials') repoOwner('TEST') repository('test-repo') traits { bitbucketBranchDiscovery { strategyId(1) } bitbucketPullRequestDiscovery { strategyId(2) } } } } } } } configure { def traits = it / sources / data / 'jenkins.branch.BranchSource' / source / traits traits << 'com.cloudbees.jenkins.plugins.bitbucket.ForkPullRequestDiscoveryTrait' { strategyId(2) } }
List of available traits in Job DSL Dynamic API Viewer:
- bitbucketBranchDiscovery
- bitbucketPublicRepoPullRequestFilter
- bitbucketPullRequestDiscovery
- bitbucketSshCheckout
- bitbucketTagDiscovery
- bitbucketWebhookConfiguration
- bitbucketWebhookRegistration
Missing:
- bitbucketForkDiscovery ← missing, but possible to execute
- bitbucketTrustNobody
- bitbucketTrustTeam
- bitbucketTrustProject
- bitbucketTrustEveryone
I tried:
1)
bitbucketForkDiscovery {
strategyId(2)
trust('bitbucketTrustTeam')
}
groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.trust() is applicable for argument types: (java.lang.String) values: [bitbucketTrustTeam] Possible solutions: print(java.lang.Object), use([Ljava.lang.Object;), getAt(java.lang.String), print(java.io.PrintWriter), wait(), dump()
2)
bitbucketForkDiscovery { strategyId(2) trust(bitbucketTrustTeam) }
groovy.lang.MissingPropertyException: No such property: bitbucketTrustTeam for class: javaposse.jobdsl.plugin.structs.DescribableContext
3)
bitbucketForkDiscovery { strategyId(2) trust(bitbucketTrustTeam()) }
groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.bitbucketTrustTeam() is applicable for argument types: () values: []
4)
bitbucketForkDiscovery { strategyId(2) trust { bitbucketTrustTeam() } }
groovy.lang.MissingMethodException: No signature of method: javaposse.jobdsl.plugin.structs.DescribableContext.trust() is applicable for argument types: (script$_run_closure1$_closure3$_closure8$_closure9$_closure10$_closure11$_closure14$_closure16) values: [script$_run_closure1$_closure3$_closure8$_closure9$_closure10$_closure11$_closure14$_closure16@6abb68ce] Possible solutions: print(java.lang.Object), use([Ljava.lang.Object;), print(java.io.PrintWriter), wait(), dump(), grep()
5)
bitbucketForkDiscovery { strategyId(2) }
javaposse.jobdsl.dsl.DslScriptException: (script, line 30) the following options are required and must be specified: trust
- is blocked by
-
JENKINS-26535 DescribableHelper does not handle wildcards well
-
- Open
-
- is related to
-
JENKINS-60874 Cannot configure ForkPullRequestDiscoveryTrait by using Job DSL dynamic API
-
- Resolved
-
- links to
[JENKINS-61119] Cannot configure Bitbucket ForkPullRequestDiscoveryTrait by using Job DSL dynamic API
Link |
New:
This issue is related to |
Link | New: This issue blocks JENKINS-26535 [ JENKINS-26535 ] |
Link | New: This issue is blocked by JENKINS-26535 [ JENKINS-26535 ] |
Link | Original: This issue blocks JENKINS-26535 [ JENKINS-26535 ] |
Assignee | Original: Daniel Spilker [ daspilker ] | New: Jamie Tanna [ jamietanna ] |
Remote Link | New: This issue links to "PR-738 (Web Link)" [ 28803 ] |