Repository navigation
Re-parse Fluent values left stale by the moz.l10n 0.15.0 update - #4705
Open
matthewalberto wants to merge 1 commit into
Open
matthewalberto wants to merge 1 commit into
matthewalberto wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4699
The source entities and translations of some Fluent strings still hold a value in the shape moz.l10n produced before 0.15.0 (
sel: ['hours_1'], afluent-fn: NUMBERattribute on a plain placeholder). A fresh parse of the samestringgivessel: ['hours']and no attribute. When an editor saves a translation it copies that old shape, so the next sync sees a different value, creates a second approved translation with the same string and rejects the editor's one.#4611 changed the parse output without a migration, so this adds one in the same way as
0122_reparse_multi_pattern_fluentand0135_fix_fluent_function_names. It is migration-only, as asked on the issue:translations_equalis not touched.What the migration does:
EntityandTranslationwhosestringcontains a{, because only a message with an expression can have a changed shape.valueorpropertiesdiffer from the fresh parse, in batches of 1000.Testing:
pontoon/base/tests/migrations/test_reparse_stale_fluent_values.py. One makes an entity and a translation stale in the shape from the issue and checks both are rebuilt to the fresh parse. The other checks that an up-to-date Fluent entity, a Fluent entity with no expression, and a non-Fluent entity are left as they were.pytest pontoon/base/tests/migrationspasses (3 tests) against PostgreSQL 16, andruff checkandruff format --checkare clean.Not tested: a run against a production-sized database, so I can't say how long it takes there.