Clear TranslationMessage.potemplate fields for source_file_format == XPI

Bug #308913 reported by Данило Шеган
4
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Jeroen T. Vermeulen

Bug Description

After doing bug 299968 and bug 300664, we need to clean up potemplate fields for the English "translations" of XPI templates (since these will be used as English msgids in XPI files).

Changed in rosetta:
milestone: none → 2.2.1
Changed in rosetta:
assignee: nobody → jtv
Changed in rosetta:
importance: Undecided → High
status: New → Triaged
description: updated
Changed in rosetta:
milestone: 2.2.1 → 2.2.2
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Doing this as an addition to the message-sharing-populate script.

Changed in rosetta:
status: Triaged → In Progress
Changed in rosetta:
milestone: 2.2.2 → 2.2.3
Changed in rosetta:
milestone: 2.2.3 → 2.2.4
Changed in rosetta:
milestone: 2.2.4 → 2.2.5
Changed in rosetta:
milestone: 2.2.5 → 2.2.6
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

This only affects some 25K messages; should be no trouble performance-wise to do it in one SQL query à la...
{{{
UPDATE TranslationMessage
SET potemplate = NULL
FROM POTemplate
WHERE
    POTemplate.path LIKE '%.xpi' AND
    language = 119
}}}

Doing so currently violates no unique constraints either, but it may cause duplications that we don't currently check for.

We do seem to have some 70K "en" TranslationMessages in the database that are not from XPI templates. We should probably delete those.

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Ahem. Slight omission in the example query above, of course: POTemplate.id = TranslationMessage.potemplate. So it becomes
{{{
UPDATE TranslationMessage
SET potemplate = NULL
FROM POTemplate
WHERE
    POTemplate.id = TranslationMessage.potemplate AND
    POTemplate.path LIKE '%.xpi' AND
    language = 119;
}}}

The update currently creates no duplicates and takes about a minute to run, updating 25K rows.

Changed in rosetta:
milestone: 2.2.6 → 2.2.7
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

As could be expected, the number of diverged "en" messages from XPI templates has gone down through natural attrition—fresh template imports produce shared English "translations."

Looking at just the current-or-imported messages for current templates, the numbers are:

 - 11397 messages in Hardy
 - 5706 messages in Intrepid
 - 0 messages in Jaunty (though still 2 non-current, non-imported diverged messages)
 - 2082 messages in midbrowser trunk

Does this bug still matter? Or should we just let it go away by itself?

Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

The bug pretty much goes away by itself.

Changed in rosetta:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.