chore(services): store observed counts in permissionsServer, add LR/LS flags#2929
chore(services): store observed counts in permissionsServer, add LR/LS flags#2929miparnisari merged 10 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (74.82%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #2929 +/- ##
==========================================
- Coverage 74.88% 74.82% -0.05%
==========================================
Files 498 498
Lines 60736 61041 +305
==========================================
+ Hits 45474 45669 +195
- Misses 12108 12182 +74
- Partials 3154 3190 +36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
e95f9b9 to
0bd1e09
Compare
0bd1e09 to
01dfa21
Compare
| // validateQueryPlanLookupSubjects checks that for each resource × subject-type | ||
| // pair the query plan handler returns at least the subjects the accessibility | ||
| // set defines as directly accessible. Wildcard exclusion checking is omitted | ||
| // because the query plan handler does not yet populate ExcludedSubjects. |
There was a problem hiding this comment.
TIL. is there a ticket tracking this work?
5914507 to
4fc7de4
Compare
pkg/query/intersection_arrow_test.go
Outdated
| ds, err := memdb.NewMemdbDatastore(0, 0, memdb.DisableGC) | ||
| require.NoError(err) | ||
| revision, err := ds.ReadWriteTx(context.Background(), func(ctx context.Context, tx datastore.ReadWriteTransaction) error { | ||
| return nil | ||
| }) | ||
| require.NoError(err) | ||
| ctx := NewLocalContext(context.Background(), | ||
| WithRevisionedReader(datalayer.NewDataLayer(ds).SnapshotReader(revision))) |
There was a problem hiding this comment.
Please, here and below, use a mock instead:
ctrl := gomock.NewController(t)
defer ctrl.Finish()
ds := mock_datalayer.NewMockRevisionedReader(ctrl)
ctx := NewLocalContext(context.Background(), WithRevisionedReader(ds))also, i'm surprised that the mock is never invoked. And i'm not just talking about this test, i'm saying that in every test here where i did this change, the mock is never invoked. Is this right?
There was a problem hiding this comment.
Why make a mock when we can just build a real one?
There was a problem hiding this comment.
lots of reasons:
- mocks are way faster
- mocks are way easier to control and inspect (see my observation above)
- if the signature of
NewMemdbDatastoreor ofReadWriteTxchanges, you don't have to change anything here
There was a problem hiding this comment.
(1) In the grand scheme of things, it's a couple extra milliseconds
(3) If the signature changes, I feel I actively want to change something here, to make sure I'm using it right
As for (2), a matter of taste.
There was a problem hiding this comment.
But, I wonder if I can't obviate it entirely
There was a problem hiding this comment.
But, I wonder if I can't obviate it entirely
yes, this is what i pointed out
| t.Run("lookup_resources", func(t *testing.T) { | ||
| if os.Getenv("TEST_QUERY_PLAN_RESOURCES") == "" { | ||
| t.Skip("Skipping IterResources tests: set TEST_QUERY_PLAN_RESOURCES=true to enable") | ||
| t.Skip("Skipping IterResources tests due to deprectation: Set TEST_QUERY_PLAN_RESOURCES=true to enable") |
There was a problem hiding this comment.
i'm confused; what deprecation?
4fc7de4 to
dc23bb5
Compare
dc23bb5 to
c2f94b1
Compare
Description
Add the "lr" and "ls" strings as inputs for
--experimental-query-plan. Adds testing for the gRPC routes along with the existing consistency tests. And in so doing, found another bug: we want to combine the caveat both from the wildcard, and the relationship itself, which may or may not have oneTesting
References