Remove a change note in Whitehall
Change notes are called editorial remarks in Whitehall. An Edition can
have multiple editorial remarks and they are visible only in Whitehall
Admin. However, an Edition in the Publishing API can only have one change_note
, which is public-facing. The Publishing API creates a list of all the change notes
from all versions of the edition and presents them to the Content Store.
You can read more about this in the Publishing API docs.
Remove a change note
You need to determine whether the request is referring to an editorial_remark
in Whitehall Admin, or to a public-facing change_note
in Publishing API.
Editorial Remark
- Obtain the content ID of the document on which the change note was created.
This document will contain multiple editions. You need to extract the
editorial_remark
from these editions. - Create a data migration in Whitehall docs here
- In the data migration, search for the document by the content ID and
extract the
editorial_remark
that contains the text you are looking to delete. - If such an editorial remark is present, then destroy the
editorial_remark
and check that it is no longer displayed.
Change Note
Rake Tasks exist in both Publishing API and Whitehall to quickly remove change notes for a document. The tasks take a content id, content locale and the text of the change note. There are two interfaces for dry and real runs, to ensure the correct change note is being targetted before removing it.
Note
It performs a fuzzy-search of the change note text, and will return the first best match. So searching for generic words such as "Update" may not return the exact ChangeNote you desire. It is advised to use the dry run first to ensure the correct ChangeNote will be deleted.
Publishing API
Note
Individual publishing apps may have their own equivalent of this task. If possible, remove change notes in the specific publishing application: use this Publishing API task as a last resort!
Dry run
$ bundle exec 'data_hygiene:remove_change_note:dry[content_id,locale,change note text]'
This attempts to locate the selected change note for the content, and if found, report to the user the change note object that would have been removed.
Real run
$ bundle exec 'data_hygiene:remove_change_note:real[content_id,locale,change note text]'
This will actually delete the selected change note and re-represent to the content store, also updating the edition history.
Whitehall
Dry run
$ bundle exec 'data_hygiene:remove_change_note:dry[content_id,locale,change note text]'
This attempts to locate the selected change note for the content, and if found, report to the user the change note text that would have been removed.
Real run
$ bundle exec 'data_hygiene:remove_change_note:real[content_id,locale,change note text]'
This will downgrade the edition to a minor change
, set the change note text to nil
and the major_change_published_at
to the previous major change. It then re-represents to the content store with the updated edition history.