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.
scripts/migrations/019-set-parent-only-troves.py
talks to sfx database to select trove categories withparent_only==1
, adn than setsparent_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?Yes, definitely.
Closed #483.
je/42cc_6848
How I tested:
mongo pyforge dump_trove.js > before.json
(dump_trove.js
in attachments)je/42cc_6848
, run command againmongo pyforge dump_trove.js > after.json
diff before.json after.json
mustn't show any differences