-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
multitenant: add AdminUnsplitRequest capability #97717
Conversation
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.
As we're adding new capabilities, we should continue to add tests for them in the tenantcapabilities package. For this one, I think all you need is to add more tests to the Authorizer's
datadriven tests.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz, @mgartner, and @rafiss)
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.
To make adding those tests easier, can I replace the request method aliases (split
, scan
, cput
) with the actual method names (AdminSplit
, Scan
, ConditionalPut
)?
This will prevent new cases from needing to be added to this switch for each method:
switch z {
case "split":
ba.Add(&kvpb.AdminSplitRequest{})
case "scan":
ba.Add(&kvpb.ScanRequest{})
case "cput":
ba.Add(&kvpb.ConditionalPutRequest{})
default:
t.Fatalf("unsupported request type: %s", z)
}
I would like to minimize the overhead of using DSLs everywhere for what could be go tests.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @knz, @mgartner, and @rafiss)
Remove `TestGCTenant`'s reliance on `TenantCapabilities` struct field names to reduce code churn. Release note: None
Filter out non-target capabilities from output of capabilites_test.go testdata. Release note: None
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.
nice.
Reviewed 18 of 18 files at r3, 1 of 1 files at r4, 8 of 8 files at r5, 25 of 25 files at r6, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @arulajmani and @rafiss)
Use request methods instead of aliases to avoid needing to maintain alias -> request method mapping. Release note: None
Fixes #97716 1) Add a new `tenantcapabilitiespb.CanAdminUnsplit` capability. 2) Check capability in `Authorizer.HasCapabilityForBatch`. 3) Remove `ExecutorConfig.RequireSystemTenant` call from `execFactory.ConstructAlterTableUnsplit`, `execFactory.ConstructAlterTableUnsplitAll`. Release note: None
bors r=knz |
Build succeeded: |
Fixes #97716
tenantcapabilitiespb.CanAdminUnsplit
capability.Authorizer.HasCapabilityForBatch
.ExecutorConfig.RequireSystemTenant
call fromexecFactory.ConstructAlterTableUnsplit
,execFactory.ConstructAlterTableUnsplitAll
.Release note: None