Closed Bug 1954789 Opened 1 year ago Closed 1 year ago

Support Transitioning the Vocab Configuration for Models

Categories

(Firefox :: Translations, task)

task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: nordzilla, Assigned: nordzilla)

Details

Attachments

(2 files)

Description

There may be situations where we and to introduce a minor version bump to a model, e.g. 2.0 => 2.1 that changes the configuration of the model from using a shared vocab to a split vocab, or the converse.

In such a case, this would leave the shared v2.0 vocab file in Remote Settings, while publishing all new files for the v2.1 configuration. With our current logic, all three vocabs would be pulled in as the highest version of their respective record type:

  • vocab v2.0
  • srcvocab v2.1
  • trgvocab v2.1

And this will cause us to throw an error due to all three vocab files being loaded, when the reality is that we should be ignoring the vocab v2.0 file due to not matching the current highest version, even though it is, itself, the highest version shared-vocab record that exists.

We need to add extra logic to guard against this scenario, and ensure that only the files matching the current configuration are pulled from Remote Settings.


Steps to Implement

  • Add an extra guard that ensures only files matching the max-version "model" file-type record are pulled from Remote Settings.

Tests to Implement

  • Add a test that ensures the correct configuration is pulled from Remote Settings when bumping a model's minor version from shared to split vocab.
  • Add a test that ensures the correct configuration is pulled from Remote Settings when bumping a model's minor version from split to shared vocab.

Renames a few variables, improving readability, and making
logical changes of the subsequent patch easier to follow.

This ensures that our source code can cleanly handle the versioning
considerations if a Translation model configuration gets a minor-version
update transitioning from a shared vocab config to a split vocab config,
or the converse.

Attachment #9472764 - Attachment description: WIP: Bug 1954789 - Misc. Translations Variable Renames r=#translations-reviewers! → Bug 1954789 - Misc. Translations Variable Renames r=#translations-reviewers!
Attachment #9472765 - Attachment description: WIP: Bug 1954789 - Support updating vocab config for models r=#translations-reviewers! → Bug 1954789 - Support updating vocab config for models r=#translations-reviewers!
Pushed by enordin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b21a476965aa Misc. Translations Variable Renames r=translations-reviewers,gregtatum https://hg.mozilla.org/integration/autoland/rev/219ef506bd05 Support updating vocab config for models r=translations-reviewers,gregtatum
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: