-
Notifications
You must be signed in to change notification settings - Fork 30
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
Bump SDK #9
Conversation
proper hash for Client#update_item
I've fixed the broken specs I was running into so this build should now be passing. |
@awood45 any chance to get this reviewed? 🙏 |
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. |
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.
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.
aws-sessionstore-dynamodb.gemspec
Outdated
@@ -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' |
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.
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 |
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.
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.
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.
@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.
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.
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 |
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 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 |
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.
Aws::DynamoDB::Errors::ServiceError
is the "Base" error class in V2.
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.
@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)
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.
@awood45 There was another reference to base class I needed to update, but specs are passing again.
@awood45 okay initial feedback is updated. Let me know if you need anything else. |
@awood45 any updates on this issue? |
Sorry, I've been swamped lately. Also, admittedly, waiting to see if the newest DynamoDB feature could play a role once released. |
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. |
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 |
We can do that - there's also the option of a pre-release of the MV bump.
|
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 great! How about the other opened pull requests adding the |
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