-
Notifications
You must be signed in to change notification settings - Fork 358
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
chore: use EnrollmentService in TE service to get enrollements/events DHIS2-18541 #19723
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
teleivo
force-pushed
the
DHIS2-18541-uid-enrollmentservice
branch
8 times, most recently
from
January 21, 2025 09:32
eaf76a3
to
c69131d
Compare
enricocolasante
approved these changes
Jan 21, 2025
muilpp
approved these changes
Jan 22, 2025
teleivo
force-pushed
the
DHIS2-18541-uid-enrollmentservice
branch
from
January 22, 2025 11:15
a300de2
to
6aa9c8a
Compare
...rvices/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EnrollmentMapper.java
Fixed
Show fixed
Hide fixed
...is-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EventMapper.java
Fixed
Show fixed
Hide fixed
...ces/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/TrackedEntityMapper.java
Fixed
Show fixed
Hide fixed
...rvices/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EnrollmentMapper.java
Fixed
Show fixed
Hide fixed
...is-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EventMapper.java
Fixed
Show fixed
Hide fixed
...ces/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/TrackedEntityMapper.java
Fixed
Show fixed
Hide fixed
to get enrollments on /trackedEntities/{uid}?fields=enrollment chore: wire ids and uids through chore: use enrollment service in TE aggregate
as these are fetched by the EN service
teleivo
force-pushed
the
DHIS2-18541-uid-enrollmentservice
branch
from
January 23, 2025 04:22
2d84b71
to
f26a735
Compare
in getting relationships
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
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.
EnrollmentService
in TE aggregate to fetch enrollments and events as well as to serve/trackedEntities/uid
.JdbcEventStore
. This is needed anyway but here its used to eagerly fetch the entities we need later on when there is no hibernate session available. SeeArchitecture challenges
for more.TrackedEntityIdentifiers
pair from the TE store. This is needed for now so we can pass the TE uids to the enrollment service in the enrollment aggregate. All other aggregate code uses the primary key id. We might be able to untangle the TE aggregate later on.Next
Architecture challenges
Our goal was that every service of an entity depends on its childs service to fetch such nested entities. This assumes an acyclic graph TE -> EN -> EV. This neglects the fact that relationships can add cycles. This is an example graph where relationships add edges causing cycles
We cannot have cycles in our code as Spring would not know how to resolve them unless we resort to some hacks.
This was already true. Up to now it was solved by hibernate fetching relationships. Even in services/stores that use JDBC like hibernate was ultimately responsible for getting relationships
We are going to stick with hibernate being responsible for fetching relationships. The target architecture will be
This will mean that there is one place that is also responsible for ACL of relationships
(trackerAccessManager.canRead(user, relationship)
. Note that this underneath checks the ACL of TE, EN, EV.