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

S3 versioned cloning #176

Merged
merged 6 commits into from
Dec 6, 2019
Merged

S3 versioned cloning #176

merged 6 commits into from
Dec 6, 2019

Conversation

mpacer
Copy link
Member

@mpacer mpacer commented Dec 2, 2019

This adds the ability to clone an old version from a versioned s3 bucket.

Addresses #172

Unfortunately we cannot test for this functionality in our minio based integration tests. This is because minio does not support versioned buckets:
see minio/minio#6494 for the latest efforts to implement ending in a decision to not do so and minio/minio#1309 for some of the original discussion around it.

This pulls out functionality around creating the kwargs to send to S3 so that we can test that logic independently.

This also updates the API docs.

@MSeal @captainsafia I added you as reviewers per your request earlier today at the team meeting.

@codecov
Copy link

codecov bot commented Dec 2, 2019

Codecov Report

Merging #176 into master will increase coverage by 0.3%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master     #176     +/-   ##
=========================================
+ Coverage   82.31%   82.62%   +0.3%     
=========================================
  Files          10       10             
  Lines         509      518      +9     
=========================================
+ Hits          419      428      +9     
  Misses         90       90

Copy link
Member

@captainsafia captainsafia left a comment

Choose a reason for hiding this comment

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

Left one comment inline. Seems sensible otherwise.

@@ -9,7 +9,7 @@ info:
license:
name: BSD 3-clause
url: https://github.com/nteract/bookstore/blob/master/LICENSE
version: 2.3.0.dev0
version: 2.5.1
Copy link
Member

Choose a reason for hiding this comment

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

Is this the correct version bump for this?

Copy link
Member Author

@mpacer mpacer Dec 3, 2019

Choose a reason for hiding this comment

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

I was bumping it to match what the version of bookstore itself would be upon release, minus the dev0.

We don't have a separate versioning scheme for the API (we can create one if we think that's best). I removed the dev0 simply because that when we release this, it would match the published version of the package.

I'm open to other suggestions as to how to handle this, though :)

Copy link
Member

Choose a reason for hiding this comment

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

Might be good to have the version kept in sync between the two files programmatically when running the bdist_wheel. If that's a pain to do, then we should instead just add it explicitly to the RELEASING.md instructions imo.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we could set up bumpversion do handle that, but I think for now the low overhead way of making it part of the RELEASING.md makes sense. I think there are a couple of other places where that would help too.

Copy link
Member

Choose a reason for hiding this comment

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

I realize I'm coming in with a fresh take on this... The version in this YAML file could be different from the library itself since it's the REST API. 🤷‍♂

Copy link
Member

@MSeal MSeal left a comment

Choose a reason for hiding this comment

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

LGTM outside of making the version update always in sync

template_params = {
"post_model": model,
"clone_api_url": clone_api_url,
"redirect_contents_url": redirect_contents_url,
"source_description": f"'{s3_object_key}' from the s3 bucket '{s3_bucket}'",
"source_description": f"'{s3_object_key}'{' version: '+s3_version_id if s3_version_id else ''} from the s3 bucket '{s3_bucket}'",
Copy link
Member

Choose a reason for hiding this comment

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

Might be better to move the conditional version text into a variable above to make it more readable

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good!

Copy link
Member Author

Choose a reason for hiding this comment

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

this change has been made in the latest version of this PR

@@ -9,7 +9,7 @@ info:
license:
name: BSD 3-clause
url: https://github.com/nteract/bookstore/blob/master/LICENSE
version: 2.3.0.dev0
version: 2.5.1
Copy link
Member

Choose a reason for hiding this comment

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

Might be good to have the version kept in sync between the two files programmatically when running the bdist_wheel. If that's a pain to do, then we should instead just add it explicitly to the RELEASING.md instructions imo.

@mpacer mpacer force-pushed the s3_versioned_cloning branch from c0b7223 to 95109e0 Compare December 6, 2019 21:23
@mpacer
Copy link
Member Author

mpacer commented Dec 6, 2019

@MSeal @captainsafia I just rebased this PR on master and pushed updates to address the version concern & the string legibility concern.

I created #177 so a bumpversion setup can be pursued in a separate PR.

@rgbkrk
Copy link
Member

rgbkrk commented Dec 6, 2019

Since it looks like feedback is addressed and there's another thread for the one point of contention, I'll go ahead and merge this.

@rgbkrk rgbkrk merged commit 848f36e into nteract:master Dec 6, 2019
@mpacer mpacer added this to the 2.5.1 milestone Dec 10, 2019
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.

4 participants