cleanup product-details usage



3 years ago
a year ago


(Reporter: willkg, Assigned: willkg)



MDN uses django-mozilla-product-details 0.7.1 <> for maintaining details about Mozilla products (locales, versions, etc). It has a Django management command which is kicked off via cron.

In bug #1238696, we looked into how Kuma uses it and determined that there's no reason we should be updating product-details via cron.

This work blocks the transition to AWS. It shouldn't otherwise affect anything.

This bug covers:

1. Changing the deploy script to update product-details as part of the deploy process.

2. Nixing the cron job.

3. Figure out what to do about kuma/languages.json, settings.LANGUAGES and kuma/core/ which both use product-details languages are probably out of sync currently, but have bootstrapping requirements so we probably can't just fix them both to look at product-details.
Summary: move update_product_details cron job to celery → cleanup product-details usage
Depends on: 1245616
Step 2 is covered in bug #1245616.

Step 1 is pretty straight-forward.

Step 3 is nuanced. I'm thinking of doing this:

1. Nix kuma/languages.json since at best it's a copy of what's in product-details and at worst, it's an out-of-date copy of product-details.

2. Fix settings.LANGUAGES. I think there are two options:

   2.1. change the code in settings.LANGUAGES to open the product-details languages.json file directly
        rather than the kuma/languages.json file

   2.2. change the code to use code they suggest in the README:

        class LazyLangs(list):
            def __new__(self):
                from product_details import product_details
                return [(lang.lower(), product_details.languages[lang]['native'])
                        for lang in MY_LANGUAGES]
        LANGUAGES = lazy(LazyLangs, list)()

        Course, that won't work if LANGUAGES gets used before bootstrap is finished.

Then we leave kuma/core/ as it is.

I think I want to go with item 2.1.

Jannis: Do you have a preference for either 2.1 or 2.2? Other better ideas?
Flags: needinfo?(jezdez)
I decided to go with item 2.1 since it's close to the existing behavior without the possibility of going out-of-date. Fewer changes good. Figured I'd just move that forward, so tossing it in a PR.

In a PR:

Comment 3

3 years ago
Commits pushed to master at
Fix bug 1244853: Add update_product_details to deploy

This adds updating product details to the deploy script. It'll update
the files, then push all the files out to all the servers in the
Fix bug 1244853: Nix languages.json

This nixes kuma/languages.json and the thing that was using it.

At best, kuma/languages.json was a copy of the file in product-details
which we now pull down during deploys. At worst, it's an out-of-date
copy of the file in product-details which means that
settings.LANGUAGES and kuma/core/
could be out of sync causing who knows what mischief and mayhem.
Fix bug 1244853: Tweak provisioning for product-details

This adds the -f flag for updating product-details during
provisioning. It forces the creation of things without asking.


3 years ago
Last Resolved: 3 years ago
Resolution: --- → FIXED
Flags: needinfo?(jezdez)

Comment 4

a year ago
Commits pushed to master at
bug 1244853: Remove PROD_DETAILS_DIR
Merge pull request #4459 from jwhitlock/rm-prod-details-1244853

bug 1244853: Remove PROD_DETAILS_DIR
You need to log in before you can comment on or make changes to this bug.