-
Notifications
You must be signed in to change notification settings - Fork 30
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: changes to aggregate::Repository, event::Store, documentation and more #289
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…use concrete error type
…ert and serde::ProtoJson
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #289 +/- ##
==========================================
- Coverage 91.53% 84.89% -6.64%
==========================================
Files 17 15 -2
Lines 1158 1225 +67
==========================================
- Hits 1060 1040 -20
- Misses 98 185 +87 ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the scope of a closer v0.5.0 release, this PR introduces quite some refactorings to different APIs, which are still experimental:
refactor: generalize
event::StreamVersionExpected
intoversion::Check
version::Check
is a more general phrasing and naming for optimistic locking, yet expressing quite more precisely its role.feat: add new
aggregate::test::Scenario
It is now possible to write test assertions on
aggregate::Root
methods, rather than having that only available through acommand::test::Scenario
.refactor(aggregate::repository): split
Repository
traits once again, use concrete error typeAfter trying the approach of having an unified
aggregate::Repository
trait, and use anAnyRepository
withError = anyhow::Error
(so, opaque) for better usage in trait objects, we've reverted back to Interface Segregation:Saver
andGetter
-- and aRepository
one, which extends both,thiserror
, rather than using an associated type to abstract over it.While this has required the introduction of opaque errors with
anyhow::Error
in the concrete error types, this should provide a better ergonomics for consumers of this API.refactor(event::store): move symbols to this module, add
AppendError
concrete typeThe
event::Store
follows the same approach asaggregate::Repository
now: split interfaces, concrete error types. The only exception beingStreamer::stream
, where it seems to be fine to abstract over the error type returned (for now).refactor(eventually-macros): remove derive(Message), as it requires better design
#[derive(Message)]
requires better design; we've implemented that with a specific idea in mind, but that's very limiting and wouldn't be used most of the time.We remove it for now while we collect some ideas on how it should work.
chore: add vscode setting for rust-analyzer to use all features
Finally rust-analyzer under VSCode will compile and check the workspace using all feature flags.
docs(eventually): add missing documentation
There was A LOT of missing documentation. This PR addresses some of the missing stuff.
It's not great by any means, we'd likely need some dedicated effort before releasing.
refactor: split Serde trait into separate ones, implement
serde::Convert
andserde::ProtoJson
After some production usage, we've collected some different ideas on how this trait should work, and have implemented that following the previous concepts: split methods/traits, concrete error types.
chore: update all versions
Too many open dependabot PRs, this will take care of them all at once (but
syn
, which is a major change).