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

Additions to Github APIs for Organizations and Repositories

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • blueocean-plugin
    • None
    • pannonian, iapetus

      I would like to request two additions to the Github APIs.

      When listing organizations via /jenkins/scm/github/organizations/?credentialId=github the response is currently:

      [{
          "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
          "_links": {
              "repositories": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/repositories/"
              },
              "self": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/"
              }
          },
          "avatar": "https://avatars.githubusercontent.com/u/107424?v=3&s=50",
          "jenkinsOrganizationPipeline": false,
          "name": "jenkinsci"
      }, {
          "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubUserOrganization",
          "_links": {
              "repositories": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
              },
              "self": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/"
              }
          },
          "avatar": "https://avatars.githubusercontent.com/u/143466?v=3&s=50",
          "jenkinsOrganizationPipeline": true,
          "name": "cliffmeyers"
      }, {
          "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
          "_links": {
              "repositories": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/cloudbees/repositories/"
              },
              "self": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/cloudbees/"
              }
          },
          "avatar": "https://avatars.githubusercontent.com/u/235526?v=3&s=50",
          "jenkinsOrganizationPipeline": false,
          "name": "cloudbees"
      }]
      

      1. For organizations where jenkinsOrganizationPipeline is true, could we add an additional field that indicates whether "auto discover" is enabled? This is equivalent to a Github org folder that was created without specifying any repository names (i.e. empty "repoNames" array)

      2. For organizations where jenkinsOrganizationPipeline is true, could we also add a HAL link to the Jenkins org folder? This will make REST API update calls much easier.

      When listing repositories via /jenkins/scm/github/organizations/cliffmeyers/repositories/?credentialId=github&pageNumber=1&pageSize=100 the response is currently:

      {
          "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRespositoryContainer",
          "_links": {
              "self": {
                  "_class": "io.jenkins.blueocean.rest.hal.Link",
                  "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
              }
          },
          "repositories": {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepositories",
              "_links": {
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/"
                  }
              },
              "items": [{
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blog-examples/"
                      }
                  },
                  "defaultBranch": "master",
                  "description": "Sample code from stuff on my blog",
                  "name": "blog-examples",
                  "permissions": {
                      "admin": true,
                      "push": true,
                      "pull": true
                  },
                  "private": false,
                  "fullName": "cliffmeyers/blog-examples"
              }, {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blueocean-plugin/"
                      }
                  },
                  "defaultBranch": "master",
                  "description": "Blue Ocean UI app",
                  "name": "blueocean-plugin",
                  "permissions": {
                      "admin": true,
                      "push": true,
                      "pull": true
                  },
                  "private": false,
                  "fullName": "cliffmeyers/blueocean-plugin"
              }, {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/frontend-maven-plugin/"
                      }
                  },
                  "defaultBranch": "master",
                  "description": "\"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins.\" A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.",
                  "name": "frontend-maven-plugin",
                  "permissions": {
                      "admin": true,
                      "push": true,
                      "pull": true
                  },
                  "private": false,
                  "fullName": "cliffmeyers/frontend-maven-plugin"
              }, {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/java-utils/"
                      }
                  },
                  "defaultBranch": "master",
                  "description": "Utilities for Java",
                  "name": "java-utils",
                  "permissions": {
                      "admin": true,
                      "push": true,
                      "pull": true
                  },
                  "private": false,
                  "fullName": "cliffmeyers/java-utils"
              }],
              "lastPage": 3,
              "nextPage": 2,
              "pageSize": 4
          }
      }
      

      3. Could we add a field to the repository object that indicates whether a pipeline has already been created for it? This is important in the "update" scenario to avoid the user trying to create a repo that was already created.

          [JENKINS-41403] Additions to Github APIs for Organizations and Repositories

          Cliff Meyers created issue -

          Cliff Meyers added a comment -

          It would be nice to have this API sooner rather than later so I can spend some more time on these re-entrant flows. Thanks vivek!

          Cliff Meyers added a comment - It would be nice to have this API sooner rather than later so I can spend some more time on these re-entrant flows. Thanks vivek !
          Cliff Meyers made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          Cliff Meyers made changes -
          Sprint New: pannonian [ 211 ]
          Description Original:
          New: I would like to request two additions to the Github APIs.

          When listing organizations via {{/jenkins/scm/github/organizations/?credentialId=github}} the response is currently:

          {code}
          [{
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/107424?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "jenkinsci"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubUserOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/143466?v=3&s=50",
              "jenkinsOrganizationPipeline": true,
              "name": "cliffmeyers"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/235526?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "cloudbees"
          }]
          {code}

          For organizations where jenkinsOrganizationPipeline is {{true}}, could we add an additional field that indicates whether "auto discover" is enabled? This is equivalent to a Github org folder that was created without specifying any repository names (i.e. empty "repoNames" array)

          When listing repositories via {{/jenkins/scm/github/organizations/cliffmeyers/repositories/?credentialId=github&pageNumber=1&pageSize=100}} the response is currently:

          {code}
          {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRespositoryContainer",
              "_links": {
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  }
              },
              "repositories": {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepositories",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/"
                      }
                  },
                  "items": [{
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blog-examples/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Sample code from stuff on my blog",
                      "name": "blog-examples",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blog-examples"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blueocean-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Blue Ocean UI app",
                      "name": "blueocean-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blueocean-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/frontend-maven-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "\"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins.\" A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.",
                      "name": "frontend-maven-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/frontend-maven-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/java-utils/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Utilities for Java",
                      "name": "java-utils",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/java-utils"
                  }],
                  "lastPage": 3,
                  "nextPage": 2,
                  "pageSize": 4
              }
          }
          {code}

          Could we add a field to the repository object that indicates whether a pipeline has already been created for it? This is important in the "update" scenario to avoid the user trying to create a repo that was already created.

          Vivek Pandey added a comment -

          cliffmeyers

          > For organizations where jenkinsOrganizationPipeline is true, could we add an additional field that indicates whether "auto discover" is enabled?

          So auto-discover is false if in model there are no branch filtering specified? that is branch filter is empty then its auto-discover?

          > Could we add a field to the repository object that indicates whether a pipeline has already been created for it?

          yeah can be done, I guess you want it to be true if there is job for this repo inside this org folder

          Vivek Pandey added a comment - cliffmeyers > For organizations where jenkinsOrganizationPipeline is true, could we add an additional field that indicates whether "auto discover" is enabled? So auto-discover is false if in model there are no branch filtering specified? that is branch filter is empty then its auto-discover? > Could we add a field to the repository object that indicates whether a pipeline has already been created for it? yeah can be done, I guess you want it to be true if there is job for this repo inside this org folder

          Cliff Meyers added a comment - - edited

          > So auto-discover is false if in model there are no branch filtering specified? that is branch filter is empty then its auto-discover?

          What we call "auto discover" in the UI is the mode where there is no filtering of repositories. You said "branch filtering" but I think perhaps you mean "repository filtering"

          > yeah can be done, I guess you want it to be true if there is job for this repo inside this org folder

          Yes, that's exactly right.

          These fields will allow us to customize the UI appropriately when the user selects a Github organization that already has an org folder created in Jenkins.

          Cliff Meyers added a comment - - edited > So auto-discover is false if in model there are no branch filtering specified? that is branch filter is empty then its auto-discover? What we call "auto discover" in the UI is the mode where there is no filtering of repositories. You said "branch filtering" but I think perhaps you mean "repository filtering" > yeah can be done, I guess you want it to be true if there is job for this repo inside this org folder Yes, that's exactly right. These fields will allow us to customize the UI appropriately when the user selects a Github organization that already has an org folder created in Jenkins.
          Cliff Meyers made changes -
          Description Original: I would like to request two additions to the Github APIs.

          When listing organizations via {{/jenkins/scm/github/organizations/?credentialId=github}} the response is currently:

          {code}
          [{
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/107424?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "jenkinsci"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubUserOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/143466?v=3&s=50",
              "jenkinsOrganizationPipeline": true,
              "name": "cliffmeyers"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/235526?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "cloudbees"
          }]
          {code}

          For organizations where jenkinsOrganizationPipeline is {{true}}, could we add an additional field that indicates whether "auto discover" is enabled? This is equivalent to a Github org folder that was created without specifying any repository names (i.e. empty "repoNames" array)

          When listing repositories via {{/jenkins/scm/github/organizations/cliffmeyers/repositories/?credentialId=github&pageNumber=1&pageSize=100}} the response is currently:

          {code}
          {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRespositoryContainer",
              "_links": {
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  }
              },
              "repositories": {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepositories",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/"
                      }
                  },
                  "items": [{
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blog-examples/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Sample code from stuff on my blog",
                      "name": "blog-examples",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blog-examples"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blueocean-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Blue Ocean UI app",
                      "name": "blueocean-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blueocean-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/frontend-maven-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "\"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins.\" A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.",
                      "name": "frontend-maven-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/frontend-maven-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/java-utils/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Utilities for Java",
                      "name": "java-utils",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/java-utils"
                  }],
                  "lastPage": 3,
                  "nextPage": 2,
                  "pageSize": 4
              }
          }
          {code}

          Could we add a field to the repository object that indicates whether a pipeline has already been created for it? This is important in the "update" scenario to avoid the user trying to create a repo that was already created.
          New: I would like to request two additions to the Github APIs.

          When listing organizations via {{/jenkins/scm/github/organizations/?credentialId=github}} the response is currently:

          {code}
          [{
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/jenkinsci/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/107424?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "jenkinsci"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubUserOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/143466?v=3&s=50",
              "jenkinsOrganizationPipeline": true,
              "name": "cliffmeyers"
          }, {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubOrganization",
              "_links": {
                  "repositories": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/repositories/"
                  },
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cloudbees/"
                  }
              },
              "avatar": "https://avatars.githubusercontent.com/u/235526?v=3&s=50",
              "jenkinsOrganizationPipeline": false,
              "name": "cloudbees"
          }]
          {code}

          1. For organizations where jenkinsOrganizationPipeline is {{true}}, could we add an additional field that indicates whether "auto discover" is enabled? This is equivalent to a Github org folder that was created without specifying any repository names (i.e. empty "repoNames" array)

          2. For organizations where jenkinsOrganizationPipeline is {{true}}, could we also add a HAL link to the Jenkins org folder? This will make REST API update calls much easier.

          When listing repositories via {{/jenkins/scm/github/organizations/cliffmeyers/repositories/?credentialId=github&pageNumber=1&pageSize=100}} the response is currently:

          {code}
          {
              "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRespositoryContainer",
              "_links": {
                  "self": {
                      "_class": "io.jenkins.blueocean.rest.hal.Link",
                      "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/"
                  }
              },
              "repositories": {
                  "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepositories",
                  "_links": {
                      "self": {
                          "_class": "io.jenkins.blueocean.rest.hal.Link",
                          "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/"
                      }
                  },
                  "items": [{
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blog-examples/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Sample code from stuff on my blog",
                      "name": "blog-examples",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blog-examples"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/blueocean-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Blue Ocean UI app",
                      "name": "blueocean-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/blueocean-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/frontend-maven-plugin/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "\"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins.\" A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.",
                      "name": "frontend-maven-plugin",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/frontend-maven-plugin"
                  }, {
                      "_class": "io.jenkins.blueocean.blueocean_github_pipeline.GithubRepository",
                      "_links": {
                          "self": {
                              "_class": "io.jenkins.blueocean.rest.hal.Link",
                              "href": "/organizations/jenkins/scm/github/organizations/cliffmeyers/repositories/repositories/java-utils/"
                          }
                      },
                      "defaultBranch": "master",
                      "description": "Utilities for Java",
                      "name": "java-utils",
                      "permissions": {
                          "admin": true,
                          "push": true,
                          "pull": true
                      },
                      "private": false,
                      "fullName": "cliffmeyers/java-utils"
                  }],
                  "lastPage": 3,
                  "nextPage": 2,
                  "pageSize": 4
              }
          }
          {code}

          3. Could we add a field to the repository object that indicates whether a pipeline has already been created for it? This is important in the "update" scenario to avoid the user trying to create a repo that was already created.

          Cliff Meyers added a comment -

          vivek I added #2 to this list, related to the HAL href to the Jenkins org folder. Let me know if you think that's doable.

          Cliff Meyers added a comment - vivek I added #2 to this list, related to the HAL href to the Jenkins org folder. Let me know if you think that's doable.
          Vivek Pandey made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Vivek Pandey added a comment - - edited

          cliffmeyers

          > I added #2 to this list, related to the HAL href to the Jenkins org folder. Let me know if you think that's doable.

          I would avoid doing it as HAL that is inside _links element. HAL links are HTTP reachable resources, org folder contains repositories and not other way round. This way when you fetch jenkins org folder (/jenkins/scm/github/organizations/cliffmeyers/) you should see HAL link to repositories. Besides if you are accessing /jenkins/scm/github/organizations/cliffmeyers/repositories/ then you already have org folder link that is /jenkins/scm/github/organizations/cliffmeyers/.

          I could expose it as separate element, but it should be a collection as there could be more than one jenkins org folder for a given GitHub organization.

          Vivek Pandey added a comment - - edited cliffmeyers > I added #2 to this list, related to the HAL href to the Jenkins org folder. Let me know if you think that's doable. I would avoid doing it as HAL that is inside _links element. HAL links are HTTP reachable resources, org folder contains repositories and not other way round. This way when you fetch jenkins org folder (/jenkins/scm/github/organizations/cliffmeyers/) you should see HAL link to repositories. Besides if you are accessing /jenkins/scm/github/organizations/cliffmeyers/repositories/ then you already have org folder link that is /jenkins/scm/github/organizations/cliffmeyers/. I could expose it as separate element, but it should be a collection as there could be more than one jenkins org folder for a given GitHub organization.

            vivek Vivek Pandey
            cliffmeyers Cliff Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: