-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IA Refresh: Scripts to add redirects and move Wagtail pages #6026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These scripts run properly for me.
If I run the validate_redirects
script introduced in #6023, I expect to see half of the tests pass (the ones covered by this PR) and half fail (the ones to be covered by #6024). There are some unexpected failures, though, which I think are due to a missing content step. Will follow up about that offline.
Thanks to your suggested fix in the source spreadsheet, this is no longer an issue. |
9277cf6
to
30ef08b
Compare
4d77d4a
to
179ba09
Compare
Also, if the page should be moved to a new slug, make that change too.
- improve logging messages - order list of redirects by page ID - use atomic transactions when adding and deleting redirects - use atomic transactions when moving pages to new slugs and locations
179ba09
to
8117662
Compare
Add three scripts that we will use to update consumerfinance.gov to its new IA next week.
pages_to_redirect
, which takes a CSV of top-level pages that will move along with their children. Generates a full list of all URLs that will require Wagtail redirects.add_wagtail_redirects
, which takes the output ofpages_to_redirect
and uses it to add all necessary Wagtail redirectsmove_wagtail_pages
, which takes the same CSV aspages_to_redirect
and moves all Wagtail pages to their new URLs.How to test this PR
cfgov/manage.py runscript pages_to_redirect --script-args [redirects_spreadsheet.csv]
redirects_list.csv
with ~38 rows.cfgov/manage.py runscript add_wagtail_redirects --script-args redirects_list.csv
redirects_list.csv
file. If you run it again, it will delete the redirects and create new ones. It won't cause duplication.cfgov/manage.py runscript move_wagtail_pages --script-args [redirects_spreadsheet.csv]
Checklist