Skip to content
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

fix: make dataDimensionType mandatory for catOptionGroup and groupSet #15880

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

vietnguyen
Copy link
Contributor

@vietnguyen vietnguyen commented Dec 11, 2023

https://dhis2.atlassian.net/browse/DHIS2-14694

  • DataDimensionType has not-null=true for Category and CategoryCombo but its nullable for CategoryOptionGroup and CategoryOptionGroupSet.

  • In Maintenance app, the field DataDimensionType is disabled when editing. Therefore, if an object is created without DataDimensionType then it can't be updated with correct value.

  • This PR add not-null=true for those classes in hbm mapping file.

Behavior change

  • After this PR, the form field in maintenance app is marked as required.
  • Metadata import will throw exception for missing required field.

Test

  • Added unit tests and fixed various related integration tests

@vietnguyen vietnguyen changed the title fix: make dataDimensionType not null for catOptionGroup and groupSet fix: make dataDimensionType mandatory for catOptionGroup and groupSet Dec 11, 2023
Copy link

sonarcloud bot commented Dec 11, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@david-mackessy
Copy link
Contributor

wondering if this could cause issues to entities that currently have null for this value in the DB? (or is that even possible)
If it is possible, imagine a GET is performed for an entity with a null dataDimensionType and then that entity is flushed and might throw an error.
Or is there a default dataDimensionType in play here somewhere?

@vietnguyen
Copy link
Contributor Author

wondering if this could cause issues to entities that currently have null for this value in the DB? (or is that even possible)
If it is possible, imagine a GET is performed for an entity with a null dataDimensionType and then that entity is flushed and might throw an error.
Or is there a default dataDimensionType in play here somewhere?

@david-mackessy I thought about that. In this case I think we can't automatically update existing records because we can't be sure which is the correct value.
So i think it's better not to back-port this fix, then add a note to the breaking change section in upgrade notes for 2.41. User would need to manually correct their data before upgrade.
Beside, this feature is requested and only used by PEPFAR so I think the fix won't affect other implementations.

@vietnguyen vietnguyen merged commit 063fd2d into master Dec 11, 2023
16 checks passed
@vietnguyen vietnguyen deleted the DHIS2-14694-41 branch December 11, 2023 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants