-
Notifications
You must be signed in to change notification settings - Fork 354
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: Clean up data values persistence [DHIS2-18223] #18871
Conversation
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Outdated
Show resolved
Hide resolved
and an empty string as well right? Here it looks like we are checking for blank, while for attributes we check for empty. Not that we have to support that but both data values and attributes should behave the same way. Line 322 in accad72
|
@@ -117,8 +117,6 @@ | |||
"providedElsewhere": false | |||
}, | |||
{ | |||
"updatedAt": "2019-03-04T15:12:59.209", |
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.
Is there a way for us to prevent test data to have these autogenerated fields in them?
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.
I am not sure.
Maybe we can find a way to have a jsonMapper
just for tests in the integration tests that is going to be strict and fail if there are unknown fields.
In e2e tests that wouldn't work because we are using the view model and those fields are actually used in the output.
Anyway, I cannot think of something easy to implement.
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Outdated
Show resolved
Hide resolved
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Outdated
Show resolved
Hide resolved
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Outdated
Show resolved
Hide resolved
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Outdated
Show resolved
Hide resolved
...ice-tracker/src/main/java/org/hisp/dhis/tracker/imports/bundle/persister/EventPersister.java
Show resolved
Hide resolved
I agree. |
Quality Gate passedIssues Measures |
The flow of persisting data values was quite complicated and error prone.
Now we are dealing with data values in
Event
in the same way we are dealing with attributes inEnrollment
andTrackedEntity
. We expect only the changed values (null
value represent aDELETE
).dataValues
field is not mapped inTrackerObjectsMapper
EventPersister
, for everydataValue
in the payload we decide if it is a new value, if it is an update or a deletion and we deal withFileResource
s andChangeLog
accordingly.createdAt
,updatedAt
,createdBy
andupdatedBy
fields follow the same logic as implemented for all tracker objects.createdAt
for adataValue
. This is a bug. https://dhis2.atlassian.net/browse/DHIS2-18252. A failing e2e test, solved by fixing this file, was showing this issue.