Open salonig23 opened 2 weeks ago
Name | Link |
---|---|
Latest commit | 4b8e85bc7092bd139c584175f855c986be990b5d |
Latest deploy log | https://app.netlify.com/sites/determined-ui/deploys/6684680a41722f00084f0f89 |
Deploy Preview | https://deploy-preview-9602--determined-ui.netlify.app |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
Attention: Patch coverage is 45.09804%
with 28 lines
in your changes missing coverage. Please review.
Project coverage is 51.79%. Comparing base (
be2a357
) to head (87d11bd
).
Just spit balling, but would it be worth having these structured as instead 2 endpoints, a GET & a POST, where the get will return the set of workspace_ids that aren't associated with a namespace & then a POST responsible for the auto-creation & binding of the namespace to the given workspaces based on the provided ids? The POST could potentially be framed as a bulk action endpoint.
My concern is this seems like a very niche endpoint that will likely only get used once per determined instance. It's absolutely okay to disagree, overall the code looks solid!
I agree and had the same thought, Corban. I prefer explicit APIs over implicit ones. And in my experience it's usually worth the performance hit of roundtripping the list of ids back to a client. Something like
// Binds all unbound workspaces to new auto-created namespaces.
rpc GetUnboundWorkspaces(
GetUnboundWorkspacesRequest)
returns (GetUnboundWorkspacesResponse) {
option (google.api.http) = {
get: "/api/v1/workspaces/unbound",
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Workspaces"
};
}
// Binds the specified workspaces to new auto-created namespaces if they're unbound.
rpc BulkAutoCreateWorkspaceNamespaceBindings(
BulkAutoCreateWorkspaceNamespaceBindingsRequest)
returns (BulkAutoCreateWorkspaceNamespaceBindingsResponse) {
option (google.api.http) = {
post: "/api/v1/workspaces/auto-namespace-bindings",
};
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
tags: "Workspaces"
};
}
// Request for finding all unbound workspaces.
message GetUnboundWorkspacesRequest {}
// Response to GetUnboundWorkspacesRequest.
message GetUnboundWorkspacesResponse {
// The list of returned workspace ids.
repeated int32 = 1;
// Pagination information of the full dataset.
Pagination pagination = 2;
}
// Request for binding the specified unbound workspaces to new auto-created namespaces.
message BulkAutoCreateWorkspaceNamespaceBindingsRequest {
// The list of returned workspace ids.
repeated int32 = 1;
}
// Response to BulkAutoCreateWorkspaceNamespaceBindingsRequest.
message BulkAutoCreateWorkspaceNamespaceBindingsResponse {}
Ticket
DET-10226
Description
Test Plan
Checklist
docs/release-notes/
See Release Note for details.