github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Fix GHContentUpdatedResponse to return GitCommit instead of GHCommit

Open bitwiseman opened this issue 4 years ago • 4 comments

In #1185, @takezoe discovered that the date returned for GHContentUpdatedResponse.commit does not match up with GHCommit. It most closely matches GHCommit.ShortInfo but even that is not truly accurate.

In #1190 , I figured out that while this a bad the functionality is not completely broken. The sha and the url match up and that is enough for the GHCommit to populate the missing data and continue on. This is still not great because it results in additional requests where there probably shouldn't be any.

After a bit of digging in the docs, I found an endpoint that gets a Git Commit. What we should do is create a new class called GitCommit , matching the structure of this endpoint and then have other classes like GHCommit.ShortInfo extend that class.

Fixing this will involve creating a bridge method for getCommit() that continues to return a working GHCommit while the new official API method returns a GitCommit. As part of this, we'll need to add a reflection based call to the GHCommit-returning method and verify that instance still works.

bitwiseman avatar Jun 28 '21 21:06 bitwiseman

hi @bitwiseman - I'm taking a look at this one. Can I get access to the organization for testing? Thanks!

ecxia avatar Nov 29 '21 02:11 ecxia

@ecxia This change is not marked as a good first issue. Are you sure you want to take this on?

bitwiseman avatar Nov 29 '21 05:11 bitwiseman

@bitwiseman i have noticed that it is not straightforward but I will give it a shot!

ecxia avatar Nov 29 '21 12:11 ecxia

@ecxia Okay! Feel free to create a draft PR of your changes earlier your development process if you want early feedback to ensure you're going in a good direction.

bitwiseman avatar Nov 29 '21 17:11 bitwiseman