-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add Create / Update / Delete requests #390
feat: add Create / Update / Delete requests #390
Conversation
Only thing I'm waiting on is actually testing this against GitHub via Ammonite (which I will do soon), since it seems the integration tests are only used / needed for reads. |
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
=========================================
Coverage ? 79.19%
=========================================
Files ? 23
Lines ? 548
Branches ? 2
=========================================
Hits ? 434
Misses ? 114
Partials ? 0
Continue to review full report at Codecov.
|
Tested this and it seems to be working, so I'm marking as ready for review. I did find that requiring the client to convert to base64 is annoying, so the API now takes an array of bytes and handles the base64 conversion for you. Only issue with this is over the |
One more tweak to edit the docs is in-bound, fyi here for reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, thanks 👍
That PR and #391 go me thinking maybe we need a repo just for gh4s integration tests, wdyt @juanpedromoreno ? 🤔
@@ -23,6 +23,7 @@ import github4s.GithubResponses.GHResponse | |||
import github4s.domain._ | |||
import github4s.Decoders._ | |||
import github4s.Encoders._ | |||
import com.github.marklister.base64.Base64._ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this dependency transitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used like this in the AuthInterpreter also. I'm not sure where it's from. Shall we pin it to the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes might be a good idea 👍
Co-Authored-By: Ben Fradet <benjamin.fradet@gmail.com>
Co-Authored-By: Ben Fradet <benjamin.fradet@gmail.com>
Co-Authored-By: Ben Fradet <benjamin.fradet@gmail.com>
There are issues with relying on the Users could see a JsonParseException if they try to use it. Anyway the |
…github4s into add-create-update-delete-388
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 modulo the version change
don't change the version.
04de1aa
to
f1dc628
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good. I'm wondering if we should have a single operation for creating and updating, like in the GitHub API. From a user's perspective, it could be confusing what to use when you don't know if the file exists or not. This is solved by the API specifying a single operation ("Creates a new file or updates an existing file in a repository.")
@fedefernandez I do not think 'create or update' can function as an upsert. The update requires that you include the This allows them to do optimistic locking to avoid lost updates, but it's a little misleading, imo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kalexmills oh I see. Code looks good to me!
Please, update your branch with master
@fedefernandez Thanks! Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kalexmills
WIP For #388
Based on the APIs in the ticket.
Thanks to the maintainers for having such a well-factored project. This has been easy so far.