Skip to content

Commit

Permalink
Add temporary rake task to cleanup Whitehall Frontend documents
Browse files Browse the repository at this point in the history
All public rendering has been removed from Whitehall, therefore no
content items should exist that believe they should be rendered by
Whitehall Frontend.

A mismatch currently occurs where router believes these items of content
should be redirected, but Content Store has a content item for them
(e.g. policy areas).

Presumably a temporary rake task or something on a console was run at
some distant point in the past to implement the redirects in router, but
the content items were never removed.

Three issues were caused:
- users can access the content items still, even though the content has
  been changed/withdrawn/moved
- running the `register:routes` rake task in Content Store will result
  in `whitehall-frontend` being registered with router, even though it
  no longer exists
- it's causing us to believe Whitehall Frontend still renders things
  when updating [these
  pages](https://docs.publishing.service.gov.uk/document-types.html) in
  the dev docs

This completes that clean-up.
  • Loading branch information
brucebolt committed Aug 15, 2023
1 parent d3d48e6 commit 37226dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/tasks/temp_cleanup_whitehall_frontend.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
desc "Removes all legacy content items that were rendered by Whitehall Frontend"
task cleanup_whitehall_frontend: :environment do
ContentItem.where(rendering_app: "whitehall-frontend").delete_all
end

0 comments on commit 37226dc

Please sign in to comment.