Work around bug with change notes publication
Work around bug with change notes publication

Turns out that change notes are published on the publish event after the
one that publishes the content they describe the change for.  This is
because:

1. PublicationLogs are used to build the change_notes array in the
   publishing-api representation of the manual.
2. PublicationLogs for the current changes to the manual content are
   written on the publish event.
3. The publishing-api representation of the manual is written when we
   save the draft of the manual.
4. Publishing a manual does not write a new draft of the manual it
   only tells the publishing-api to promote the current draft to live.

The workaround in the features is to publish the manual twice before
we check if the change note is present in a draft on the publishing-api.

This bug has been written up as: https://trello.com/c/WpgrE9ge/66-change-notes-in-manuals-publisher-are-sent-to-the-publishing-api-on-the-wrong-publish-event

alphagov/manuals-publisher,alphagov/manuals-publisher,alphagov/manuals-publisher