-
Notifications
You must be signed in to change notification settings - Fork 402
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
feat(event_handler): allow stripping route prefixes using regexes #2521
feat(event_handler): allow stripping route prefixes using regexes #2521
Conversation
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure. |
e52c51a
to
d4b759f
Compare
Looking into this now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution! 🎉 Two asks:
- can you make this non-iterative? Meaning, when there is a match in the regex, we stop processing more items from the
strip_prefixes
array? Reason: This would probably be a breaking change and using the regex solves the initial problem in the first place - do you mind adding a couple of functional test cases to cover the new code?
Please let me know if you need assistance with those, and we would be happy to help!
d4b759f
to
2a7e2b6
Compare
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #2521 +/- ##
===========================================
+ Coverage 96.34% 96.44% +0.10%
===========================================
Files 169 171 +2
Lines 7678 7690 +12
Branches 1451 1455 +4
===========================================
+ Hits 7397 7417 +20
+ Misses 222 218 -4
+ Partials 59 55 -4
☔ View full report in Codecov by Sentry. |
I asked for your review @rubenfonseca again! Since we haven't heard from other clients, we need to decide whether to go ahead with this PR and close it. Thanks |
Hey! We'll be making the necessary adjustments to the PR to guarantee it solves your problem and of similar customers. |
Looking into this now |
373aada
to
766f525
Compare
Hei @heitorlessa, can you review this, please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, specially docs!
Asked for an additional test (if I read it correctly), and one question on whether we should warn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!! this looks great! 🚀
05d70db
to
5684ef1
Compare
Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience! |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…s-powertools#2521) Co-authored-by: Roy Assis <[email protected]> Co-authored-by: Ruben Fonseca <[email protected]>
* develop: chore: cleanup, add test for single and nested fix(parameters): make cache aware of single vs multiple calls docs(roadmap): add GovCloud and China region item (aws-powertools#2960) docs(metrics): update Datadog integration diagram (aws-powertools#2954) chore(ci): changelog rebuild (aws-powertools#2958) chore(deps-dev): bump cfn-lint from 0.79.6 to 0.79.7 (aws-powertools#2956) chore(deps): bump actions/setup-node from 3.7.0 to 3.8.0 (aws-powertools#2957) chore(deps-dev): bump xenon from 0.9.0 to 0.9.1 (aws-powertools#2955) feat(metrics): add Datadog observability provider (aws-powertools#2906) feat(event_handler): allow stripping route prefixes using regexes (aws-powertools#2521) chore(ci): changelog rebuild (aws-powertools#2952) chore(deps): bump pypa/gh-action-pypi-publish from 1.8.9 to 1.8.10 (aws-powertools#2946) chore(deps): bump gitpython from 3.1.31 to 3.1.32 in /docs (aws-powertools#2948) chore(deps-dev): bump aws-cdk from 2.90.0 to 2.91.0 (aws-powertools#2947) chore(ci): changelog rebuild (aws-powertools#2945) chore(deps-dev): bump the boto-typing group with 1 update (aws-powertools#2944) chore(deps): bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.9 (aws-powertools#2943) Signed-off-by: heitorlessa <[email protected]>
* fix(parameters): make cache aware of single vs multiple calls Signed-off-by: heitorlessa <[email protected]> * chore: cleanup, add test for single and nested Signed-off-by: heitorlessa <[email protected]> * chore(deps): bump pypa/gh-action-pypi-publish from 1.8.8 to 1.8.9 (aws-powertools#2943) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump the boto-typing group with 1 update (aws-powertools#2944) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2945) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * chore(deps-dev): bump aws-cdk from 2.90.0 to 2.91.0 (aws-powertools#2947) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump gitpython from 3.1.31 to 3.1.32 in /docs (aws-powertools#2948) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump pypa/gh-action-pypi-publish from 1.8.9 to 1.8.10 (aws-powertools#2946) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2952) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * feat(event_handler): allow stripping route prefixes using regexes (aws-powertools#2521) Co-authored-by: Roy Assis <[email protected]> Co-authored-by: Ruben Fonseca <[email protected]> * feat(metrics): add Datadog observability provider (aws-powertools#2906) Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: heitorlessa <[email protected]> * chore(deps-dev): bump xenon from 0.9.0 to 0.9.1 (aws-powertools#2955) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): bump actions/setup-node from 3.7.0 to 3.8.0 (aws-powertools#2957) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps-dev): bump cfn-lint from 0.79.6 to 0.79.7 (aws-powertools#2956) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> * chore(ci): changelog rebuild (aws-powertools#2958) Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> * docs(metrics): update Datadog integration diagram (aws-powertools#2954) Co-authored-by: Leandro Damascena <[email protected]> * docs(roadmap): add GovCloud and China region item (aws-powertools#2960) * fix(parameters): make cache aware of single vs multiple calls Signed-off-by: heitorlessa <[email protected]> * chore: cleanup, add test for single and nested Signed-off-by: heitorlessa <[email protected]> * chore(test): remove itsdangerous from perf test Signed-off-by: heitorlessa <[email protected]> * chore(deps): remove itsdangerous dependencies * chore: disable sockets in encryption sdk tests Signed-off-by: heitorlessa <[email protected]> * refactor(tests): use a test double * chore: address make pr errors Signed-off-by: heitorlessa <[email protected]> --------- Signed-off-by: heitorlessa <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Leandro Damascena <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Powertools for AWS Lambda (Python) bot <[email protected]> Co-authored-by: roy <[email protected]> Co-authored-by: Roy Assis <[email protected]> Co-authored-by: Ruben Fonseca <[email protected]> Co-authored-by: Roger Zhang <[email protected]> Co-authored-by: aal80 <[email protected]> Co-authored-by: Seshu Brahma <[email protected]>
Issue number: #2494
Summary
Changes
This PR adds the ability to set a regex when removing prefixes from routes. This is in addition to the existing mechanism where we strip static strings as prefixes.
User experience
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
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.