-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement new validation spec #204
Conversation
Codecov Report
@@ Coverage Diff @@
## main #204 +/- ##
==========================================
+ Coverage 93.70% 94.32% +0.61%
==========================================
Files 42 46 +4
Lines 3179 4086 +907
==========================================
+ Hits 2979 3854 +875
- Misses 200 232 +32
Help us with your feedback. Take ten seconds to tell us how you rate us. |
…uadoggo into implement-new-validation-spec
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.
Super good! I've added only some minor change request, otherwise it's good to go from my side 👍
Implement validation flows for
publish()
andnext_args()
as specified here: https://whimsical.com/api-validation-4X53TdGvPLFUtmuBFvriW5NOTES:
publish
andnext_args
only depend on having access toLogStore
,EntryStore
andOperationStore
. This results in some slightly less efficient queries, but in removing a previous dependency onDocumentStore
it means we no longer require documents to be materialised before being able to process new entries or providing next args. I think this is a good trade-off for now. It means these methods don't assume a certain materialisation flow and helps in separating concerns in the testing environment.publish_entry
andnext_entry_args
currently onStorageProvider
inp2panda-rs
)StorageProvider
as wellTHIS PR:
validation
module which contains modular validation methods (but not for operations / schema yet)domain
module which containspublish()
andnext_args()
high level API methodsdb/stores/test_utils.rs
into smaller modules as it was getting massivevalidation
,domain
&db/store/test_utils/*
module methods generic over storage provider implementation. This is sweeeeet. Everything works withSqlStorage
orMemoryStore
(fromp2panda-rs
). The immediate benefit is that we can use MemoryStore for tests, which is much easier to work with (read mess with than the SQL dbs). I'll try and separate this into it's own PR before completing this one.NEXT UP:
StorageProvider
traitsvalidation
anddomain
top2panda-rs
(we need to do this when we deprecatepublish_entry
andnext_entry_args
on storage provider).closes: p2panda/p2panda#400 p2panda/p2panda#301 #159
requires: p2panda/p2panda#413 & p2panda/p2panda#408
📋 Checklist
CHANGELOG.md