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
Feature detect diff-based bandwidth-optimized PATCH protocol for saving checkpoints #11421
Conversation
Changelog[uncommitted] (2022-11-22)Features
|
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 otherwise
func (pc *Client) GetCapabilities(ctx context.Context) (*apitype.CapabilitiesResponse, error) { | ||
var resp apitype.CapabilitiesResponse | ||
err := pc.restCall(ctx, http.MethodGet, "/api/capabilities", nil, nil, &resp) | ||
if is404(err) { |
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 suspect a customer maintaining a fork of the CLI may not even want the client to call a nonexistent /api/capabilities
endpoint. We could ask.
I wonder if we should have a disableCapabilities
bool field (or better name) on the Client
struct, that a customer could set to true
from their own implementation of newClient
, that when set would avoid making the request to /api/capabilities
at all, and have this method return early with &apitype.CapabilitiesResponse{}
like the 404 case.
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.
You're right I was also worried about the 404s tripping some alarms, I thought we cleared it already but I'll double-check.
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.
Added DisableCapabilityProbing on Client struct.
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 have 1 nit, otherwise it looks good.
6bec243
to
134621f
Compare
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
afb91d6
to
1e4aa31
Compare
bors merge |
Build succeeded: |
Description
Starts using diff-based PATCH protocol for saving checkpoints for backends that indicate that they support it via
GET /api/capabilities
. Removes flags that opted into the feature. Specifically:Fixes https://github.com/pulumi/home/issues/2425
I've tested the change against the mainline backend that does not support capabilities yet (404 path) and the experimental backend that does, including both sides of the size cutoff, and it seems to work as expected.
Checklist
make changelog
and committed thechangelog/pending/<file>
documenting my change