sdk-codegen
sdk-codegen copied to clipboard
fix: add status code handling for delete endpoints
I added status code handling in the Go SDK to deal with delete endpoints' response body.
In Looker API, delete endpoints call returns empty response body with status code 204 when the API call is succeeded.
Such API call will be failed with EOF error in the current implementation because of reading empty response body.
Developer Checklist ℹ️
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
- [x] Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
- [x] Ensure the tests and linter pass
- [x] Appropriate docs were updated (if necessary)
Hi, could you review this changes?
@jeremytchang Hi, could you review this change?
@jkaster Hi, cloud you review this PR?
@jeremytchang Thank you for the review!
I'll create a example to reproduce the error and add integration test if it is needed (maybe this weekend).
@jeremytchang Here's the minimum example of reproducing error (need to run this on the local PC).
https://go.dev/play/p/EFRxP79d9z9
This example fails with failed to delete: EOF at line 77.
I'll implement integration test for this next.
integration test added in 3a4cdcc
@jeremytchang Could you approve to run github actions workflow for confirming the IT run correctly?
@jeremytchang Could you approve to run CI? https://github.com/looker-open-source/sdk-codegen/pull/1074#issuecomment-1218537111
Thanks Jeremy!
CI is failed by permission denied on the step of docker pull, but I didn't any change about this part. Do you have any idea for how to solve this? https://github.com/looker-open-source/sdk-codegen/actions/runs/3012134238/jobs/4901724930
22.8 shouldn't be part of the integration test run now. I've requested a re-run of all CI tests
Hmm. Looks like we have an issue in CI right now
Rebasing branch to see if it fixes the CI issue.
Hmmm. Required Checks is failed, too.
Hey @hirosassa! Our CI can only run on branches in our repo because of security reasons. I've copied your changes to this PR https://github.com/looker-open-source/sdk-codegen/pull/1193. When we squash merge the PR, i'll add you as co-author of the squashed commit.
I'll close this PR coz the problem is fixed in https://github.com/looker-open-source/sdk-codegen/pull/1193. @jeremytchang @jkaster Thank you for your support!