guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

add a `restoreFromReplica` endpoint to `image-loader` #4128

Closed twrichards closed 1 year ago

twrichards commented 1 year ago

REQUIRES https://github.com/guardian/grid/pull/4130

https://trello.com/c/ffAUNID4/1621-lazarus-mechanism-to-restore-deleted-grid-images-from-replica-bucket

Related https://github.com/guardian/grid/pull/4125 (closed, since unlike this PR it didn't reinstate the image file in the image bucket, nor did it recreate thumbs or optimised image, which will have been deleted during reaping).

Following on from the excellent https://github.com/guardian/grid/pull/4116. Adds a similar looking mechanism, but to reload the file from the 'replica bucket' (see https://github.com/guardian/editorial-tools-platform/pull/696 for more about replica buckets). It then layers on top user edits etc. from Dynamo (thanks to https://github.com/guardian/grid/pull/4130).

The approach in this PR preserves the original uploadTime, uploadedBy and original filename.

This should help us restore images quickly which have been hard deleted by mistake (perhaps by reaper) - so long as we have the ID of course.

Requires new (optional) bit of image loader config s3.image.replicaBucket. Added in...

twrichards commented 1 year ago

demoed/tested with @andrew-nowak in TEST

prout-bot commented 1 year ago

Seen on metadata-editor, cropper, usage (merged by @twrichards 9 minutes and 49 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on auth, image-loader, media-api (merged by @twrichards 9 minutes and 55 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on thrall, kahuna (merged by @twrichards 10 minutes and 6 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on collections, kahuna (merged by @twrichards 10 minutes and 6 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on thrall, kahuna (merged by @twrichards 10 minutes and 6 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on leases (merged by @twrichards 10 minutes and 10 seconds ago) Please check your changes!

prout-bot commented 1 year ago

Seen on leases (merged by @twrichards 10 minutes and 10 seconds ago) Please check your changes!