-
-
Notifications
You must be signed in to change notification settings - Fork 916
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
Aws sdk #935
Conversation
So |
@@ -99,6 +103,8 @@ GEM | |||
honeybadger (1.16.7) | |||
json | |||
i18n (0.7.0) | |||
jmespath (1.0.2) | |||
multi_json (~> 1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 overall. This dependency ties us tighter to multi_json
. I’m okay with it but it will make your project to completely eliminate the multi_json
dependency more difficult.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I guess multi_json
will stick around for a while still.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thats awesome @sferik
That method , is mainly for #923 , so we can delete gems and restore them (manually) if need it. |
s3.get_object(key: key, bucket: bucket); | ||
rescue Aws::S3::Errors::NoSuchKey=> e | ||
version_id = e.context.http_response.headers["x-amz-version-id"] | ||
s3.delete_object(key: key, bucket: bucket, version_id: version_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we're expecting the get to fail every time and raise the exception?
@arthurnn sure. But I was thinking about whole workflow. Once deletion is created, those two hooks are triggered: # app/models/deletion.rb
...
after_create :remove_from_index #removed from index
after_commit :remove_from_storage #removed from storage
... But according to note from #923
it will be good to be prepared to rollback deletion also. With So the flow will be like:
❓ |
Only What about to add blank |
Yes
No, After this gets merged I will add a restore method to #923 Deletion model so we can restore the s3 file and the index flag on the db. Regarding the API on RubygemFs, yes, I should make some common methods public and the others private. I will do that. |
Thanks @arthurnn, that makes sense now. |
Yes, thats how the API works. it returns a 404 with a versionId, and on the sdk gem a 404 means an exception. |
@arthurnn ok cool, just making sure I understood. |
👍 🚢 |
review @dwradcliffe @sferik @qrush