GitHubSdk
GitHubSdk copied to clipboard
Dependency updates and support for comments in timeline API
This PR includes some small additions and adjustments to enable further improvements in the app (I'd recommend to review it commit-by-commit):
- updated dependencies and removed OkHttp logging interceptor. Since the app uses its own interceptor, we can avoid declaring that dependency both in the app and here. Note that updating Gradle/AGP required me to use the new syntax for Maven publishing (I'm not 100% sure I got it right, but it looks like it's working) and I had to remove all the code related to the publishing plugin used upstream (the plugin could not be fetched anymore due to JCenter being shut down).
- added missing fields used by
commentedevents in timeline API. This will allow us to avoid calling the issue comments API in the app and use the timeline API for both comments and events. Since comment fields are spread on event objects in timeline API, I initially thought to makeIssueEventextendGitHubCommentBase, but then changed my mind when I noticed that I would've had to create a builder forIssueEventso that the app could clone them to update the reactions. Instead, I've added the missing comment fields directly onIssueEvent, together with a method that allows creating aGitHubCommentfrom the event. This way, integrating with existing app logic is easier and there is no need to create a huge builder for IssueEvent. - last but not least, I have added a convenience
withReactionsmethod to theGitHubCommentBaseclass hierarchy which will allow to avoid some - admittedly inelegant - downcasts in the app when cloning comments to update their reactions, as the AutoValue documentation recommends for those use-cases.
Could you release a new version of the library when this is merged?