-
Notifications
You must be signed in to change notification settings - Fork 225
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
refactor(storage/fs): adjust the declarative storage abstractions #2540
Conversation
Uffizzi Ephemeral Environment
|
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #2540 +/- ##
==========================================
+ Coverage 70.85% 71.32% +0.47%
==========================================
Files 82 82
Lines 8193 8053 -140
==========================================
- Hits 5805 5744 -61
+ Misses 2042 1958 -84
- Partials 346 351 +5 ☔ View full report in Codecov by Sentry. |
d093f6c
to
4c28d7a
Compare
refactor(storage/fs): export SyncedStore ability to set snapshot refactor(storage/fs/local): embed synced store directly refactor(storage/fs/s3): embed synced store directly refactor(storage/fs/git): embed synced store directly refactor(storage/fs/oci): embed synced store directly refactor(cmd/grpc): update calls to declarative backend stores refactor(storage/fs): rename files from source to store refactor(storage/fs/git): simplify condition where reference is a revision refactor(storage/fs): remove store abstraction fix(storage/fs/oci): remove errant error check from store test refactor(storage/fs): rename SyncedStore to Store refactor(storage/fs): add SnapshotStore functional transaction interface
4c28d7a
to
9f79b46
Compare
@GeorgeMac please don't wait for me. It looks like it will take some time to finish Azure blob storage |
Cheers for the heads up @erka 🙏 If I do end up getting this in before, I am happy to point out how the interfaces have changed. So you can adjust accordingly. I can update the open issue too with more up to date details. |
store, err = fs.NewStore(logger, source) | ||
default: | ||
// otherwise, attempt to configure a declarative backend store | ||
store, err = fsstore.NewStore(ctx, logger, cfg) |
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.
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.
Just don't open that new package and it's like all that code doesn't exist.
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 is amazing! love these abstraction changes!!
@erka let me know if I can help unblock in any way with the Azure blob store changes! Thank you for taking that on |
@markphelps this PR doesn't impact my work much. The challenge for me is Aruzite, azure-sdk-for-go and auth between them for testing. I also have never used |
gotcha. I'm happy to help with getting the Dagger tests working as well with Azurite (never used Azurite but looks cool) |
…it/v5-5.11.0 * main: (31 commits) fix: resolved issues with go-git 5.11.0 (#2543) chore: Devenv (#2542) refactor(storage/fs): adjust the declarative storage abstractions (#2540) chore(readme): update readme with client-side eval info (#2539) chore(deps): bump cuelang.org/go from 0.6.0 to 0.7.0 (#2523) refactor: use rpc/flipt.Now everywhere instead of timestamppb.Now feat(rpc/flipt): add Now timestamp with microsecond precision function fix(mysql): increase timestamp precision from seconds to microseconds fix(build): create new db instance per api IT fix(cfg): default config outputs first INFO log regardless of FLIPT_LOG_LEVEL (#2536) feat(ui): show time/date format on settings/preferences page (#2537) fix(mod): update dagger in correct go.mod (build) chore(github): update DAGGER_VERSION to 0.9.4 chore: cleanup go work sum chore(build): update dagger to v0.9.4 fix(build/testing): use correct db url environment variable test: move database coverage into integration tests chore(deps): update xo/dburl to v0.20.0 (#2533) chore: update readme chore: update README ...
Fixes FLI-747
I will hold off on doing this until #2538 is delivered and this has been updated to include that work.
To avoid causing any disruption there and so @erka can get his work in 👍 .
This change is going to mix up the abstractions a little.
The motivation is this will help with some work coming up, where a couple of the backends will actually support multiple versions of snapshots (keyed by their git tag / revision or oci tag / digest). Clients will be able to request snapshots by reference or potentiall even revision.
The refactor drops the idea of
fs.SnaphotSource
altogether.Instead, it introduces the concept of
fs.SnapshotStore
:This new store exposes a kind of funtional transaction interface (similar to e.g. boltdb).
Instead of making the top-level
fs.Store
managed locking and handle subscribing to changes, it instead pushes the synchronization responsibilities down onto the snapshot stores themselves (previously called sources).Now the individual stores have to take care of managing how and when to update their snapshots.
To achieve this, the new abstraction exposes a function
View()
which itself takes a function.The function provided to View is given the snapshot instead.
It is on the store implementers to call the provided function inside a read lock.
The write lock can and is held by the store when changing the snapshots themselves.
This allows the top-level
fs.Store
to define what happens per read-lock, without having to own the lock itself.In subsequent change, the
View()
function will be updated to take a target reference.This will allow the various store implementations to support managing multiple snapshots for different references.
Whether or not a store supports arbitrary references, will be up to the store (initially Git and OCI will).