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

Support latest resource model version. #34

Merged
merged 2 commits into from
Dec 3, 2014

Conversation

danielgtaylor
Copy link
Member

This change adds support for the latest version of the JSON description files
for resources. The following has changed:

  1. An action's .path has been moved into .resource.path if a resource
    is present. If it is present, then a path outside of the resource is
    no longer valid. This fixes Trying to access SQS message body throws an exception as of boto3 versions 0.0.3 and 0.0.2 #33.
  2. Sub-resources previously defined with either hasOne or hasMany are now
    defined with a single belongsTo key. The internal Boto 3 representation,
    however, remains the same and is accessed via resource.references.

As a result of the format changes, I had to update the internal resource
model, adjust the search path behavior for actions and update various tests
that made assumptions about the older format.

I also discovered that we were using a mix of old and new files for different
services, so this change includes updates to EC2 and Glacier so that all
resources are using the new format. With this change, we no longer support
the older format.

cc @jamesls, @kyleknap

This change adds support for the latest version of the JSON description files
for resources. The following has changed:

1. An action's `.path` has been moved into `.resource.path` if a resource
   is present. If it is present, then a path outside of the resource is
   no longer valid. This fixes #33.
2. Sub-resources previously defined with either `hasOne` or `hasMany` are now
   defined with a single `belongsTo` key. The internal Boto 3 representation,
   however, remains the same and is accessed via `resource.references`.

As a result of the format changes, I had to update the internal resource
model, adjust the search path behavior for actions and update various tests
that made assumptions about the older format.

I also discovered that we were using a mix of old and new files for different
services, so this change includes updates to EC2 and Glacier so that all
resources are using the new format. With this change, we no longer support
the older format.
@danielgtaylor danielgtaylor added the enhancement This issue requests an improvement to a current feature. label Dec 2, 2014
@danielgtaylor danielgtaylor self-assigned this Dec 2, 2014
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 5dd70e5 on model-version-update into ab3b951 on develop.

@kyleknap
Copy link
Contributor

kyleknap commented Dec 3, 2014

Looks good. 🚢 As a future PR, we should have integration tests that catch these type of regressions where we actually create resources for specific services like s3 and sqs and performs some actions using these resources.

danielgtaylor added a commit that referenced this pull request Dec 3, 2014
Support latest resource model version. Fixes #34.
@danielgtaylor danielgtaylor merged commit d18affc into develop Dec 3, 2014
@danielgtaylor danielgtaylor deleted the model-version-update branch December 3, 2014 19:24
danielgtaylor added a commit that referenced this pull request Dec 3, 2014
This adds integration tests that exercise previously untested functionality,
specifically this adds the following to the existing describe calls:

* Create and delete remote resources
* Call actions to put and get data from remote resources
* Handle low-level responses from a service
* Exercise low-level waiters (to be replaced with high-level waiters)
* Access data attributes of pre-loaded resources with no `load` method

The last item would have prevented #33. This PR is related to #34,
which fixed the underlying issue that this test would have caught.

The full integration test suite now takes around 20-30 seconds on
my machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue requests an improvement to a current feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trying to access SQS message body throws an exception as of boto3 versions 0.0.3 and 0.0.2
3 participants