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

Upgrade Editorial permissions library to latest version #1142

Closed rtyley closed 7 months ago

rtyley commented 8 months ago

This upgrades the Media Atom Maker to use the latest version of the client for the Guardian's Editorial Permissions service - we need the latest version of the client to support the upgrade to Scala 2.13 in https://github.com/guardian/media-atom-maker/pull/1140

Permissions library versions

As you can see, the permissions client has moved repositories, to the main permissions repo - this happened in July 2018 with PR https://github.com/guardian/permissions/pull/103. This PR is also important because it removed use of Future from the permissions client API - as Michael Barton explained, permission lookups should be mostly instantaneous because they now come from an in-memory cache.

The removal of Future means that this PR, upgrading Media Atom Maker, needs to remove several for-comprehensions/map-statements. The diff on these can look quite big, but they look smaller if whitespace changes are ignored. I've taken the opportunity to do small refactors to improve code clarity and remove repetition.

Permission to modify Privacy Status of a published Media Atom

In particular, the code around modifying Privacy Status of a Media Atom had to be changed because it involved removing Future, but I also included refactoring to make the code clearer. When reviewing this, you may want to look at the original PRs that introduced this logic:

prout-bot commented 7 months ago

Seen on PROD (merged by @rtyley 6 minutes and 26 seconds ago) Please check your changes!