Skip to content

Bump SDK #9

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

Closed
wants to merge 14 commits into from
Closed

Bump SDK #9

wants to merge 14 commits into from

Conversation

JDutil
Copy link
Contributor

@JDutil JDutil commented Jan 9, 2017

We're interested in using this library with the latest sdk so this is the current WIP for our updates.

I've also got a branch containing a bunch of syntax updates I made while reading the code to fix rubocop warnings that I'd like to contribute, but am trying to keep this PR's changes minimal to just what is required first. You can check those out over at master...JDutil:bump-aws-sdk

fixes #7

@JDutil
Copy link
Contributor Author

JDutil commented Jan 9, 2017

I've fixed the broken specs I was running into so this build should now be passing.

@JDutil JDutil mentioned this pull request Jan 9, 2017
@phstc
Copy link

phstc commented Jan 25, 2017

#7 (comment)

@awood45 any chance to get this reviewed? 🙏

@awood45
Copy link
Contributor

awood45 commented Jan 30, 2017

I've just returned from vacation, I'm going to start looking at this now. This will have to be a major version bump of this Gem, so will also look to see if there are other improvements we should bundle with such a change.

Copy link
Contributor

@awood45 awood45 left a comment

Choose a reason for hiding this comment

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

I can tell that there is going to be a need for extensive testing of a V2 bump of this library. Let's address these comments, and then I can create a branch/beta release.

@@ -13,6 +13,6 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_dependency 'aws-sdk-v1'
spec.add_dependency 'rack', '~> 1.0'
spec.add_dependency 'aws-sdk'
Copy link
Contributor

Choose a reason for hiding this comment

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

Should still keep a major version lock on this, such as '~> 2.0'.

Both because this in theory would allow a V1 dependency which would then mysteriously fail, and because if there's ever a V3, we don't want this to hard fail.

@@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.

require 'yaml'
require 'aws-sdk-v1'
require 'aws-sdk'

module AWS::SessionStore::DynamoDB
Copy link
Contributor

Choose a reason for hiding this comment

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

Thing I'm unsure about: If we should change the top-level module to be Aws to match the nomenclature across other such libraries. There are valid arguments to both sides of this question.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@awood45 it would be nice to change the top-level module, but I'd do that in it's own PR to make code review simpler which is why I didn't bother for now.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's reasonable enough. Like I said, there's probably a number of refactors we need to make or want to make before a full release of this. For example, I'm wondering if using Aws::Record wouldn't simplify a ton of this code, now that it exists.

@@ -154,7 +153,7 @@ class Configuration
# See AWS DynamoDB documentation for table write_capacity for more
# information on this setting.
# @option options [DynamoDB Client] :dynamo_db_client
# (AWS::DynamoDB::ClientV2) DynamoDB client used to perform database
# (Aws::DynamoDB::ClientV2) DynamoDB client used to perform database
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no ClientV2 in V2 of the SDK. Just Client.

@@ -56,7 +56,7 @@ def delete_session(env, sid)
def handle_error(env = nil, &block)
begin
yield
rescue AWS::DynamoDB::Errors::Base => e
rescue Aws::DynamoDB::Errors::Base => e
Copy link
Contributor

Choose a reason for hiding this comment

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

Aws::DynamoDB::Errors::ServiceError is the "Base" error class in V2.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@awood45 I tried changing to ServiceError, but it breaks one of the tests:

2.3.3 in aws-sessionstore-dynamodb-ruby/ on bump-sdk
› be rake
bundle exec rspec -t ~integration
Run options: exclude {:integration=>true}
.........F................

Failures:

  1) AWS::SessionStore::DynamoDB Error handling for Rack Middleware with default error handler catches exception for inaccurate table key
     Failure/Error: lambda do
       expected #<Aws::DynamoDB::Errors::ValidationException: The provided key element does not match the schema> but nothing was raised
     # ./spec/aws/session_store/dynamo_db/error/default_error_handler_spec.rb:44:in `block (3 levels) in <top (required)>'

Finished in 0.12099 seconds
26 examples, 1 failure

Failed examples:

rspec ./spec/aws/session_store/dynamo_db/error/default_error_handler_spec.rb:41 # AWS::SessionStore::DynamoDB Error handling for Rack Middleware with default error handler catches exception for inaccurate table key
rake aborted!
Command failed with status (1): [bundle exec rspec -t ~integration...]
/Users/JDutil/Code/aws-sessionstore-dynamodb-ruby/tasks/test.rake:17:in `block (2 levels) in <top (required)>'
/Users/JDutil/.rbenv/versions/2.3.3/bin/bundle:22:in `load'
/Users/JDutil/.rbenv/versions/2.3.3/bin/bundle:22:in `<main>'
Tasks: TOP => default => test:unit
(See full trace by running task with --trace)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@awood45 There was another reference to base class I needed to update, but specs are passing again.

@JDutil
Copy link
Contributor Author

JDutil commented Feb 1, 2017

@awood45 okay initial feedback is updated. Let me know if you need anything else.

@dkoprov
Copy link

dkoprov commented Feb 27, 2017

@awood45 any updates on this issue?

@awood45
Copy link
Contributor

awood45 commented Feb 27, 2017

Sorry, I've been swamped lately. Also, admittedly, waiting to see if the newest DynamoDB feature could play a role once released.

@phstc
Copy link

phstc commented Feb 27, 2017

@awood45 hehe ... Is the TTL configuration already available through the SDK?

@awood45
Copy link
Contributor

awood45 commented Feb 27, 2017

I will certainly update this space when it is. If we are major version bumping the session store, it may be worth using that version as the minimum, since TTL may nicely solve some performance issues in the previous iteration of this gem.

@JDutil
Copy link
Contributor Author

JDutil commented Feb 27, 2017

Would be nice to move forward with this specific issue of updating the sdk version used, and then look at TTL after. Even if that means just updating master branch, and waiting to release the major version bump until TTL support is added. There is another open issue related to using TTL here #12

@awood45
Copy link
Contributor

awood45 commented Feb 27, 2017 via email

@phstc
Copy link

phstc commented Feb 27, 2017

@awood45 I think a specific issue and PR for TTL as mentioned by @JDutil does make sense.

@cjyclaire
Copy link
Contributor

cjyclaire commented Aug 14, 2017

Latest release contains merged PR #17 that supports V2 SDK, it covers all this PR covers as well, closing : ) Thank you for the contribution all the same!

@cjyclaire cjyclaire closed this Aug 14, 2017
@phstc
Copy link

phstc commented Aug 15, 2017

@cjyclaire great! How about the other opened pull requests adding the expire_at attribute?

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.

aws-sdk v2?
6 participants