- 
                Notifications
    You must be signed in to change notification settings 
- Fork 769
github api v2 Feature list
        Adrien Lecharpentier edited this page Nov 20, 2024 
        ·
        4 revisions
      
    It would be great to move forward and clean up the existing code, but breaking changes would cause havoc downstream.
- The v2 api will be in a new namespace, leaving the v1 api untouched.
- Once v2 reaches feature parity, the v1 api will be deprecated as a whole.
- Where possible the v1 api will be updated to be a wrapper around the v2 api.
- New namespace TBD. `org.kohsuke.github2
- Make GitHubClient stateless
We'll begin by copying/migrating cleaned up internals to public v2 versions.
- No bridge methods
- No deprecated classes and methods
- Cleanup class names as noted in various filed issues as we migrate
- No external references to URLConnectionoutside ofHttpConnector
- Replace HttpConnectorwithGitHubClient
- Objects returned from the v2 api will be final/immutable by default.
- There will be an updateInPlace(boolean)onGitHubBuilderto make objects non-final. ** If false (default), calls topopulate(),refresh(),update(), orset()will return a new instance leaving the original one unmodified. ** If true, calls topopulate(),refresh(),update(), orset()will return a the same instance with the updated value.
Instead of a mishmash of update methods, we'll use one consistent pattern.
- Rather than trying to match the GitHub REST API documentation structure, look at the GraphQL structure.
- Example: instead of gitHub.getRepository("hub4j/github-api")there will begitHub.repository().nameWithOwner("hub4j/github-api")
- Example: instead of repository.queryPullRequests().state(GHIssueState.CLOSED).list().toList()there will berepository.pullRequests().state(GHIssueState.CLOSED).toList()
- Preview APIs will need to be enabled at the GitHubinstance level before use ** If Preview API methods are called without being enabled, they will throw an informative error at runtime. By enabling a Preview the user acknowledges that they may be broken at any time - the project make no guarantees about stability/compatibility for those methods.
- Preview APIs will not longer be marked with @Deprecated** This should reduce confusion. We have had multiple users report issues due to thinking that Preview APIs are actually deprecated and should be avoided.