-
Notifications
You must be signed in to change notification settings - Fork 60
feat: w3c field #201
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
base: nodejs24.x
Are you sure you want to change the base?
feat: w3c field #201
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: dockerized-test | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: | ||
| branches: [nodejs24.x] | ||
| pull_request: | ||
| branches: ['*'] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| dockerized-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '24' | ||
| cache: npm | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci --ignore-scripts | ||
|
|
||
| - name: Build the RIC tarball | ||
| # Produces build-artifacts/aws-lambda-ric-<version>.tgz, which | ||
| # Dockerfile.test unpacks into /var/runtime in the test image. | ||
| run: npm run build:container | ||
|
|
||
| - name: Build the test image | ||
| run: | | ||
| docker build . \ | ||
| -t local/test \ | ||
| -f Dockerfile.test \ | ||
| --build-arg BASE_IMAGE=public.ecr.aws/lambda/nodejs:24 | ||
|
|
||
| - name: Run dockerized suites | ||
| uses: aws/containerized-test-runner-for-aws-lambda@76eacfb110903739d9c5f7fcdaafede6324a1473 # maxday/client-context | ||
| with: | ||
| suiteFileArray: '["./test/dockerized/suites/*.json"]' | ||
| dockerImageName: 'local/test' | ||
| taskFolder: './test/dockerized/tasks' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,11 +23,11 @@ RUN mkdir -p /build && \ | |
| ls -R /build/deps | ||
|
|
||
| # Copy bare config | ||
| COPY package.json tsconfig.json eslint.config.js vitest.config.js vitest.setup.ts /app/ | ||
| COPY package.json package-lock.json tsconfig.json eslint.config.js vitest.config.js vitest.setup.ts /app/ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very nice find! Very important 🚀 |
||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN npm install --ignore-scripts | ||
| RUN npm ci --ignore-scripts | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: we should move to |
||
|
|
||
| COPY src /app/src | ||
| COPY scripts/build.js /app/scripts/build.js | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| ARG BASE_IMAGE=public.ecr.aws/lambda/nodejs:24 | ||
| FROM $BASE_IMAGE | ||
|
|
||
| # Swap the RIC shipped in the base image for the one we just built. | ||
| ADD build-artifacts/aws-lambda-ric-*.tgz /tmp/ | ||
| RUN mv /tmp/package/* /var/runtime/ && rm -rf /tmp/package | ||
|
|
||
| COPY test/dockerized/tasks /var/task/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,14 @@ export const REQUIRED_ENV_VARS = [ | |
| "AWS_LAMBDA_LOG_STREAM_NAME", | ||
| ]; | ||
|
|
||
| export const W3C_ALLOWED_FIELDS = [ | ||
| "traceparent", | ||
| "tracestate", | ||
| "baggage", | ||
| ] as const; | ||
|
|
||
| export type W3CFieldName = (typeof W3C_ALLOWED_FIELDS)[number]; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this used? |
||
|
|
||
| // This RIC is used by Nodejs24 and above, it's used by NOdejs22 only for LMI and not OD | ||
| export const CALLBACK_ERROR_NODEJS22 = | ||
| "ERROR: AWS Lambda does not support callback-based function handlers when using Node.js 22 with Managed Instances. To use Managed Instances, modify this function to use a supported handler signature. For more information see https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html."; | ||
|
|
||
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.
will change to change when aws/containerized-test-runner-for-aws-lambda#32 will be reviewed and merged