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

Adds tests for presigned operations and some improvements #96

Merged
merged 8 commits into from
Jul 20, 2017

Conversation

ebozduman
Copy link
Collaborator

@ebozduman ebozduman commented Jul 15, 2017

Issue #93

@nitisht nitisht requested review from poornas and deekoder July 15, 2017 00:09
@@ -517,3 +761,6 @@ def copyObjectTest(s3, source_bucket_name, target_bucket_name, data_dir, source_
aws.getObjectTest(s3Resource, bucket_name1, File.join(data_dir, file_name1), destination)
aws.copyObjectTest(s3Resource, bucket_name1, bucket_name2, data_dir, file_name1)
aws.copyObjectTest(s3Resource, bucket_name1, bucket_name2, data_dir, file_name1, file_new_name)
aws.presignedGetObjectTest(s3Resource, bucket_name1, data_dir, file_name1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the client object in seems very non standard. Can we make s3Resource a member of the class?

# of the progress message
msg = "\t" + log_msg + "%s" + "\n"
printf(msg.light_black, arg)
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebozduman , it might be a good idea to use ruby Logger class for logging instead of print_* methods.

removeObjects(s3, b)
removeBucket(s3, b)
end
end
print_logn("- Success!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of interspersing print statements through the code, it would be better to log minimally - once on successful cleanup or log error on failure. Also, it might help to log the function name, line # and specific error message

begin
s3 = create_s3_resource
print_log("Making bucket: ", bucket_name)
makeBucket(s3, bucket_name)
Copy link
Contributor

@deekoder deekoder Jul 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this deeper in the code so that the calling function doesnot have to pass s3. By making it a member variable of the class awssdkruby, all methods can operate on this without having to pass it around. Since almost every method needs it, its a natural fit for being a class variable.
This is fine with me to address later instead of in this pr.

@nitisht
Copy link
Contributor

nitisht commented Jul 20, 2017

@poornas anything pending here ?

Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate issue can be opened to refactor logging statements. Otherwise, looks good.

@nitisht
Copy link
Contributor

nitisht commented Jul 20, 2017

I understand #102 was filed for log refactor.

@nitisht nitisht merged commit 8f01dab into minio:master Jul 20, 2017
nitisht pushed a commit to nitisht/mint that referenced this pull request Jul 25, 2017
* Creates new AWS Ruby SDK api commands and tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants