GitHubSdk icon indicating copy to clipboard operation
GitHubSdk copied to clipboard

Dependency updates and support for comments in timeline API

Open Fs00 opened this issue 1 year ago • 0 comments

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 commented events 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 make IssueEvent extend GitHubCommentBase, but then changed my mind when I noticed that I would've had to create a builder for IssueEvent so that the app could clone them to update the reactions. Instead, I've added the missing comment fields directly on IssueEvent, together with a method that allows creating a GitHubComment from 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 withReactions method to the GitHubCommentBase class 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?

Fs00 avatar Sep 07 '24 13:09 Fs00