[JIRA] (JENKINS-61119) Cannot configure Bitbucket ForkPullRequestDiscoveryTrait by using Job DSL dynamic API

4 views
Skip to first unread message

robin.smith@forgerock.com (JIRA)

unread,
Feb 18, 2020, 4:28:03 AM2/18/20
to jenkinsc...@googlegroups.com
Robin Smith created an issue
 
Jenkins / Bug JENKINS-61119
Cannot configure Bitbucket ForkPullRequestDiscoveryTrait by using Job DSL dynamic API
Issue Type: Bug Bug
Assignee: Daniel Spilker
Components: bitbucket-branch-source-plugin, job-dsl-plugin
Created: 2020-02-18 09:27
Environment: Jenkins 2.176.1
Job DSL 1.76
Bitbucket Branch Source 2.7.0
Priority: Major Major
Reporter: Robin Smith

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
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

snoopi30@web.de (JIRA)

unread,
Feb 26, 2020, 7:42:04 AM2/26/20
to jenkinsc...@googlegroups.com

josephp90@gmail.com (JIRA)

unread,
Feb 26, 2020, 9:25:06 AM2/26/20
to jenkinsc...@googlegroups.com

daniel.steiert@mail.de (JIRA)

unread,
Mar 4, 2020, 7:08:02 AM3/4/20
to jenkinsc...@googlegroups.com

Joseph Petersen, I updated the link to reflect that fact. The linking was saying this ticket block JENKINS-26535, which is not the way it should be I guess, correct?

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

daniel.steiert@mail.de (JIRA)

unread,
Mar 4, 2020, 7:08:03 AM3/4/20
to jenkinsc...@googlegroups.com
Daniel Steiert edited a comment on Bug JENKINS-61119
[~casz], I updated the link to reflect that fact. The linking was saying this ticket block blocks JENKINS-26535, which is not the way it should be I guess, correct?

daniel.steiert@mail.de (JIRA)

unread,
Mar 4, 2020, 7:14:02 AM3/4/20
to jenkinsc...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages