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-18217 Add CLDRFile Iterable interface option to include extra paths by default #4371

Merged
merged 3 commits into from
Feb 16, 2025

Conversation

btangmu
Copy link
Member

@btangmu btangmu commented Feb 12, 2025

-Private boolean CLDRFile.DEFAULT_ITERATION_INCLUDES_EXTRAS determines whether to skip extras; either way they skip paths with null values

-Rename old iterator iteratorWithoutExtras

-Iterable and iterator are distinct, as in iterableWithoutExtras versus iteratorWithoutExtras

-Call iteratorWithoutExtras/iterableWithoutExtras directly where tests would otherwise fail with DEFAULT_ITERATION_INCLUDES_EXTRAS true

CLDR-18217

  • This PR completes the ticket.

ALLOW_MANY_COMMITS=true

…fault

-Private boolean CLDRFile.DEFAULT_ITERATION_INCLUDES_EXTRAS determines whether to skip extras; either way they skip paths with null values

-Rename old iterator iteratorWithoutExtras

-Iterable and iterator are distinct, as in iterableWithoutExtras versus iteratorWithoutExtras

-Call iteratorWithoutExtras/iterableWithoutExtras directly where tests would otherwise fail with DEFAULT_ITERATION_INCLUDES_EXTRAS true
@btangmu
Copy link
Member Author

btangmu commented Feb 12, 2025

I'm not sure whether this should go into v47 or wait for v48. Another option would be to make DEFAULT_ITERATION_INCLUDES_EXTRAS false for v47 (preserving current behavior), and change it to true for v48. There are risks either way. Changing a lot of paths to extra paths (without code-fallback values) has increased the risk that some unknown bugs exist due to skipping extra paths. Including extra paths in iteration could also introduce bugs. Either way, the bugs in question aren't covered yet by unit tests, and they could be tools that are run infrequently.

@macchiati
Copy link
Member

Let's not change behavior from v46.1 this late in the game.

@btangmu
Copy link
Member Author

btangmu commented Feb 12, 2025

Let's not change behavior from v46.1 this late in the game.

Understood. What do you think about making DEFAULT_ITERATION_INCLUDES_EXTRAS false, and merging it that way?

@macchiati
Copy link
Member

macchiati commented Feb 12, 2025 via email

private Iterator<String> extraPaths;

FullIterable(CLDRFile file) {
this.file = file;
this.fileIterator = file.iterator();
this.fileIterator = file.dataSource.iterator(); // file.iteratorWithoutExtras();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
this.fileIterator = file.dataSource.iterator(); // file.iteratorWithoutExtras();
this.fileIterator = file.iteratorWithoutExtras();

would it be better to use the function for documentation?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea. And I'll rename fileIterator to iteratorWithoutExtras to make it clear and consistent.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've done that, in the 2nd commit

…rectly

-Also for clarity, rename FullIterable.fileIterator to FullIterable.iteratorWithoutExtras
@btangmu
Copy link
Member Author

btangmu commented Feb 14, 2025

Only if we verify that there are no differences in resolved values.

Yes, that's wise. Locally, I will generate VXML, and also run GenerateProductionData and confirm no differences...

-Keeping DEFAULT_ITERATION_INCLUDES_EXTRAS false for now seems safest if we merge this for v47
@btangmu
Copy link
Member Author

btangmu commented Feb 14, 2025

The 3rd commit makes DEFAULT_ITERATION_INCLUDES_EXTRAS false

@btangmu
Copy link
Member Author

btangmu commented Feb 14, 2025

Locally, with these changes to CLDRFile (including DEFAULT_ITERATION_INCLUDES_EXTRAS false), I generated VXML by logging in as Admin and choosing Generate VXML from the main menu. Then I copied the VXML to common/main and ran GenerateProductionData. Then I repeated those steps on the main branch, with a different destination directory. Comparing the destination directories, both for VXML and for production, resulted in zero differences.

@btangmu btangmu requested review from macchiati and srl295 February 14, 2025 19:33
@btangmu btangmu changed the title CLDR-18217 Make CLDRFile Iterable interface include extra paths by default CLDR-18217 Add CLDRFile Iterable interface option to include extra paths by default Feb 14, 2025
@macchiati
Copy link
Member

Thanks!

@btangmu btangmu merged commit bad1c00 into unicode-org:main Feb 16, 2025
12 checks passed
@btangmu btangmu deleted the t18217_e branch February 16, 2025 21:37
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