Jira (PUP-8090) Load module translation files

3 views
Skip to first unread message

Maggie Dreyer (JIRA)

unread,
Oct 25, 2017, 2:07:05 PM10/25/17
to puppe...@googlegroups.com
Maggie Dreyer created an issue
 
Puppet / Sub-task PUP-8090
Load module translation files
Issue Type: Sub-task Sub-task
Assignee: Unassigned
Created: 2017/10/25 11:06 AM
Priority: Normal Normal
Reporter: Maggie Dreyer

Currently we are naively loading modules' translations whenever a Ruby instance of the Module class is created, in a way assumes that the locale files are located within the module's installed directory. This works on the master and when doing things like puppet apply, but agent runs get their data from $vardir, which is populated by pluginsync. We need to add hooks to load module translations from $vardir after pluginsyncing, and make sure we check both places (installed modules and $vardir) when invoking puppet applications, to ensure we get translations when and where we need them. This ticket mostly entails getting correct translation behavior, over optimizing, which is covered in PUP-8024.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe)
Atlassian logo

Maggie Dreyer (JIRA)

unread,
Oct 25, 2017, 2:10:03 PM10/25/17
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Acceptance Criteria: Module translations show up during an agent run _and_ when using puppet's CLI applications.
Team: Platform Core

Maggie Dreyer (JIRA)

unread,
Nov 1, 2017, 3:21:04 PM11/1/17
to puppe...@googlegroups.com
Maggie Dreyer commented on Sub-task PUP-8090
 
Re: Load module translation files

So the way I'm reading the autoloader and fact loader code, it looks like for Ruby files, we load files from locally installed modules first, then pluginsynced stuff. Conversely for facts, we load pluginsynced stuff first, then local custom facts.

In the case where there are no duplicate modules (and therefore no duplicate translations), this is fine. But it raises an interesting trade-off if there are both local and pluginsynced copies of data with the same name. The way we currently handle translation files, we only allow loading a PO file with a given name once. This means in the case where a user both has a module installed locally and has translations from a module of the same name pluginsynced, we will only load translations from whichever source we search first. Translations for all parts of a module (stuff in lib, facts, and manifests) are all loaded as one atomic PO file, one per module, so we can't choose different load orders from different parts. This could lead to surprising gaps in translations, that might be different across different operations.

The alternative is to change the way we construct the text domains, to allow multiple repositories of the same name in a chain (note that the repository name HAS to correspond to the name of the PO file being loaded). We currently don't allow this because in the model where we were loading translations each time a module was loaded, this would have led to explosion of translations in memory, as well as tons of extra work. As we move to being more efficient about what we load and when, this might have less of an impact, but it could still lead to unnecessary duplicates, and it will remove any limit on the size of the repository chains (if we accidentally load things more times than we think we are, we will see the chains get very long). The benefit, however, is that we always will have all translations available in cases where we need to search both $modulepath and $vardir.

Michael Smith or Josh Cooper thoughts?

This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db)
Atlassian logo

Michael Smith (JIRA)

unread,
Nov 1, 2017, 4:20:04 PM11/1/17
to puppe...@googlegroups.com
Michael Smith commented on Sub-task PUP-8090

We should try to load translations from both $modulepath and $vardir. I think initially, loading $vardir can skip the check to see if we've already loaded a translation file with that name.

When we rework loading translations from modules, we'll want to remove that global caching anyway, which goes hand-in-hand with being more careful about when we try to load modules and when we invalidate the existing chain.

Maggie Dreyer (JIRA)

unread,
Nov 3, 2017, 2:18:03 PM11/3/17
to puppe...@googlegroups.com
Maggie Dreyer assigned an issue to Maggie Dreyer
Change By: Maggie Dreyer
Assignee: Maggie Dreyer

Maggie Dreyer (JIRA)

unread,
Nov 21, 2017, 5:58:02 PM11/21/17
to puppe...@googlegroups.com
Maggie Dreyer commented on Sub-task PUP-8090

Turns out I missed a spot, translations were not being loaded for custom facts when using a cached catalog. PR fixing that is here: https://github.com/puppetlabs/puppet/pull/6380

Melissa Stone (JIRA)

unread,
Nov 27, 2017, 1:18:04 PM11/27/17
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Nov 30, 2017, 6:48:03 PM11/30/17
to puppe...@googlegroups.com

Henrik Lindberg (JIRA)

unread,
Dec 11, 2017, 10:09:03 AM12/11/17
to puppe...@googlegroups.com
Henrik Lindberg updated an issue
Change By: Henrik Lindberg
Fix Version/s: PUP 5.4.0

Maggie Dreyer (JIRA)

unread,
Feb 6, 2018, 5:38:02 PM2/6/18
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Release Notes Summary: Puppet will now correctly load module translations on both the agent and the server.
Release Notes: Bug Fix
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

PLJenkins (JIRA)

unread,
Jul 16, 2018, 1:51:02 PM7/16/18
to puppe...@googlegroups.com
PLJenkins updated an issue
Change By: PLJenkins
Fix Version/s: PUP 5.5.3
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

John Duarte (JIRA)

unread,
Oct 21, 2019, 10:49:04 AM10/21/19
to puppe...@googlegroups.com
John Duarte updated an issue
Change By: John Duarte
QA Risk Assessment: Needs Assessment No Action
Reply all
Reply to author
Forward
0 new messages