-
Notifications
You must be signed in to change notification settings - Fork 55
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: pull client functionality and CLI command #148
Conversation
This PR isolates the pull functionality that was removed from the previous PR (canonical#147) and introduces the following changes: * Use a destination `io.Writer` instead of a local file path or `io.Reader`. * Includes close to perfect coverage of the `pebble pull` command and client functionality. Feedback appreciated!
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.
We skimmed through this with Gustavo during our London mini-sprint, and it looks good. He's going to take one more pass before we merge.
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.
I do not yet have the Go experience give any authoritative approvals. However, I deeply studied both the pull and push code, and compared the expectations of the daemon side, and it looks good for me.
The only observation, which I highlighted on the push PR, is the daemons ability to handle multiple files in a request, and the client side only ever requests a single file, which seems like a sensible starting point.
Thanks for your feedback on both PRs! |
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.
FWIW, this has been requested a few times, by @sed-i on the Observability team most recently. |
I've brought this PR up to date. I'd like to receive feedback on this one, especially on the part where I handle response headers. I decided to write a simple type RequestOptions struct {
// ...
Headers map[string]string
}
type RequestResponse struct {
// ...
Headers map[string]string
} |
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.
Just the Headers
field type change (as discussed) and some very nitty things to change.
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.
One more tweak Header
-> Headers
, and also we need to merge from master and fix conflicts. Thanks!
client/client.go
Outdated
@@ -61,6 +61,7 @@ type RequestOptions struct { | |||
|
|||
type RequestResponse struct { | |||
StatusCode int | |||
Header http.Header |
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.
Sorry to nitpick, but I think I'd like this called Headers
plural to match the field name in RequestOptions
(I've always found it weird that the net/http
field name is singular anyway).
Sorry about the incomplete changes @benhoyt! I absolutely forgot we already merged |
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.
Looking good!
These features have been implemented now: * rm (canonical#146) * push (canonical#147) * pull (canonical#148)
This PR isolates the pull functionality that was removed from the previous PR (#147) and introduces the following changes:
io.Writer
instead of a local file path orio.Reader
.pebble pull
command and client functionality.Feedback appreciated!