Merge lp://staging/~sinzui/launchpad/reimport-inactive-templates into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: j.c.sackett
Approved revision: no longer in the source branch.
Merged at revision: 16223
Proposed branch: lp://staging/~sinzui/launchpad/reimport-inactive-templates
Merge into: lp://staging/launchpad
Diff against target: 168 lines (+85/-1)
6 files modified
lib/lp/translations/interfaces/potemplate.py (+14/-1)
lib/lp/translations/model/approver.py (+9/-0)
lib/lp/translations/model/potemplate.py (+19/-0)
lib/lp/translations/tests/test_potemplate.py (+14/-0)
lib/lp/translations/tests/test_translationbranchapprover.py (+12/-0)
lib/lp/translations/tests/test_translationbuildapprover.py (+17/-0)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/reimport-inactive-templates
Reviewer Review Type Date Requested Status
j.c.sackett (community) Approve
Review via email: mp+132421@code.staging.launchpad.net

Commit message

Do not recreate inactive translation templates.

Description of the change

I created OOPS-91882635e8551f53a0bd423d85dadcd5 while investigating
question #211684. The series has inactive templates
https://translations.launchpad.net/openteacher/3.x/+templates
and translation syncing is not seeing the two new POTS. I requested a
one-time import to see if a rescan would find the missing pots. Instead
the log shows an oops because org.openteacher.dialogs.updates is
inactive.
    IntegrityError: duplicate key value violates unique constraint
        "potemplate__productseries__name__key"
    DETAIL: Key (productseries, name)=(40409, org.openteacher.dialogs.updates)
    already exists

--------------------------------------------------------------------

RULES

    Pre-implementation: no one
    * POTemplates are unique to (productseries, name) and
      (distroseries, sourcepackagename, name). The are created by calling
      POTemplateSubset.new().
    * Calls to new() assumes that the set represents the full
      set of templates in a series, but since the set can be initialised
      with iscurrent=True, all the inactive POTemplates are ignored.
    * A bug was fixed 2 years ago that requires the set to iscurrent=True
      to properly work with the found files, but the calls to make new
      POTemplates still think the set is unfiltered.
    * Add a guard to POTemplateSubset.new() that checks the unfiltered
      series-package set, eg iscurrent=None, and raise ValueError to
      ensure we see the TB, not the Postgresql transaction error.
    * POTemplateSubset.new() is called in several places in approver.py,
      and each call is using a different strategy to determine if it
      must create a new template. Some strategies do not know the name
      unitl late in the process.
    * Before calling new(), the code must check if the proposed series,
      package, name combination exists and choose an exit strategy if
      it does.

QA

    * Visit https://translations.qastaging.launchpad.net/openteacher/3.x
    * Choose "Change synchronization settings", then
      "You can request a one-time import.", then "Request a one-time import"
    * Ask a webops to run cronscripts/rosetta-branches.py on qastaging.
    * Ask for the output of check there there is no oopse for "teacher".

LINT

    lib/lp/translations/interfaces/potemplate.py
    lib/lp/translations/model/approver.py
    lib/lp/translations/model/potemplate.py
    lib/lp/translations/tests/test_potemplate.py
    lib/lp/translations/tests/test_translationbranchapprover.py
    lib/lp/translations/tests/test_translationbuildapprover.py

To post a comment you must log in.
Revision history for this message
j.c.sackett (jcsackett) wrote :

Looks good. Thanks, Curtis.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.