#6848 Coalesce scripts/migrations/*trove*.py into command/create_trove_categories.py

asf_release_1.1.0
closed
nobody
42cc (375)
General
2015-02-03
2013-11-05
Dave Brondsema
No

command/create_trove_categories.py sets up the initial trove categories. Over time we've created several migrations to update the trove categories, but few (if any) of those changes are in the command/create_trove_categories.py So when you start a new instance of Allura, you don't have the latest (unless you run all the migrations).

So we should take all the changes specified in these files, and update command/create_trove_categories.py to set them all up properly there. Be very careful! :)

scripts/migrations/014-add-trove-category-agpl.py
scripts/migrations/016-add-trove-category-lppl.py
scripts/migrations/017-sync-trove-categories.py
scripts/migrations/019-set-parent-only-troves.py
scripts/migrations/021-add-new-trove-license-categories.py
scripts/migrations/023-add-new-trove-license-category.py
scripts/migrations/030-set-trove-show_as_skill.py

The end result should be that the trove_category collection is the same after running NEW command/create_trove_categories.py, compared to OLD command/create_trove_categories.py PLUS all migrations.

Related

Tickets: #4437
Tickets: #6843
Tickets: #7628

Discussion

  • Dave Brondsema
    Dave Brondsema
    2013-11-06

    • Labels: --> 42cc
    • Status: open --> in-progress
     
  • scripts/migrations/019-set-parent-only-troves.py talks to sfx database to select trove categories with parent_only==1, adn than sets parent_only = True on corresponding categories in Allura db. I wonder if we could drop this and use a hardcoded list of ids in new trove command (fetched once from sfx db) to avoid dependency on sfx. What do you think?

     
  • Dave Brondsema
    Dave Brondsema
    2013-11-08

    Yes, definitely.

     
  • Closed #483. je/42cc_6848

    How I tested:

    • checkout master and run command + each migration in order
    • dump trove_collection to a file: mongo pyforge dump_trove.js > before.json (dump_trove.js in attachments)
    • checkout je/42cc_6848, run command again
    • mongo pyforge dump_trove.js > after.json
    • diff before.json after.json mustn't show any differences
     
    Attachments
    • status: in-progress --> code-review
     
    • QA: Tim Van Steenburgh
    • Milestone: forge-backlog --> forge-jan-10
     
    • status: code-review --> closed