Skip to main content
Table of contents

Publishing

Support government changes

Change a government in Whitehall

Following a General Election or other reason for governmental change the current Government in Whitehall will need to be closed, and a new one created.

The Content Support team will normally be the ones who close the government and re-assign ministers once a new government has been opened. However, a developer will often be required to monitor the queues, as detailed below.

Closing a government

Governments are listed at the government path of Whitehall Admin.

  1. Select the current government, and click the Prepare to close this government link.
  2. Close the government.

This will close the current government and remove all ministerial appointments.

This will cause a high number of documents to be represented by the Publishing API which might mean some delays on content being up to date on the website. Previous tests have shown that it takes around 3.5 hours for the queues to clear in integration.

Grafana monitoring for:

Open a new government

Create a new government

This will instantly create a new government. Changes can be seen in the Rails console by running Government.current.

The new government should also instantly appear in the response from /api/governments.

Applying a banner to political content published by the previous government

Content in Whitehall can be marked as political. Political content which was published under a previous government is historic?. This is highlighted on the page, and in search results. This feature is also known as history mode.

See these pages for example:

A content page A search results page

Marking content as political can happen automatically through the PoliticalContentIdentifier. The political flag on an Edition can also be set manually.

There is a Rake task to reindex all political content in search. This must be done after a government is closed.

Backdating

If we need to backdate a government or split a single government into two distinct dates, we need to run a rake task to republish all political content from Whitehall to properly associate content with the government at it’s first published date:

Ending ministerial roles without closing a government

If we need to end all ministerial roles without explicitly closing a government, we can run a rake task:

This will end all ministerial roles except the Prime Minister. You might have to do that one manually.

Machinery of Government Changes

Following machinery of government changes, developers can help content designers make bulk changes to documents and users.

Bulk changing users

There is a Rake task in Signon to change the organisation that a user belongs to in bulk: data_hygiene:bulk_update_organisation[csv_file].

It accepts a CSV file which should have at least the following columns (in any order):

Column Header Description
Old email The old email address of the user.
New email The new email address of the user.
New organisation The slug of the new organisations for the user.

Note: It may be necessary to leave the old users around so they can still edit content for the old organisation. In that case you can bulk invite new users using the interface in Signon.

Bulk retagging documents

There is a Rake task in Whitehall to change the lead and supporting organisations that a document is tagged to in bulk: data_hygiene:bulk_update_organisation[csv_file].

It accepts a CSV file which should have at least the following columns (in any order):

Column Header Description
Slug The slug of the document.
New leading organisations The slugs of the new leading organisations (separated by a comma). These will replace any existing organisations.
New supporting organisations The slugs of the new supporting organisations (separated by a comma). These will replace any existing organisations.
This page was last reviewed on 27 January 2020. It needs to be reviewed again on 27 July 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 27 July 2020 by the page owner #govuk-developers. This might mean the content is out of date.