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

fix(parser): raise ValidationError when SNS->SQS keys are intentionally missing #1299

Merged

Conversation

rubenfonseca
Copy link
Contributor

@rubenfonseca rubenfonseca commented Jul 14, 2022

Issue number: #1009

Summary

Changes

When UnsubscribeURL or SigningCertURL were intentionally missing from the SNS -> SQS payload, KeyError was thrown.

Since the objective of the parser is to validate the payload, we changed the code so it returns
an expected ValidationError instead.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 14, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 14, 2022

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.

@github-actions github-actions bot added the bug Something isn't working label Jul 14, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 14, 2022

Codecov Report

Merging #1299 (a7f0562) into develop (b852946) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1299   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files          119      119           
  Lines         5427     5427           
  Branches       619      619           
========================================
  Hits          5421     5421           
  Misses           2        2           
  Partials         4        4           
Impacted Files Coverage Δ
...s_lambda_powertools/utilities/parser/models/sns.py 100.00% <100.00%> (ø)

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 b852946...a7f0562. Read the comment docs.

Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

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

Looks great, a minor suggestion to make the tests more explicit. Super excited to see your first PR ;-)

tests/functional/parser/test_sns.py Outdated Show resolved Hide resolved
tests/functional/parser/test_sns.py Outdated Show resolved Hide resolved
@rubenfonseca
Copy link
Contributor Author

@heitorlessa thank you for the feedback, it makes 100% sense! 😎

@rubenfonseca rubenfonseca requested a review from heitorlessa July 14, 2022 13:41
@heitorlessa heitorlessa added the internal Maintenance changes label Jul 18, 2022
@heitorlessa heitorlessa changed the title fix(parser): raise ValidationError when SNS->SQS keys are missing fix(parser): raise ValidationError when SNS->SQS keys are intentionally missing Jul 18, 2022
@heitorlessa
Copy link
Contributor

Thanks a lot @rubenfonseca ;)

@heitorlessa heitorlessa merged commit a659b21 into aws-powertools:develop Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal Maintenance changes size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants