From 451a3f8e74e53ee9a96d657d2e56cb6f69a558eb Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Tue, 10 May 2022 12:33:08 -0400 Subject: [PATCH 01/12] feat: added node16 to e2e test --- .github/workflows/run-e2e-tests.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-e2e-tests.yml b/.github/workflows/run-e2e-tests.yml index 59174b7610..63436c6293 100644 --- a/.github/workflows/run-e2e-tests.yml +++ b/.github/workflows/run-e2e-tests.yml @@ -9,11 +9,10 @@ jobs: steps: - name: "Checkout" uses: actions/checkout@v3 - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - # Always use version 14 as we use TypeScript target es2020 - node-version: 14 + node-version: 16 - name: "Install npm@8.x" run: npm i -g npm@next-8 - name: "Install monorepo packages" @@ -43,16 +42,15 @@ jobs: contents: read strategy: matrix: - version: [12, 14] package: [logger, metrics, tracer] + version: [12, 14, 16] steps: - name: "Checkout" uses: actions/checkout@v3 - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - # Always use version 14 as we use TypeScript target es2020 - node-version: 14 + node-version: 16 - name: "Install npm@8.x" run: npm i -g npm@next-8 - name: "Install monorepo packages" From a8a0a4c26b59c859a973a6bcd4dae6f46e940612 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 12:25:11 +0000 Subject: [PATCH 02/12] chore: added runtime key --- packages/commons/tests/utils/e2eUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/commons/tests/utils/e2eUtils.ts b/packages/commons/tests/utils/e2eUtils.ts index caced6e568..c4c38d1d21 100644 --- a/packages/commons/tests/utils/e2eUtils.ts +++ b/packages/commons/tests/utils/e2eUtils.ts @@ -14,11 +14,12 @@ import { InvocationLogs } from './InvocationLogs'; const lambdaClient = new AWS.Lambda(); -const testRuntimeKeys = [ 'nodejs12x', 'nodejs14x' ]; +const testRuntimeKeys = [ 'nodejs12x', 'nodejs14x', 'nodejs16x' ]; export type TestRuntimesKey = typeof testRuntimeKeys[number]; export const TEST_RUNTIMES: Record = { nodejs12x: Runtime.NODEJS_12_X, nodejs14x: Runtime.NODEJS_14_X, + nodejs16x: Runtime.NODEJS_16_X, }; export type StackWithLambdaFunctionOptions = { From 03f4f7cccc5c3530f4b30bf660a7b7daca4de865 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 13:18:53 +0000 Subject: [PATCH 03/12] chore: update occurrences of nodejs14x --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 2 +- .github/workflows/on-merge-to-main.yml | 4 ++-- .github/workflows/on-release-prod.yml | 4 ++-- .github/workflows/pr_lint_and_test.yml | 4 ++-- CONTRIBUTING.md | 4 ++-- docs/core/logger.md | 2 +- docs/core/metrics.md | 2 +- docs/core/tracer.md | 2 +- examples/sam/template.yaml | 2 +- package.json | 4 ++-- packages/logger/package.json | 3 ++- packages/logger/tests/e2e/basicFeatures.middy.test.ts | 2 +- packages/logger/tests/e2e/childLogger.manual.test.ts | 2 +- packages/logger/tests/e2e/sampleRate.decorator.test.ts | 2 +- packages/metrics/package.json | 3 ++- packages/metrics/tests/e2e/basicFeatures.decorators.test.ts | 2 +- packages/metrics/tests/e2e/basicFeatures.manual.test.ts | 2 +- packages/tracer/package.json | 3 ++- packages/tracer/tests/e2e/allFeatures.decorator.test.ts | 2 +- packages/tracer/tests/e2e/allFeatures.manual.test.ts | 2 +- packages/tracer/tests/e2e/allFeatures.middy.test.ts | 2 +- packages/tracer/tests/e2e/asyncHandler.decorator.test.ts | 2 +- packages/tracer/tests/helpers/populateEnvironmentVariables.ts | 2 +- .../tests/unit/config/EnvironmentVariablesService.test.ts | 4 ++-- packages/tracer/tests/unit/helpers.test.ts | 2 +- 26 files changed, 35 insertions(+), 32 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 1a7334ee80..b491a08341 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,6 +1,6 @@ # See here for image contents: https://github.com/microsoft/vscode-dev-containers/blob/v0.212.0/containers/javascript-node/.devcontainer/base.Dockerfile # [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 16, 14, 12, 16-bullseye, 14-bullseye, 12-bullseye, 16-buster, 14-buster, 12-buster -ARG VARIANT="14-bullseye" +ARG VARIANT="16-bullseye" FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} # This section to install additional OS packages. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b4f8c88210..7040bc6847 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,7 +7,7 @@ // Update 'VARIANT' to pick a Node version: 16, 14, 12. // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local arm64/Apple Silicon. - "args": { "VARIANT": "14-bullseye" } + "args": { "VARIANT": "16-bullseye" } }, // Set *default* container specific settings.json values on container create. diff --git a/.github/workflows/on-merge-to-main.yml b/.github/workflows/on-merge-to-main.yml index 0a3429227c..8e6a270146 100644 --- a/.github/workflows/on-merge-to-main.yml +++ b/.github/workflows/on-merge-to-main.yml @@ -21,10 +21,10 @@ jobs: ######################### # Release new version ######################### - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" diff --git a/.github/workflows/on-release-prod.yml b/.github/workflows/on-release-prod.yml index 5ee78f4c68..bb1aab93de 100644 --- a/.github/workflows/on-release-prod.yml +++ b/.github/workflows/on-release-prod.yml @@ -21,10 +21,10 @@ jobs: ######################### # Release new version ######################### - - name: "Use NodeJS 14" + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index f825016d5c..aab35ed779 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -9,10 +9,10 @@ jobs: NODE_ENV: dev steps: - uses: actions/checkout@v3 - - name: Set up Node + - name: "Use NodeJS 16" uses: actions/setup-node@v3 with: - node-version: '14' + node-version: '16' - name: Install npm@8.x run: npm i -g npm@next-8 - name: "Setup npm" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 301a291d15..4de6e2f6ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,7 +61,7 @@ The alternative is to use a Cloud IDE like [Gitpod](https://www.gitpod.io/) or [ The following tools need to be installed on your system prior to starting working on a pull request: -- [Node.js >= 14.18.1](https://nodejs.org/download/release/latest-v14.x/) +- [Node.js >= 16.x](https://nodejs.org/download/release/latest-v16.x/) - We recommend using a version in [Active LTS](https://nodejs.org/en/about/releases/) - If you use [nvm](https://github.com/nvm-sh/nvm#nvmrc) or [fnm](https://github.com/Schniz/fnm) you can install the latest LTS version with `nvm use` or `fnm use` respectively. Both will use the `.nvmrc` file in the project's root. - [npm 8.x](https://www.npmjs.com/) @@ -250,7 +250,7 @@ Contributions via pull requests are much appreciated. ### Summary -* This project uses `node@14.x` and `npm@8.x` for development (see [Setup](#setup)). +* This project uses `node@16.x` and `npm@8.x` for development (see [Setup](#setup)). * Before opening a Pull Request, please find the existing related issue or open a new one to discuss the proposed changes. A PR without a related issue or discussion has a high risk of being rejected. We are very appreciative and thankful for your time and efforts, and we want to make sure they are not wasted. * After your proposal has been reviewed and accepted by at least one of the project's maintainers, you can submit a pull request. * When opening a PR, make sure to follow the checklist inside the pull request template. diff --git a/docs/core/logger.md b/docs/core/logger.md index d554d0e1e0..bcaa8f9291 100644 --- a/docs/core/logger.md +++ b/docs/core/logger.md @@ -82,7 +82,7 @@ For a **complete list** of supported environment variables, refer to [this secti ShoppingCartApiFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Environment: Variables: LOG_LEVEL: WARN diff --git a/docs/core/metrics.md b/docs/core/metrics.md index c3d1fe873e..bfe04aa609 100644 --- a/docs/core/metrics.md +++ b/docs/core/metrics.md @@ -101,7 +101,7 @@ The `Metrics` utility is instantiated outside of the Lambda handler. In doing th HelloWorldFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Environment: Variables: POWERTOOLS_SERVICE_NAME: orders diff --git a/docs/core/tracer.md b/docs/core/tracer.md index 8f24399847..4f8241f1e2 100644 --- a/docs/core/tracer.md +++ b/docs/core/tracer.md @@ -88,7 +88,7 @@ The `Tracer` utility is instantiated outside of the Lambda handler. In doing thi HelloWorldFunction: Type: AWS::Serverless::Function Properties: - Runtime: nodejs14.x + Runtime: nodejs16.x Tracing: Active Environment: Variables: diff --git a/examples/sam/template.yaml b/examples/sam/template.yaml index 85bfb190ab..18a5662b42 100644 --- a/examples/sam/template.yaml +++ b/examples/sam/template.yaml @@ -15,7 +15,7 @@ Transform: AWS::Serverless-2016-10-31 # https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-specification-template-anatomy-globals.html Globals: Function: - Runtime: nodejs14.x + Runtime: nodejs16.x Architectures: - x86_64 MemorySize: 128 diff --git a/package.json b/package.json index 67c7238487..be790a316d 100644 --- a/package.json +++ b/package.json @@ -83,9 +83,9 @@ "lib/**/*" ], "engines": { - "node": ">=10" + "node": ">=12" }, "dependencies": { "hosted-git-info": "^5.0.0" } -} +} \ No newline at end of file diff --git a/packages/logger/package.json b/packages/logger/package.json index 9ea15814ab..08bc20bc2c 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --watch --group=unit", "build": "tsc", @@ -65,4 +66,4 @@ "lodash.merge": "^4.6.2", "lodash.pickby": "^4.6.0" } -} +} \ No newline at end of file diff --git a/packages/logger/tests/e2e/basicFeatures.middy.test.ts b/packages/logger/tests/e2e/basicFeatures.middy.test.ts index c2e1b73a92..3b22dba631 100644 --- a/packages/logger/tests/e2e/basicFeatures.middy.test.ts +++ b/packages/logger/tests/e2e/basicFeatures.middy.test.ts @@ -26,7 +26,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/logger/tests/e2e/childLogger.manual.test.ts b/packages/logger/tests/e2e/childLogger.manual.test.ts index 8c2c1e5c02..b8bc59c47d 100644 --- a/packages/logger/tests/e2e/childLogger.manual.test.ts +++ b/packages/logger/tests/e2e/childLogger.manual.test.ts @@ -26,7 +26,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/logger/tests/e2e/sampleRate.decorator.test.ts b/packages/logger/tests/e2e/sampleRate.decorator.test.ts index 8ccd18e73f..038d61b4b5 100644 --- a/packages/logger/tests/e2e/sampleRate.decorator.test.ts +++ b/packages/logger/tests/e2e/sampleRate.decorator.test.ts @@ -26,7 +26,7 @@ import { TEARDOWN_TIMEOUT } from './constants'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/metrics/package.json b/packages/metrics/package.json index 5b59b5910f..ca476ecc1a 100644 --- a/packages/metrics/package.json +++ b/packages/metrics/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --group=unit --watch ", "build": "tsc", @@ -69,4 +70,4 @@ "dependencies": { "@aws-lambda-powertools/commons": "^0.8.1" } -} +} \ No newline at end of file diff --git a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts index c23bb78086..1b6b017246 100644 --- a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts +++ b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts @@ -29,7 +29,7 @@ import { } from './constants'; import { getMetrics } from '../helpers/metricsUtils'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs6x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/metrics/tests/e2e/basicFeatures.manual.test.ts b/packages/metrics/tests/e2e/basicFeatures.manual.test.ts index 56548fac78..f0ebecfdfc 100644 --- a/packages/metrics/tests/e2e/basicFeatures.manual.test.ts +++ b/packages/metrics/tests/e2e/basicFeatures.manual.test.ts @@ -29,7 +29,7 @@ import { } from './constants'; import { getMetrics } from '../helpers/metricsUtils'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/package.json b/packages/tracer/package.json index 6cf33c023f..9fbeccebfc 100644 --- a/packages/tracer/package.json +++ b/packages/tracer/package.json @@ -15,6 +15,7 @@ "test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose", "test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e", "test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e", + "test:e2e:nodejs16x": "RUNTIME=nodejs16x jest --group=e2e", "test:e2e": "jest --group=e2e", "watch": "jest --watch", "build": "tsc", @@ -51,4 +52,4 @@ "@aws-lambda-powertools/commons": "^0.8.1", "aws-xray-sdk-core": "^3.3.4" } -} +} \ No newline at end of file diff --git a/packages/tracer/tests/e2e/allFeatures.decorator.test.ts b/packages/tracer/tests/e2e/allFeatures.decorator.test.ts index 5869c46e78..535a9660e1 100644 --- a/packages/tracer/tests/e2e/allFeatures.decorator.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.decorator.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/allFeatures.manual.test.ts b/packages/tracer/tests/e2e/allFeatures.manual.test.ts index ba56577945..de8920f55b 100644 --- a/packages/tracer/tests/e2e/allFeatures.manual.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.manual.test.ts @@ -41,7 +41,7 @@ import { assertAnnotation } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/allFeatures.middy.test.ts b/packages/tracer/tests/e2e/allFeatures.middy.test.ts index c4be1934f2..8cb26b84b6 100644 --- a/packages/tracer/tests/e2e/allFeatures.middy.test.ts +++ b/packages/tracer/tests/e2e/allFeatures.middy.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts b/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts index 46f8dedd7b..96f4de7abc 100644 --- a/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts +++ b/packages/tracer/tests/e2e/asyncHandler.decorator.test.ts @@ -40,7 +40,7 @@ import { assertErrorAndFault, } from '../helpers/traceAssertions'; -const runtime: string = process.env.RUNTIME || 'nodejs14x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`); diff --git a/packages/tracer/tests/helpers/populateEnvironmentVariables.ts b/packages/tracer/tests/helpers/populateEnvironmentVariables.ts index b462aa0847..4eb2b25522 100644 --- a/packages/tracer/tests/helpers/populateEnvironmentVariables.ts +++ b/packages/tracer/tests/helpers/populateEnvironmentVariables.ts @@ -1,7 +1,7 @@ // Reserved variables process.env._X_AMZN_TRACE_ID = '1-abcdef12-3456abcdef123456abcdef12'; process.env.AWS_LAMBDA_FUNCTION_NAME = 'my-lambda-function'; -process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; +process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; process.env.AWS_LAMBDA_FUNCTION_MEMORY_SIZE = '128'; process.env.AWS_REGION = 'eu-west-1'; process.env._HANDLER = 'index.handler'; diff --git a/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts b/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts index 8ffc9c46b3..30e0db93f2 100644 --- a/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts +++ b/packages/tracer/tests/unit/config/EnvironmentVariablesService.test.ts @@ -175,14 +175,14 @@ describe('Class: EnvironmentVariablesService', () => { test('It returns the value of the environment variable AWS_EXECUTION_ENV', () => { // Prepare - process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; + process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; const service = new EnvironmentVariablesService(); // Act const value = service.getAwsExecutionEnv(); // Assess - expect(value).toEqual('nodejs14.x'); + expect(value).toEqual('nodejs16.x'); }); }); diff --git a/packages/tracer/tests/unit/helpers.test.ts b/packages/tracer/tests/unit/helpers.test.ts index 7fdf7823d7..d74b478ae8 100644 --- a/packages/tracer/tests/unit/helpers.test.ts +++ b/packages/tracer/tests/unit/helpers.test.ts @@ -220,7 +220,7 @@ describe('Helper: createTracer function', () => { test('when AWS_EXECUTION_ENV environment variable is set, tracing is enabled', () => { // Prepare - process.env.AWS_EXECUTION_ENV = 'nodejs14.x'; + process.env.AWS_EXECUTION_ENV = 'nodejs16.x'; // Act const tracer = createTracer(); From 1c2038c9901b9e057af6c01f2b31d608f5351493 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 13:32:26 +0000 Subject: [PATCH 04/12] test sam version --- .github/workflows/pr_lint_and_test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index aab35ed779..0dd8630ea1 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -31,7 +31,9 @@ jobs: # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step working-directory: ./examples/sam - run: npm ci + run: | + sam --version + npm ci - name: Run lint run: npm run lerna-lint - name: Run tests From af847765de47f0cac3aabed7b6ac80ffa22ef9e4 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 13:48:34 +0000 Subject: [PATCH 05/12] test sam version --- .github/workflows/pr_lint_and_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 0dd8630ea1..51c7f2ecb3 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -28,6 +28,7 @@ jobs: working-directory: ./examples/cdk run: npm ci - name: Install SAM example packages + uses: aws-actions/setup-sam@v2 # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step working-directory: ./examples/sam From 7420b86adb243ea6370447a27f94570c8b998c9d Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 14:33:49 +0000 Subject: [PATCH 06/12] revert --- .github/workflows/pr_lint_and_test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 51c7f2ecb3..0dd8630ea1 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -28,7 +28,6 @@ jobs: working-directory: ./examples/cdk run: npm ci - name: Install SAM example packages - uses: aws-actions/setup-sam@v2 # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step working-directory: ./examples/sam From 0547533e6067d3fc6f5a9a6b5cd63a0f28b27469 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 14:36:17 +0000 Subject: [PATCH 07/12] sam --- .github/workflows/pr_lint_and_test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 0dd8630ea1..37901d5a46 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -27,6 +27,9 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + uses: aws-actions/setup-sam@v2 + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step From f4c4246c7765b9e38a8107ce04b5c509ae7c3c0a Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 14:36:54 +0000 Subject: [PATCH 08/12] sam --- .github/workflows/pr_lint_and_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 37901d5a46..58aeb72178 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -29,6 +29,7 @@ jobs: run: npm ci - name: "Setup SAM" uses: aws-actions/setup-sam@v2 + with: version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install From 822f839308d7f48bc61e983b043021f29250e46d Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 15:06:38 +0000 Subject: [PATCH 09/12] sam --- .github/workflows/pr_lint_and_test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 58aeb72178..3183f1ae74 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -27,11 +27,10 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci - - name: "Setup SAM" + - name: "Install SAM example packages" uses: aws-actions/setup-sam@v2 with: version: 1.49.0 - - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step working-directory: ./examples/sam From 8c2e436fbd6668060f756f56a53931e5e0990306 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 15:09:44 +0000 Subject: [PATCH 10/12] sam --- .github/workflows/on-merge-to-main.yml | 5 +++++ .github/workflows/on-release-prod.yml | 5 +++++ .github/workflows/pr_lint_and_test.yml | 4 +++- .github/workflows/run-e2e-tests.yml | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/on-merge-to-main.yml b/.github/workflows/on-merge-to-main.yml index 8e6a270146..607265c08b 100644 --- a/.github/workflows/on-merge-to-main.yml +++ b/.github/workflows/on-merge-to-main.yml @@ -39,6 +39,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step diff --git a/.github/workflows/on-release-prod.yml b/.github/workflows/on-release-prod.yml index bb1aab93de..5acdb0fa82 100644 --- a/.github/workflows/on-release-prod.yml +++ b/.github/workflows/on-release-prod.yml @@ -39,6 +39,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step diff --git a/.github/workflows/pr_lint_and_test.yml b/.github/workflows/pr_lint_and_test.yml index 3183f1ae74..44dbff44a0 100644 --- a/.github/workflows/pr_lint_and_test.yml +++ b/.github/workflows/pr_lint_and_test.yml @@ -27,10 +27,12 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci - - name: "Install SAM example packages" + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version uses: aws-actions/setup-sam@v2 with: version: 1.49.0 + - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step working-directory: ./examples/sam diff --git a/.github/workflows/run-e2e-tests.yml b/.github/workflows/run-e2e-tests.yml index 63436c6293..b6420d71f0 100644 --- a/.github/workflows/run-e2e-tests.yml +++ b/.github/workflows/run-e2e-tests.yml @@ -24,6 +24,11 @@ jobs: # the dependencies in a separate step working-directory: ./examples/cdk run: npm ci + - name: "Setup SAM" + # We use an ad-hoc action so we can specify the SAM CLI version + uses: aws-actions/setup-sam@v2 + with: + version: 1.49.0 - name: Install SAM example packages # Since we are not managing the SAM examples with npm workspaces we install # the dependencies in a separate step From e0c275397fd694f5d9eef633d985904c2a1c72ed Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Fri, 13 May 2022 15:24:14 +0000 Subject: [PATCH 11/12] chore: updated cdk example runtime --- examples/cdk/src/example-function.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/cdk/src/example-function.ts b/examples/cdk/src/example-function.ts index def8d2ecdf..be9bbd97a7 100644 --- a/examples/cdk/src/example-function.ts +++ b/examples/cdk/src/example-function.ts @@ -2,7 +2,7 @@ import { custom_resources, aws_iam } from 'aws-cdk-lib'; import { Events } from '@aws-lambda-powertools/commons'; import { Construct } from 'constructs'; import { NodejsFunction, NodejsFunctionProps } from 'aws-cdk-lib/aws-lambda-nodejs'; -import { Tracing } from 'aws-cdk-lib/aws-lambda'; +import { Tracing, Runtime } from 'aws-cdk-lib/aws-lambda'; interface ExampleFunctionProps { readonly functionName: string @@ -23,6 +23,7 @@ class ExampleFunction extends Construct { const fn = new NodejsFunction(this, functionName, { tracing: tracingActive ? Tracing.ACTIVE : Tracing.DISABLED, + runtime: Runtime.NODEJS_16_X, ...fnProps }); From 336778c8672da327bfb66a96cf226e472abf4917 Mon Sep 17 00:00:00 2001 From: Andrea Amorosi Date: Wed, 18 May 2022 14:40:53 +0200 Subject: [PATCH 12/12] Update packages/metrics/tests/e2e/basicFeatures.decorators.test.ts Co-authored-by: Florian Chazal --- packages/metrics/tests/e2e/basicFeatures.decorators.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts index 1b6b017246..5d53d812d5 100644 --- a/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts +++ b/packages/metrics/tests/e2e/basicFeatures.decorators.test.ts @@ -29,7 +29,7 @@ import { } from './constants'; import { getMetrics } from '../helpers/metricsUtils'; -const runtime: string = process.env.RUNTIME || 'nodejs6x'; +const runtime: string = process.env.RUNTIME || 'nodejs16x'; if (!isValidRuntimeKey(runtime)) { throw new Error(`Invalid runtime key value: ${runtime}`);