-
Notifications
You must be signed in to change notification settings - Fork 356
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
Prevent import of duplicate default COCs #19101
Conversation
dhis-2/dhis-api/src/main/java/org/hisp/dhis/feedback/ErrorCode.java
Outdated
Show resolved
Hide resolved
...java/org/hisp/dhis/dxf2/metadata/objectbundle/hooks/CategoryOptionComboObjectBundleHook.java
Outdated
Show resolved
Hide resolved
...java/org/hisp/dhis/dxf2/metadata/objectbundle/hooks/CategoryOptionComboObjectBundleHook.java
Outdated
Show resolved
Hide resolved
...isp/dhis/webapi/controller/dataintegrity/DataIntegrityCategoryOptionComboDuplicatedTest.java
Fixed
Show fixed
Hide fixed
...web-api/src/test/java/org/hisp/dhis/webapi/controller/CategoryOptionComboControllerTest.java
Fixed
Show fixed
Hide fixed
...java/org/hisp/dhis/dxf2/metadata/objectbundle/hooks/CategoryOptionComboObjectBundleHook.java
Fixed
Show fixed
Hide fixed
...java/org/hisp/dhis/dxf2/metadata/objectbundle/hooks/CategoryOptionComboObjectBundleHook.java
Fixed
Show fixed
Hide fixed
...ration/src/test/java/org/hisp/dhis/tracker/imports/validation/EventImportValidationTest.java
Outdated
Show resolved
Hide resolved
...java/org/hisp/dhis/dxf2/metadata/objectbundle/hooks/CategoryOptionComboObjectBundleHook.java
Outdated
Show resolved
Hide resolved
As discussed the basic idea of this PR is not wrong but to really validate duplicates correctly we need to consider all effects of the import context as a whole which is difficult to do in the bundle hooks. This needs some more thinking about where we could have such a overall consistency validation. |
Quality Gate passedIssues Measures |
This PR attempts to solve two problems when importing an alternative default Category option combos through the metadata API. This PR should prevent the import of a duplicated, non-standard default category option combination.
Some time ago, this was hard-coded into the system, but it is still possible to import another default COC with a different UID. This creates all sorts of analysis and configuration issues. A separate integrity check has also been created to identify this situation in existing systems. Various tests which utilized the alternative default COCs needed to be updated.
Some tests needed to be updated as part of this PR. Some integration and E2E tests were utilizing an alternative default COC, and these have now been updated to use the standard default COC instead.