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

CLDR-13970 Update ExampleDependencies and related code #3371

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Oct 28, 2023

-Bug fix: when generating example dependencies, disable caching in ICUServiceBuilder to prevent some dependencies from being missed

-New cldr.util.GenerateExampleDependencies replaces old cldr.test.TestExampleDependencies

-Include DO NOT EDIT comments in ExampleDependencies.java, clarify it is generated

-Bug fix: prevent NullPointerException in ExampleGenerator.getOtherGender/getOtherCase

-Bug fix: OpenAPI validation CWWKO1650E missing description for 404 in UserAPI.java (unrelated)

-Remove dead code, fix warnings

-Comments

CLDR-13970

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

-Bug fix: when generating example dependencies, disable caching in ICUServiceBuilder to prevent some dependencies from being missed

-New cldr.util.GenerateExampleDependencies replaces old cldr.test.TestExampleDependencies

-Include DO NOT EDIT comments in ExampleDependencies.java, clarify it is generated

-Bug fix: prevent NullPointerException in ExampleGenerator.getOtherGender/getOtherCase

-Bug fix: OpenAPI validation CWWKO1650E missing descriptino for 404 in UserAPI.java (unrelated)

-Remove dead code, fix warnings

-Comments
@btangmu btangmu self-assigned this Oct 28, 2023
@btangmu
Copy link
Member Author

btangmu commented Oct 28, 2023

This fixes problems with generating the dependencies, where the example for one path depends on the values for other paths. Some dependencies were formerly missed due to caching. The resulting file ExampleDependencies.java is now complete (as far as I can tell), and it can be kept up to date by running GenerateExampleDependencies when necessary (probably just before each time Survey Tool is opened for submission), as follows:

java -DCLDR_DIR=$(pwd) -jar tools/cldr-code/target/cldr-code.jar generate-example-dependencies

Unfortunately, there are still failures to update examples in the running Survey Tool. I suspect this is still due to caching, so that even though examples are regenerated, they're regenerated using outdated cached values -- not cached examples, but cached values (for names of months, etc.) in ICUServiceBuilder and/or elsewhere. I've added a new boolean constant ISB_CAN_CLEAR_CACHE for testing this hypothesis. So far, it looks like even when testing with ISB_CAN_CLEAR_CACHE true (which probably goes too far and has a bad effect on performance), the examples are still not regenerated correctly.


public void setCacheOnly(boolean cacheOnly) {
exCache.setCacheOnly(cacheOnly);
icuServiceBuilder.setCachingEnabled(enabled);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most essential change, used with enabled = false only by GenerateExampleDependencies, not while ST is running

@btangmu btangmu marked this pull request as ready for review October 28, 2023 20:53
@btangmu btangmu requested review from srl295 and pedberg-icu October 28, 2023 20:54
@btangmu
Copy link
Member Author

btangmu commented Oct 28, 2023

GenerateExampleDependencies now takes about an hour, where it used to take about 20 minutes.

The resulting file is about twice as large, and it would be about 4 times as large were it not for using putAll instead of put.

@btangmu
Copy link
Member Author

btangmu commented Oct 28, 2023

We should add a BRS task for GenerateExampleDependencies, at least once before each time ST is opened for submission.

@btangmu btangmu merged commit 8a08cc7 into unicode-org:main Oct 31, 2023
7 checks passed
@btangmu btangmu deleted the t13970_b branch October 31, 2023 13:35
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.

2 participants