Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a restoreFromReplica endpoint to image-loader #4128

Merged
merged 5 commits into from
Aug 25, 2023

Conversation

twrichards
Copy link
Contributor

@twrichards twrichards commented Aug 1, 2023

REQUIRES #4130

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

Related #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 #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 #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...

  • TEST
  • PROD

@twrichards twrichards requested a review from a team as a code owner August 1, 2023 16:38
@twrichards twrichards marked this pull request as draft August 1, 2023 16:38
@twrichards twrichards force-pushed the loader/restore-from-replica-bucket-endpoint branch 13 times, most recently from 445ca43 to d25e3a1 Compare August 9, 2023 10:22
@twrichards twrichards force-pushed the loader/restore-from-replica-bucket-endpoint branch from 7e18a96 to 8712bec Compare August 9, 2023 10:30
@twrichards twrichards marked this pull request as ready for review August 9, 2023 10:51
Co-authored-by: Andrew Nowak <[email protected]>
@twrichards
Copy link
Contributor Author

demoed/tested with @andrew-nowak in TEST

@twrichards twrichards merged commit c4c6f59 into main Aug 25, 2023
2 checks passed
@twrichards twrichards deleted the loader/restore-from-replica-bucket-endpoint branch August 25, 2023 08:53
@prout-bot
Copy link

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

@prout-bot
Copy link

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

@prout-bot
Copy link

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

@prout-bot
Copy link

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

@prout-bot
Copy link

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

@prout-bot
Copy link

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

1 similar comment
@prout-bot
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants