Skip to content

Conversation

jonife
Copy link
Contributor

@jonife jonife commented Feb 14, 2022

Description of changes:
Added validation to SecretsManagerKmsKeyId

Description of how you validated changes:
validation will ensure that SecretsManagerKmsKeyId is of type string

Checklist:

  • Add/update unit tests using:
  • Add/update integration 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.

@jonife jonife requested a review from moelasmar February 15, 2022 01:57
@codecov-commenter
Copy link

codecov-commenter commented Feb 15, 2022

Codecov Report

Merging #2323 (a395a62) into develop (e7a1496) will increase coverage by 0.71%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop    #2323      +/-   ##
===========================================
+ Coverage    93.58%   94.29%   +0.71%     
===========================================
  Files           90       97       +7     
  Lines         6124     7116     +992     
  Branches      1260     1466     +206     
===========================================
+ Hits          5731     6710     +979     
- Misses         183      196      +13     
  Partials       210      210              
Impacted Files Coverage Δ
samtranslator/__init__.py 100.00% <100.00%> (ø)
samtranslator/feature_toggle/dialup.py 100.00% <100.00%> (ø)
samtranslator/feature_toggle/feature_toggle.py 100.00% <100.00%> (+12.16%) ⬆️
samtranslator/intrinsics/actions.py 98.78% <100.00%> (+0.06%) ⬆️
samtranslator/intrinsics/resource_refs.py 95.83% <100.00%> (-0.17%) ⬇️
samtranslator/metrics/method_decorator.py 100.00% <100.00%> (ø)
samtranslator/metrics/metrics.py 100.00% <100.00%> (ø)
samtranslator/region_configuration.py 77.77% <0.00%> (-22.23%) ⬇️
samtranslator/validator/validator.py 91.80% <0.00%> (-3.85%) ⬇️
samtranslator/model/exceptions.py 97.67% <0.00%> (-2.33%) ⬇️
... and 43 more

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 97794f0...a395a62. Read the comment docs.

Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

Can we add unit tests as well? The end to end tests are great but we can create a better coverage if we add unit tests and validate different input (lists, dict, int, etc).

@jonife jonife requested a review from jfuss March 28, 2022 21:51
def test_must_validate_secrets_manager_kms_key_id(self):
self.mq_event_source.SourceAccessConfigurations = [{"Type": "BASIC_AUTH", "URI": "SECRET_URI"}]
self.mq_event_source.Broker = "BROKER_ARN"
self.mq_event_source.SecretsManagerKmsKeyId = ["1abc23d4-567f-8ab9-cde0-1fab234c5d67"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we parameterize this to include anything that is not a string? We covered list here but would be good to add int, bool and dict to add move coverage.

@jonife jonife requested a review from jfuss March 29, 2022 18:03
Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

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

Thank you for going through additional iterations with adding more unit tests.

@jfuss jfuss merged commit 6625df9 into aws:develop Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants