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

Add modes support for RestApi #2055

Merged
merged 7 commits into from
Jun 11, 2021
Merged

Add modes support for RestApi #2055

merged 7 commits into from
Jun 11, 2021

Conversation

c2tarun
Copy link
Contributor

@c2tarun c2tarun commented Jun 10, 2021

Issue #, if available:

Description of changes:
Adding support for Mode property added by API Gateway.

Description of how you validated changes:
Unit tests
Integration test are using overwrite mode value to ensure that when an path is removed it gets removed from API Gateway as well.

Checklist:

  • Write/update tests
  • make pr passes
  • Update documentation
  • Verify transformed template deploys and application functions as expected

Examples?

Please reach out in the comments, if you want to add an example. Examples will be
added to sam init through https://github.com/awslabs/aws-sam-cli-app-templates/

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@c2tarun c2tarun requested a review from mndeveci June 10, 2021 23:57
Copy link
Contributor

@sriram-mv sriram-mv left a comment

Choose a reason for hiding this comment

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

Overall Looks good.

List of parameters
"""
if not self.stack_name:
raise Exception("Stack not created.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Typed Execptions?

Copy link
Contributor

@mndeveci mndeveci left a comment

Choose a reason for hiding this comment

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

Implementation LGTM, but I was wondering why we added pip-wheel-metadata folder into project?

pip-wheel-metadata/aws_sam_translator.dist-info/LICENSE Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2021

Codecov Report

Merging #2055 (ef2dd48) into develop (e7a1496) will increase coverage by 0.28%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2055      +/-   ##
===========================================
+ Coverage    93.58%   93.87%   +0.28%     
===========================================
  Files           90       91       +1     
  Lines         6124     6168      +44     
  Branches      1260     1262       +2     
===========================================
+ Hits          5731     5790      +59     
+ Misses         183      174       -9     
+ Partials       210      204       -6     
Impacted Files Coverage Δ
samtranslator/model/apigateway.py 97.15% <ø> (ø)
samtranslator/model/sam_resources.py 91.23% <ø> (ø)
samtranslator/feature_toggle/dialup.py 100.00% <100.00%> (ø)
samtranslator/feature_toggle/feature_toggle.py 100.00% <100.00%> (+12.16%) ⬆️
samtranslator/model/api/api_generator.py 94.39% <100.00%> (+0.03%) ⬆️
samtranslator/translator/translator.py 97.18% <100.00%> (ø)
samtranslator/swagger/swagger.py 93.89% <0.00%> (+0.52%) ⬆️
samtranslator/translator/logical_id_generator.py 100.00% <0.00%> (+9.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e59951f...ef2dd48. Read the comment docs.

@c2tarun c2tarun merged commit c39d0a0 into aws:develop Jun 11, 2021
@c2tarun c2tarun deleted the add_modes branch June 11, 2021 16:31
c2tarun added a commit to c2tarun/serverless-application-model that referenced this pull request Jul 7, 2021
* Adding Mode passthrough property to RestApi with unit tests.

* Adding integration test for Mode

* Fixing sam-translate for manual translation.

* running black formatting

* Running black formatting, again.

* Clearing pip-wheel-metadata.

* Clearing tmp folder created by integ test.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>
c2tarun added a commit that referenced this pull request Jul 8, 2021
* test: New test group to test for side effects (#2046)

* test: New test group to test for side effects

* refactor: Updated to use _compare_transform and test CN and GOV partitions

* docs: fix dead link (#2045)

* Percentage-based Enablement for Feature Toggle (#1952)

* Percentage-based Enablement for Feature Toggle

* Update Feature Toggle to accept stage, account_id and region during instanciation

* remove unnecessary uses of dict.get method

* Refactor feature toggle methods

* Update test names

* black reformat

* Update FeatureToggle to require stage, region and account_id to instanciate

* Update log message

* Implement calculating account percentile based on hash of account_id and feature_name

* Refactor _is_feature_enabled_for_region_config

* Refactor dialup logic into its own classes

* Add comments for dialup classes

* Rename NeverEnabledDialup to DisabledDialup

* chore(tests): Adding any tests (#2053)

* Adding api_request_model any tests

* Add any to api_request_model_openapi_3 cases

* Add rest of relevant any test cases

* Fix hashing to match python2

* add api_with_swagger_authorizer_none to be run

* fix py2 hashes in api_with_swagger_authorizer_none tests

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* Add modes support for RestApi (#2055)

* Adding Mode passthrough property to RestApi with unit tests.

* Adding integration test for Mode

* Fixing sam-translate for manual translation.

* running black formatting

* Running black formatting, again.

* Clearing pip-wheel-metadata.

* Clearing tmp folder created by integ test.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* chore: bump version to 1.38.0 (#2081)

Co-authored-by: Mathieu Grandis <73313235+mgrandis@users.noreply.github.com>
Co-authored-by: Chris Rehn <crehn@outlook.com>
Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>
Co-authored-by: Raymond Wang <14915548+wchengru@users.noreply.github.com>
@c2tarun c2tarun mentioned this pull request Jul 16, 2021
4 tasks
c2tarun added a commit that referenced this pull request Jul 19, 2021
* test: New test group to test for side effects (#2046)

* test: New test group to test for side effects

* refactor: Updated to use _compare_transform and test CN and GOV partitions

* docs: fix dead link (#2045)

* Percentage-based Enablement for Feature Toggle (#1952)

* Percentage-based Enablement for Feature Toggle

* Update Feature Toggle to accept stage, account_id and region during instanciation

* remove unnecessary uses of dict.get method

* Refactor feature toggle methods

* Update test names

* black reformat

* Update FeatureToggle to require stage, region and account_id to instanciate

* Update log message

* Implement calculating account percentile based on hash of account_id and feature_name

* Refactor _is_feature_enabled_for_region_config

* Refactor dialup logic into its own classes

* Add comments for dialup classes

* Rename NeverEnabledDialup to DisabledDialup

* chore(tests): Adding any tests (#2053)

* Adding api_request_model any tests

* Add any to api_request_model_openapi_3 cases

* Add rest of relevant any test cases

* Fix hashing to match python2

* add api_with_swagger_authorizer_none to be run

* fix py2 hashes in api_with_swagger_authorizer_none tests

Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>

* Add modes support for RestApi (#2055)

* Adding Mode passthrough property to RestApi with unit tests.

* Adding integration test for Mode

* Fixing sam-translate for manual translation.

* running black formatting

* Running black formatting, again.

* Clearing pip-wheel-metadata.

* Clearing tmp folder created by integ test.

Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>

* chore: bump version to 1.38.0 (#2081)

Co-authored-by: Mathieu Grandis <73313235+mgrandis@users.noreply.github.com>
Co-authored-by: Chris Rehn <crehn@outlook.com>
Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>
Co-authored-by: Raymond Wang <14915548+wchengru@users.noreply.github.com>

Co-authored-by: Mathieu Grandis <73313235+mgrandis@users.noreply.github.com>
Co-authored-by: Chris Rehn <crehn@outlook.com>
Co-authored-by: Wing Fung Lau <4760060+hawflau@users.noreply.github.com>
Co-authored-by: Jacob Fuss <32497805+jfuss@users.noreply.github.com>
Co-authored-by: Jacob Fuss <jfuss@users.noreply.github.com>
Co-authored-by: Tarun Mall <tarun@amazon.noreply.github.com>
Co-authored-by: Raymond Wang <14915548+wchengru@users.noreply.github.com>
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.

5 participants