Repository navigation
Conversation
macro_db_client implemented messages' AnnotationRepository port, so it depended on the messages domain and every crate that uses macro_db_client compiled messages, initiative and entity_access. The hexagonal rule is that a domain owns the adapters for its own ports. Move PgAnnotationRepository and the PDF anchor edit and delete SQL into messages::outbound::pg_annotation_repo (behind its outbound and annotations features), returning MessageError directly instead of an anyhow error re-wrapped by the adapter. DSS builds the repository from its new path, and macro_db_client keeps messages only as a dev-dependency for its own tests. MACRO-4994
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
Author
|
Folded into the single reorg PR #10111 (one PR for the whole reorganization). Its commits are there; closing this one. |
This file contains hidden or 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
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.
Why
macro_db_clientimplemented themessagesdomain'sAnnotationRepositoryport, so it depended on
messages(and through it oninitiative,entity_accessand their adapters). About 50 crates depend onmacro_db_client, so all of them compiled the message domain. The hexagonalrule in this repo is that a domain owns the adapters for its own ports. This
edge is N7 in the repository reorganization plan.
MACRO-4994
How it works
PgAnnotationRepositoryand the PDF anchor edit/delete SQL move, with githistory, from
crates/macro_db_client/src/annotations/{repository,edit_anchor,delete_anchor}.rsto
crates/messages/src/outbound/pg_annotation_repo{,/edit,/delete}.rs,behind
messages' existingoutbound+annotationsfeatures.MessageErrordirectly. Before, the adapterre-wrapped an
anyhowerror intoMessageError::Repositoryas a string.macro_db_clientkeepsmessagesonly as a dev-dependency, for its remaining create/get tests, anddrops
rootcauseand the dev-onlyentity_access, which the move left unused.MACRO_DB_MIGRATIONSand the existingcrates/macro_db_client/fixtures/message_annotations.sql, unchanged.Closures (
.github/workspace-dep-closures.json):macro_db_clientclosuremessagesentity_accessinitiativeNo SQL, route or wire format changes. The seven moved annotation tests pass
against a migrated database.