-
Notifications
You must be signed in to change notification settings - Fork 139
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(commons): centralize cold start heuristic #547
Conversation
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.
Only typo and grammar. This rest looks good.
Co-authored-by: ijemmy <ijemmy@users.noreply.github.com>
Co-authored-by: ijemmy <ijemmy@users.noreply.github.com>
|
||
}); | ||
|
||
test('when called multiple times on a child class, it returns true the first time, then false afterwards', () => { |
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.
What would be the use case of testing the functionality from a child class?
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.
The other utilities (Tracer, Logger, etc.) will extend this Utility
class and use it just like in this test case. I agree that it might be a little redundant but adding one test case was easier/faster than build+pack the new version of commons
& install it in another package to test it.
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.
LGTM!
Description of your changes
This PR introduces a new
Utility
class in the@aws-lambda-powertools/commons
package. This class is designed to be extended by other Powertools utilities that will inherit its shared methods.In this iteration the
Utility
class brings a centralised cold start heuristic to be shared by all core packages.The changes in this PR have already been discussed in an internal RFC document reviewed by at least two other maintainers as per
CONTRIBUTING
guidelines.How to verify this change
Clone the repo & check newly introduced unit tests.
Also check the JSDoc documentation written in the class file.
Related issues, RFCs
#484
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.