guardian / media-atom-maker

A tool for creating media atoms, including a UI specifically for managing video
https://video.gutools.co.uk/videos
4 stars 3 forks source link

Do not bump `revision` twice when content is published #1130

Closed jonathonherbert closed 1 year ago

jonathonherbert commented 1 year ago

What does this change?

At the moment, publishing content bumps the revision once for the published content, and twice for the draft content. This is because both the publish and update commands increment the revision number – the publish command passes an atom that's already been incremented into an update command.

This PR has the publish command delegate revision changes to the update action, and uses the output of the update action as the content to publish. As a result

How to test

(There aren't any unit tests that cover DB behaviour that I can see 😢. But the change is fairly simple)

prout-bot commented 1 year ago

Seen on PROD (created by @jonathonherbert and merged by @Georges-GNM 8 minutes and 49 seconds ago) Please check your changes!