-
Notifications
You must be signed in to change notification settings - Fork 218
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(storage): thread new storage reference through all read requests #2570
Conversation
d1ef1a5
to
e1e653a
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2570 +/- ##
==========================================
- Coverage 71.57% 71.37% -0.21%
==========================================
Files 84 84
Lines 8085 8013 -72
==========================================
- Hits 5787 5719 -68
- Misses 1947 1949 +2
+ Partials 351 345 -6 ☔ View full report in Codecov by Sentry. |
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.
e1e653a
to
0456eb8
Compare
@markphelps I just renamed a bunch of these new things and added some additional doc comments. |
Also, this last commit allows the existing fs stores to skip taking a reference and ignoring it for now. |
a936863
to
7bec446
Compare
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.
wicked
63d1eca
to
0036b52
Compare
Last pass @markphelps I rebased and fixed this up after the the GCS changes and the cache changes 👍 |
refactor(storage): thread reference on storage request structs refactor(storage): rename ListPredicates to PageParameter refactor(storage): rename NewListRequest to ListWithOptions refactor(storage): rename List to ListWithParameters refactor(storage): rename ReferencePredicate to ReferenceRequest refactor(storage): rename NamespacePredicate to NamespaceRequest refactor(storage): rename ResourcePredicate to ResourceRequest refactor(storage): rename IDPredicate to IDRequest chore(rpc/flipt): proto-gen-go comment version updates refactor(storage): abstract reference threading behind new ReferencedSnapshotStore interface
0036b52
to
cbf2c53
Compare
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.
This looks good to me! Nice work.
p := IDRequest{ID: id} | ||
containers.ApplyAll(&p.ReferenceRequest, opts...) | ||
return p | ||
} |
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 abstractions!
Fixes: FLI-724
This is a combination refactor and addition of a new
reference
field on all read requests.In order to thread this everywhere with an empty default, I packaged up many of the storage method call arguments into structures. In particular, I created a few common structures.
NamespaceRequest
is used for operations which only need a namespace:flipt/internal/storage/storage.go
Lines 373 to 378 in a936863
ResourceRequest
is used for any operation which is scoped to some resource (e.g. scoped by flag or segment):flipt/internal/storage/storage.go
Lines 408 to 413 in a936863
Each of these types embed a reference which can be empty (zero state).
In a subsequent PR I will start to depend upon these references.
However, the server layer has been updated in this change to start threading these references from the RPC layer into the storage layer.