-
Notifications
You must be signed in to change notification settings - Fork 146
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(build): publish lib as a Lambda Layer #884
Conversation
275f79f
to
e3fd639
Compare
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
|
||
const runtime = lambda.Runtime.ALL.find((r) => r.name === process.env.RUNTIME) ?? lambda.Runtime.NODEJS_14_X; | ||
|
||
const powerToolsPackageVersion = '1.0.1'; |
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.
Is this synced to the actual version published on NPM? If yes, how do we increment it when we release?
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.
no it's only to test and therefore on purpose set as a lower version than latest
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.
in release workflow it takes latest from latest tag https://github.com/awslabs/aws-lambda-powertools-typescript/pull/884/files#diff-39e8ac1723228023ce8c44a0a27a9ce7db36f9ddaf8404cbf2e16c648ad42705R42
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.
Perfect, thanks for the explanation.
Leaving the thread open so others can see the answer in case they have the same question
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
@@ -0,0 +1,32 @@ | |||
{ |
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.
Putting this comment here because the file above called is a binary and doesn't allow comments:
Do we need this layer-publisher/[email protected]
???
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.
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.
for now yes since my PR there is not merged yet : aws-samples/cdk-lambda-powertools-python-layer#52
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.
Gotcha, thanks for the explanation
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
1714919
to
810e0dc
Compare
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
📊 Package size report -50.7%↓
🤖 This report was automatically generated by pkg-size-action |
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
* chore: broke up pr workflow & measure package size * chore: explicitly set packages where to run cmds * fix: added missing dependency to examples/sam * added cache in workflow * chore: updated workflow + removed env var from command * chore: updated action version * fix: removed redundant env variable
…owertools-typescript into feat/layerPublisher
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.
Fixed merge conflicts
Description of your changes
This PR aims to add the capability to publish safely AWS Lambda PowerTools for TypeScript.
TODO list:
How to verify this change
Test layer publisher
Build layer manually in your account:
cd layer-publisher npm ci npm run cdk deploy
Then you can use the layer shown as cfn output.
Or you can use the e2e tests that will:
e2e-tests-layer-nodejs
Test in github action
check https://github.com/flochaz/aws-lambda-powertools-typescript/actions/runs/2718610199
Diff with Powertools for Python version
The only difference with Python version for publishing layer is the way we do e2e tests:
Canary
stack launching a Lambda Function (as a CustomResource) which consume the published layer in the same CDK App. This canary function deployed in their beta and prod account will use the layer and throw exception if any issue found making the stack deployment fail.layer-publisher
cdk app contains aJest
test that wille2e-tests-layer-nodejs
Related issues, RFCs
Issue number: #826
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.