Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-61119

Cannot configure Bitbucket ForkPullRequestDiscoveryTrait by using Job DSL dynamic API

    Details

    • Similar Issues:

      Description

      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
      

        Attachments

          Issue Links

            Activity

            Hide
            jansohn Robin Jansohn added a comment -

            I'll second this request. Something is still broken...

            Show
            jansohn Robin Jansohn added a comment - I'll second this request. Something is still broken...
            Hide
            casz Joseph Petersen (old) added a comment -

            is blocked by JENKINS-26535

            Show
            casz Joseph Petersen (old) added a comment - is blocked by JENKINS-26535
            Hide
            daniel_steiert Daniel Steiert added a comment - - edited

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

            Show
            daniel_steiert Daniel Steiert added a comment - - edited Joseph Petersen (old) , I updated the link to reflect that fact. The linking was saying this ticket blocks JENKINS-26535 , which is not the way it should be I guess, correct?
            Hide
            daniel_steiert Daniel Steiert added a comment -

            We have the same problem. Where is the bump button?

            Show
            daniel_steiert Daniel Steiert added a comment - We have the same problem. Where is the bump button?

              People

              • Assignee:
                daspilker Daniel Spilker
                Reporter:
                robin_smith Robin Smith
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: