Skip to content

fix(parser): apigw wss validation check_message_id; housekeeping #553

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 7 commits into from
Jul 30, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Jul 22, 2021

Issue #, if available:

Description of changes:

Various housekeeping, code coverage and mypy tasks

Changes:

  • Fix bug with check_message_id not validating against the RequestContext
  • Add some more unit tests for check_message_id
  • Add more mypy coverage
  • Add missing pragma: no cover
  • Simplify logic in idempotency.py and remove unused max_handler_retries property

Checklist

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

Changes:
- Add some more unit tests
- Fix bug with `check_message_id` not looking in the RequestContext
- Add more mypy coverage
- Add pragma: no cover
@michaelbrewer
Copy link
Contributor Author

@risenberg-cyberark - can you check the apigw fix I made for the validation.

@codecov-commenter
Copy link

codecov-commenter commented Jul 22, 2021

Codecov Report

Merging #553 (e8f665f) into develop (1135314) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #553      +/-   ##
===========================================
+ Coverage    99.86%   99.95%   +0.08%     
===========================================
  Files          113      113              
  Lines         4485     4477       -8     
  Branches       243      243              
===========================================
- Hits          4479     4475       -4     
+ Misses           3        0       -3     
+ Partials         3        2       -1     
Impacted Files Coverage Δ
aws_lambda_powertools/tracing/tracer.py 100.00% <ø> (+1.04%) ⬆️
...ols/utilities/feature_toggles/appconfig_fetcher.py 100.00% <100.00%> (ø)
...da_powertools/utilities/idempotency/idempotency.py 98.52% <100.00%> (-0.05%) ⬇️
...ools/utilities/idempotency/persistence/dynamodb.py 100.00% <100.00%> (ø)
...lambda_powertools/utilities/parameters/dynamodb.py 100.00% <100.00%> (ø)
...lambda_powertools/utilities/parser/models/apigw.py 100.00% <100.00%> (+2.59%) ⬆️

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 1135314...e8f665f. Read the comment docs.

@ran-isenberg
Copy link
Contributor

btw, the code coverage is insane :) @michaelbrewer

@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 23, 2021
@michaelbrewer
Copy link
Contributor Author

@heitorlessa i will leave out the other possible type checking and validation checks for idempotent for another time

@michaelbrewer michaelbrewer changed the title fix(parser): apigw check_message_id and tests fix(parser): fix apigw validation check_message_id and housekeeping Jul 28, 2021
if i < max_handler_retries:
continue
else:
if i == max_handler_retries:
Copy link
Contributor

Choose a reason for hiding this comment

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

nice one!!

@heitorlessa heitorlessa changed the title fix(parser): fix apigw validation check_message_id and housekeeping fix(parser): apigw wss validation check_message_id; housekeeping Jul 30, 2021
@heitorlessa heitorlessa added the bug Something isn't working label Jul 30, 2021
@heitorlessa heitorlessa added this to the 1.19.0 milestone Jul 30, 2021
@heitorlessa heitorlessa merged commit 0df5c57 into aws-powertools:develop Jul 30, 2021
@michaelbrewer michaelbrewer deleted the chore-housekeeping branch July 30, 2021 09:56
heitorlessa added a commit that referenced this pull request Jul 30, 2021
* develop:
  feat(params): expose high level max_age, raise_on_transform_error (#567)
  fix(parser): apigw wss validation check_message_id; housekeeping (#553)
  chore(deps-dev): bump isort from 5.9.2 to 5.9.3 (#574)
  feat(data-classes): decode json_body if based64 encoded (#560)
  chore(deps-dev): bump mkdocs-material from 7.2.0 to 7.2.1 (#566)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants