-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
ICU-22917 Generating / updating the units data is a very clunky and manual process #3262
ICU-22917 Generating / updating the units data is a very clunky and manual process #3262
Conversation
TBD / Asking for opinions:
|
Hi Dragan, I would especially appreciate your input, as you had to do this several times recently. Even better if you can spend 10 minutes or so to try it. Separately, see my questions in the previous comment. Thank you, |
First, thank you very much for doing this. Any improvement in this process of updating units is very welcomed! I wish I could have better answers, but my experience with this code is mostly based on the latest digging and trying to figure out what it actually does and how it works. Having said that, I am pretty sure that those two versions should be the same. In the previous workflow, there was a lot of manual updating of those versions values before running the unit test to get the proper output, so it is very possible that I didn't update it with 76 because I had that last minute battle to get the latest units in. How it worked out was, one had to manually uncomment the line targeted for generating a particular code, update the version, then comment it back. Rinse and repeat for several lines. |
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.
For this PR, when it's all done, please do not squash it down to one commit. IMO the first commit should be separate. Other commits should probably be squashed though.
...j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitCompatibleTest.java
Outdated
Show resolved
Hide resolved
icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitGeneratorTest.java
Outdated
Show resolved
Hide resolved
icu4j/main/common_tests/src/test/java/com/ibm/icu/dev/test/format/MeasureUnitGeneratorTest.java
Show resolved
Hide resolved
ACK. I thought so too. |
Implemented (almost all) review feedback. |
About version: I took git-clone(d) the repo, then did a git checkout on each release-* tag starting with release-60, all the way to release-76-1. Including RC and betas and what not. And in most of them the version in the Java file matches the ICU version (in the git tag). In all cases (60-76) all generators were called with the same version, except ICU 76. So I changed the code to get the ICU version automatically. |
Any opinions about where to put the generated files? Right now they go in So if you do a
They are more discoverable, but there is a risk that they are added to the repo if nobody notices them in review. I can put them in |
ok |
DONE |
Everything from Markus is implemented. |
@markusicu: OK if I squash this in 2 commits (renames / split files, and all the rest) Thanks, |
sgtm |
1773170
to
e967399
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Squashed to 2 commits. |
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.
(partial rs)lgtm
Before these changes the measurement unit code updates were generated from a unit test
to standard output, and had to be enabled / disabled one by one.
Although not 100% automated, after this change the tests are enabled by a flag,
and the result go to some temporary files that can be opened in editor, diff-ed, etc.
Something like an 80% improvement with a 20% effort.
Doing more becomes tricky.
In some cases the old code should be changed, or not.
In others new methods get added to files, if they don't already exist.
Or replace the old method if different.
And that would require parsing Java and C++ files to determine what is there, and how much to delete.
Checklist
ALLOW_MANY_COMMITS=true