-
Notifications
You must be signed in to change notification settings - Fork 359
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 sortOrder 1-indexed #19937
base: master
Are you sure you want to change the base?
Conversation
@vietnguyen please hold on merging this. I spoke with Calle at length about this, and at the time, he felt that 1-indexed made more sense (which I agree with). Having said that, there are many systems out there which are 0-indexed (as this was the previously default). Nowadays, I do not think it matters in principle if option sets start with 0 or 1, both work. Calle felt strongly they should start with 1, as this made more sense intuitively. If the integrity checks are flagging incorrectly option sets which start with 0, then we need to fix the integrity check. Its not clear from the PR how or if we intend to "upgrade" old option sets which do start with zero. Thoughts? |
@jason-p-pickering I think there will be no issue for the api consumer. Sorting function won't throw error if index start from 1. This fix only affects the update action. So if no update request to OptionSet then the sort order remain the same. Let me know if you decide to update the integrity check so I can close the PR and jira ticket. |
|
@vietnguyen I have adjusted the data integrity check now so that option sets with sort orders of either 0 or 1 will be accepted. Given that, I am not sure we really need this PR, but I am not totally opposed to it, as I think there is something to be said to keep things "tidy" by having the option set sort orders start at 1. @jbee might have thoughts here as well. |
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.
To me this is a technical solution and even if the value is available in the API we never made any commitment to either starting value (I hope). I think this should be one of those things we can change whenever we want to whatever we want but product might have a different opinion on this so I suggest to consult with David K.
https://dhis2.atlassian.net/browse/DHIS2-18473
Issue
Fix
Test