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

Cannot discover all GitHub repos and their branches with Job DSL anymore

    Details

    • Similar Issues:

      Description

      Using the job DSL plugin v. 1.64, I can't automatically discover all my repositories and all it's branches within my GitHub organization folder.

      I used the job DSL plugin v. 1.61 before.

       

      organizationFolder('myOrg') {
        triggers {
          periodic(10)
        }
        organizations {
          github {
            apiUri("")
            repoOwner("myOrg")
            scanCredentialsId("github")
            checkoutCredentialsId("github")
          }
        }
      }

       

      This is the configuration view after executing the above script


      scanCredentialsId("") and checkoutCredentialsId("") are now deprecated and replaced by credentialsId("github"). Now, the credentials work. But discovering all repositories and their branches doesn't seem to be possible anymore because the "includes", "excludes" methods also have been deprecated.
      Now, with the following, fixed script, I don't get all the branches anymore:

       

      organizationFolder('myOrg') {
        triggers {
          periodic(10)
        }
        organizations {
          github {
            repoOwner("myOrg")
            credentialsId("github")
          }
        }
      }

       

      This is the configuration page after executing the new script:

      I now manually need to add the checkout behaviour "Discover branches -> All branches"

      How can I automatically discover all repos and their branches using the DSL script?

      I also tried the "fromSource" syntax as this one seems to have more options.

       

      organizationFolder('myOrg') {
        triggers {
          periodic(10)
        }
        organizations {
          fromSource {
            name("myOrg")
            sources {
              github {
                credentialsId("github")
                repoOwner("myOrg")
                repository("")
              }
            }
          }
        }
      }
      

       

      As you can see, I have tried to leave the string in the repository("") method empty, hoping that would cause it to discover all repos within my organization. I also tried asterisk: repository("*") which also led to an error.

        Attachments

          Issue Links

            Activity

            spiderfox Christian H created issue -
            spiderfox Christian H made changes -
            Field Original Value New Value
            Description Using the job DSL plugin v. 1.64, I can't automatically discover all my repositories and all it's branches within my GitHub organization folder.
            I used the job DSL plugin v. 1.61 before.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  apiUri("")
                  repoOwner("myOrg")
                  scanCredentialsId("github")
                  checkoutCredentialsId("github")
                }
              }
            }{code}
             

            This is the configuration view after executing the above script

            !image-2017-08-15-13-25-53-698.png!
            scanCredentialsId("") and checkoutCredentialsId("") are now deprecated and replaced by credentialsId("github"). Now, the credentials work. But discovering all repositories and their branches doesn't seem to be possible anymore because the "includes", "excludes" methods also have been deprecated.
            Now, with the following, fixed script, I don't get all the branches anymore:

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  repoOwner("myOrg")
                  credentialsId("github")
                }
              }
            }{code}
             

            This is the configuration page after executing the new script:

            !image-2017-08-15-13-29-22-823.png!

            I now manually need to add the checkout behaviour "Discover branches -> All branches"

             

            !image-2017-08-15-13-30-44-079.png!

            How can I automatically discover all repos and their branches using the DSL script?


            I also tried the "fromSource" syntax as this one seems to have more options.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                fromSource {
                  name("myOrg")
                  sources {
                    github {
                      credentialsId("github")
                      repoOwner("myOrg")
                      repository("")
                    }
                  }
                }
              }
            }
            {code}
             

            As you can see, I have tried to leave the string in the repository("") method empty, hoping that would cause it to discover all repos within my organization. I also tried asterisk: repository("*") which also led to an error.
            Using the job DSL plugin v. 1.64, I can't automatically discover all my repositories and all it's branches within my GitHub organization folder.

            I used the job DSL plugin v. 1.61 before.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  apiUri("")
                  repoOwner("myOrg")
                  scanCredentialsId("github")
                  checkoutCredentialsId("github")
                }
              }
            }{code}
             

            This is the configuration view after executing the above script

            !image-2017-08-15-13-25-53-698.png!
             scanCredentialsId("") and checkoutCredentialsId("") are now deprecated and replaced by credentialsId("github"). Now, the credentials work. But discovering all repositories and their branches doesn't seem to be possible anymore because the "includes", "excludes" methods also have been deprecated.
             Now, with the following, fixed script, I don't get all the branches anymore:

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  repoOwner("myOrg")
                  credentialsId("github")
                }
              }
            }{code}
             

            This is the configuration page after executing the new script:

            !image-2017-08-15-13-29-22-823.png!

            I now manually need to add the checkout behaviour "Discover branches -> All branches"

             

            !image-2017-08-15-13-30-44-079.png!

            How can I automatically discover all repos and their branches using the DSL script?

            I also tried the "fromSource" syntax as this one seems to have more options.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                fromSource {
                  name("myOrg")
                  sources {
                    github {
                      credentialsId("github")
                      repoOwner("myOrg")
                      repository("")
                    }
                  }
                }
              }
            }
            {code}
             

            As you can see, I have tried to leave the string in the repository("") method empty, hoping that would cause it to discover all repos within my organization. I also tried asterisk: repository("*") which also led to an error.
            spiderfox Christian H made changes -
            Attachment image-2017-08-15-13-39-11-179.png [ 39281 ]
            spiderfox Christian H made changes -
            Attachment image-2017-08-15-13-40-17-137.png [ 39282 ]
            spiderfox Christian H made changes -
            Description Using the job DSL plugin v. 1.64, I can't automatically discover all my repositories and all it's branches within my GitHub organization folder.

            I used the job DSL plugin v. 1.61 before.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  apiUri("")
                  repoOwner("myOrg")
                  scanCredentialsId("github")
                  checkoutCredentialsId("github")
                }
              }
            }{code}
             

            This is the configuration view after executing the above script

            !image-2017-08-15-13-25-53-698.png!
             scanCredentialsId("") and checkoutCredentialsId("") are now deprecated and replaced by credentialsId("github"). Now, the credentials work. But discovering all repositories and their branches doesn't seem to be possible anymore because the "includes", "excludes" methods also have been deprecated.
             Now, with the following, fixed script, I don't get all the branches anymore:

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  repoOwner("myOrg")
                  credentialsId("github")
                }
              }
            }{code}
             

            This is the configuration page after executing the new script:

            !image-2017-08-15-13-29-22-823.png!

            I now manually need to add the checkout behaviour "Discover branches -> All branches"

             

            !image-2017-08-15-13-30-44-079.png!

            How can I automatically discover all repos and their branches using the DSL script?

            I also tried the "fromSource" syntax as this one seems to have more options.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                fromSource {
                  name("myOrg")
                  sources {
                    github {
                      credentialsId("github")
                      repoOwner("myOrg")
                      repository("")
                    }
                  }
                }
              }
            }
            {code}
             

            As you can see, I have tried to leave the string in the repository("") method empty, hoping that would cause it to discover all repos within my organization. I also tried asterisk: repository("*") which also led to an error.
            Using the job DSL plugin v. 1.64, I can't automatically discover all my repositories and all it's branches within my GitHub organization folder.

            I used the job DSL plugin v. 1.61 before.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  apiUri("")
                  repoOwner("myOrg")
                  scanCredentialsId("github")
                  checkoutCredentialsId("github")
                }
              }
            }{code}
             

            This is the configuration view after executing the above script

            !image-2017-08-15-13-25-53-698.png!
             scanCredentialsId("") and checkoutCredentialsId("") are now deprecated and replaced by credentialsId("github"). Now, the credentials work. But discovering all repositories and their branches doesn't seem to be possible anymore because the "includes", "excludes" methods also have been deprecated.
             Now, with the following, fixed script, I don't get all the branches anymore:

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                github {
                  repoOwner("myOrg")
                  credentialsId("github")
                }
              }
            }{code}
             

            This is the configuration page after executing the new script:

            !image-2017-08-15-13-40-17-137.png!

            I now manually need to add the checkout behaviour "Discover branches -> All branches"

            !image-2017-08-15-13-39-11-179.png!

            !image-2017-08-15-13-30-44-079.png!

            How can I automatically discover all repos and their branches using the DSL script?

            I also tried the "fromSource" syntax as this one seems to have more options.

             
            {code:java}
            organizationFolder('myOrg') {
              triggers {
                periodic(10)
              }
              organizations {
                fromSource {
                  name("myOrg")
                  sources {
                    github {
                      credentialsId("github")
                      repoOwner("myOrg")
                      repository("")
                    }
                  }
                }
              }
            }
            {code}
             

            As you can see, I have tried to leave the string in the repository("") method empty, hoping that would cause it to discover all repos within my organization. I also tried asterisk: repository("*") which also led to an error.
            stephenking Steffen Gebert made changes -
            Component/s job-dsl-plugin [ 16720 ]
            stephenking Steffen Gebert made changes -
            Link This issue is related to JENKINS-45860 [ JENKINS-45860 ]
            stephenking Steffen Gebert made changes -
            Link This issue is related to JENKINS-45688 [ JENKINS-45688 ]
            daspilker Daniel Spilker made changes -
            Link This issue is blocked by JENKINS-26535 [ JENKINS-26535 ]
            stephenking Steffen Gebert made changes -
            Attachment multibranch-config-manual.xml [ 39477 ]
            daspilker Daniel Spilker made changes -
            Component/s git-client-plugin [ 17423 ]
            Component/s structs-plugin [ 21442 ]
            jglick Jesse Glick made changes -
            Component/s git-plugin [ 15543 ]
            Component/s git-client-plugin [ 17423 ]
            Component/s job-dsl-plugin [ 16720 ]
            Component/s structs-plugin [ 21442 ]
            jglick Jesse Glick made changes -
            Labels regression
            stephenconnolly Stephen Connolly made changes -
            Link This issue duplicates JENKINS-45504 [ JENKINS-45504 ]
            stephenconnolly Stephen Connolly made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Resolution Duplicate [ 3 ]
            cliffmeyers Cliff Meyers made changes -
            Link This issue relates to JENKINS-47752 [ JENKINS-47752 ]
            cliffmeyers Cliff Meyers made changes -
            Link This issue relates to JENKINS-47752 [ JENKINS-47752 ]

              People

              • Assignee:
                Unassigned
                Reporter:
                spiderfox Christian H
              • Votes:
                1 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: