Skip to content

Commit bac9eb1

Browse files
committed
chore: fix merge conflicts
2 parents 2ed61c6 + 919853e commit bac9eb1

File tree

78 files changed

+2096
-12578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2096
-12578
lines changed

Diff for: .devcontainer/devcontainer.json

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"firsttris.vscode-jest-runner",
2323
"visualstudioexptteam.vscodeintellicode",
2424
"amazonwebservices.aws-toolkit-vscode",
25-
"ms-vscode.vscode-typescript-tslint-plugin",
2625
"ms-azuretools.vscode-docker"
2726
],
2827
// Use 'postCreateCommand' to run commands after the container is created.

Diff for: .github/ISSUE_TEMPLATE/bug_report.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,31 @@ body:
2828
attributes:
2929
label: Code snippet
3030
description: Please share a code snippet to help us reproduce the issue
31-
render: JavaScript
31+
placeholder: |
32+
```typescript
33+
some code here
34+
```
3235
validations:
3336
required: true
34-
- type: textarea
35-
id: solution
36-
attributes:
37-
label: Possible Solution
38-
description: If known, please suggest a potential resolution
39-
validations:
40-
required: false
4137
- type: textarea
4238
id: steps
4339
attributes:
4440
label: Steps to Reproduce
4541
description: Please share how we might be able to reproduce this issue
42+
placeholder: |
43+
1. In this environment...
44+
2. With this config...
45+
3. Run '...'
46+
4. See error...
4647
validations:
4748
required: true
49+
- type: textarea
50+
id: solution
51+
attributes:
52+
label: Possible Solution
53+
description: If known, please suggest a potential resolution
54+
validations:
55+
required: false
4856
- type: input
4957
id: version
5058
attributes:
@@ -69,7 +77,7 @@ body:
6977
label: Packaging format used
7078
options:
7179
- Lambda Layers
72-
- Npm
80+
- npm
7381
multiple: true
7482
validations:
7583
required: true

Diff for: .github/ISSUE_TEMPLATE/config.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
44
url: https://github.com/awslabs/aws-lambda-powertools-typescript/discussions/new
5-
about: Ask a general question about Lambda Powertools
5+
about: Ask a general question about Lambda Powertools
6+
- name: Join Community Discord Server
7+
url: https://discord.gg/B8zZKbbyET
8+
about: "Check out the #typescript channel"

Diff for: .github/ISSUE_TEMPLATE/feature_request.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ body:
77
attributes:
88
value: |
99
Thank you for taking the time to suggest an idea to the Lambda Powertools project.
10-
11-
*Future readers*: Please react with 👍 and your use case to help us understand customer demand.
1210
- type: textarea
1311
id: problem
1412
attributes:
@@ -38,11 +36,17 @@ body:
3836
options:
3937
- label: This feature request meets [Lambda Powertools Tenets](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/#tenets)
4038
required: true
41-
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/)
39+
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
4240
required: false
4341
- type: markdown
4442
attributes:
4543
value: |
4644
---
4745
48-
**Disclaimer**: After creating an issue, please wait until it is triaged and confirmed by a maintainer before implementing it. This will reduce amount of rework and the chance that a pull request gets rejected.
46+
**Disclaimer**: After creating an issue, please wait until it is triaged and confirmed by a maintainer before implementing it. This will reduce amount of rework and the chance that a pull request gets rejected.
47+
- type: input
48+
id: notes
49+
attributes:
50+
label: Future readers
51+
description: Please not edit this field
52+
value: "Please react with 👍 and your use case to help us understand customer demand."

Diff for: .github/ISSUE_TEMPLATE/maintenance.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ body:
77
attributes:
88
value: |
99
Thank you for taking the time to help us improve this project.
10-
11-
*Future readers*: Please react with 👍 and your use case to help us understand customer demand.
1210
- type: textarea
1311
id: activity
1412
attributes:
@@ -52,11 +50,17 @@ body:
5250
options:
5351
- label: This request meets [Lambda Powertools Tenets](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/#tenets)
5452
required: true
55-
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/)
53+
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
5654
required: false
5755
- type: markdown
5856
attributes:
5957
value: |
6058
---
6159
62-
**Disclaimer**: After creating an issue, please wait until it is triaged and confirmed by a maintainer before implementing it. This will reduce amount of rework and the chance that a pull request gets rejected.
60+
**Disclaimer**: After creating an issue, please wait until it is triaged and confirmed by a maintainer before implementing it. This will reduce amount of rework and the chance that a pull request gets rejected.
61+
- type: input
62+
id: notes
63+
attributes:
64+
label: Future readers
65+
description: Please not edit this field
66+
value: "Please react with 👍 and your use case to help us understand customer demand."

Diff for: .github/ISSUE_TEMPLATE/rfc.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ body:
8383
options:
8484
- label: This feature request meets [Lambda Powertools Tenets](https://awslabs.github.io/aws-lambda-powertools-typescript/latest/#tenets)
8585
required: true
86-
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/)
86+
- label: Should this be considered in other Lambda Powertools languages? i.e. [Python](https://github.com/awslabs/aws-lambda-powertools-python/), [Java](https://github.com/awslabs/aws-lambda-powertools-java/), and [.NET](https://github.com/awslabs/aws-lambda-powertools-dotnet/)
8787
required: false
8888
- type: markdown
8989
attributes:
@@ -96,4 +96,10 @@ body:
9696
9797
* RFC PR:
9898
* Approved by: ''
99-
* Reviewed by: ''
99+
* Reviewed by: ''
100+
- type: input
101+
id: notes
102+
attributes:
103+
label: Future readers
104+
description: Please not edit this field
105+
value: "Please react with 👍 and your use case to help us understand customer demand."

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
<!--- If no issue is present the PR might get blocked and not be reviewed. -->
2626
**Issue number:**
2727

28-
### PR status
29-
30-
***Is this ready for review?:*** NO
31-
***Is it a breaking change?:*** NO
32-
3328
## Checklist
3429

3530
- [ ] [My changes meet the tenets criteria](https://awslabs.github.io/aws-lambda-powertools-typescript/#tenets)
@@ -46,6 +41,8 @@
4641

4742
### Breaking change checklist
4843

44+
***Is it a breaking change?:*** NO
45+
4946
- [ ] I have documented the migration process
5047
- [ ] I have added, implemented necessary warnings (if it can live side by side)
5148

Diff for: .github/scripts/setup_tmp_layer_files.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
rm -rf tmp/nodejs
3+
mkdir -p tmp/nodejs
4+
cd tmp/nodejs
5+
npm init -y
6+
npm i \
7+
@aws-lambda-powertools/logger@$VERSION \
8+
@aws-lambda-powertools/metrics@$VERSION \
9+
@aws-lambda-powertools/tracer@$VERSION
10+
rm -rf node_modules/@types \
11+
package.json \
12+
package-lock.json
13+
cd ../..

Diff for: .github/scripts/update_layer_arn.sh

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/bin/bash
2+
3+
# This script is run during the reusable_update_v2_layer_arn_docs CI job,
4+
# and it is responsible for replacing the layer ARN in our documentation,
5+
# based on the output files generated by CDK when deploying to each pseudo_region.
6+
#
7+
# see .github/workflows/reusable_deploy_v2_layer_stack.yml
8+
9+
set -eo pipefail
10+
11+
if [[ $# -ne 1 ]]; then
12+
cat <<EOM
13+
Usage: $(basename $0) cdk-output-dir
14+
15+
cdk-output-dir: directory containing the cdk output files generated when deploying the Layer
16+
EOM
17+
exit 1
18+
fi
19+
20+
CDK_OUTPUT_DIR=$1
21+
22+
# Check if CDK output dir is a directory
23+
if [ ! -d "$CDK_OUTPUT_DIR" ]; then
24+
echo "No $CDK_OUTPUT_DIR directory found, not replacing lambda layer versions"
25+
exit 1
26+
fi
27+
28+
# Process each file inside the directory
29+
files="$CDK_OUTPUT_DIR/*"
30+
for file in $files; do
31+
echo "[+] Processing: $file"
32+
33+
# Process each line inside the file
34+
lines=$(cat "$file")
35+
for line in $lines; do
36+
echo -e "\t[*] ARN: $line"
37+
# line = arn:aws:lambda:us-east-1:094274105915:layer:AWSLambdaPowertoolsTypeScript:49
38+
39+
# From the full ARN, extract everything but the version at the end. This prefix
40+
# will later be used to find/replace the ARN on the documentation file.
41+
prefix=$(echo "$line" | cut -d ':' -f 1-7)
42+
# prefix = arn:aws:lambda:us-east-1:094274105915:layer:AWSLambdaPowertoolsTypeScript
43+
44+
# Now replace the all "prefix"s in the file with the full new Layer ARN (line)
45+
# prefix:\d+ ==> line
46+
# sed doesn't support \d+ in a portable way, so we cheat with (:digit: :digit: *)
47+
sed -i -e "s/$prefix:[[:digit:]][[:digit:]]*/$line/g" docs/index.md
48+
49+
# We use the eu-central-1 layer as the version for all the frameworks (SAM, CDK, SLS, etc)
50+
# We could have used any other region. What's important is the version at the end.
51+
52+
# Examples of strings found in the documentation with pseudo regions:
53+
# arn:aws:lambda:{region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:39
54+
# arn:aws:lambda:${AWS::Region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:39
55+
# arn:aws:lambda:${aws:region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:39
56+
# arn:aws:lambda:{env.region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:39
57+
if [[ "$line" == *"eu-central-1"* ]]; then
58+
# These are all the framework pseudo parameters currently found in the docs
59+
for pseudo_region in '{region}' '${AWS::Region}' '${aws::region}' '{aws::region}' '{env.region}' '${cdk.Stack.of(this).region}' '${aws.getRegionOutput().name}'; do
60+
prefix_pseudo_region=$(echo "$prefix" | sed "s/eu-central-1/${pseudo_region}/")
61+
# prefix_pseudo_region = arn:aws:lambda:${AWS::Region}:094274105915:layer:AWSLambdaPowertoolsTypeScript
62+
63+
line_pseudo_region=$(echo "$line" | sed "s/eu-central-1/${pseudo_region}/")
64+
# line_pseudo_region = arn:aws:lambda:${AWS::Region}:094274105915:layer:AWSLambdaPowertoolsTypeScript:49
65+
66+
# Replace all the "prefix_pseudo_region"'s in the file
67+
# prefix_pseudo_region:\d+ ==> line_pseudo_region
68+
sed -i -e "s/$prefix_pseudo_region:[[:digit:]][[:digit:]]*/$line_pseudo_region/g" docs/index.md
69+
done
70+
fi
71+
done
72+
done

Diff for: .github/workflows/make-release.yml

+21-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
publish-npm:
1010
needs: run-unit-tests
1111
runs-on: ubuntu-latest
12+
outputs:
13+
RELEASE_VERSION: ${{ steps.set-release-version.outputs.RELEASE_VERSION }}
1214
steps:
1315
- name: Checkout code
1416
uses: actions/checkout@v3
@@ -28,7 +30,7 @@ jobs:
2830
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
2931
- name: Cache node modules
3032
id: cache-node-modules
31-
uses: actions/cache@v3
33+
uses: actions/cache@69d9d449aced6a2ede0bc19182fadc3a0a42d2b0 # v3.2.6
3234
with:
3335
path: "./node_modules"
3436
# Use the combo between node version, name, and SHA-256 hash of the lock file as cache key so that
@@ -47,3 +49,21 @@ jobs:
4749
git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/$GITHUB_REPOSITORY
4850
npx lerna version --conventional-commits --force-publish --yes
4951
npx lerna publish from-git --no-verify-access --yes
52+
- name: Set release version
53+
id: set-release-version
54+
run: |
55+
RELEASE=$(npm view @aws-lambda-powertools/tracer version)
56+
echo RELEASE_VERSION="$RELEASE_VERSION" >> "$GITHUB_OUTPUT"
57+
58+
# NOTE: Watch out for the depth limit of 4 nested workflow_calls.
59+
# publish_layer -> reusable_deploy_layer_stack -> reusable_update_layer_arn_docs
60+
publish_layer:
61+
needs: publish-npm
62+
secrets: inherit
63+
permissions:
64+
id-token: write
65+
contents: write
66+
pages: write
67+
uses: ./.github/workflows/publish_layer.yml
68+
with:
69+
latest_published_version: ${{ needs.publish-npm.outputs.RELEASE_VERSION }}

Diff for: .github/workflows/measure-packages-size.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
ref: ${{ steps.extract_PR_details.outputs.headSHA }}
3333
- name: Packages size report
34-
uses: flochaz/pkg-size-action@v2.0.0
34+
uses: flochaz/pkg-size-action@e41584e9396375027c8a3c68909e3eca55719e47 # v.2.0.0
3535
with:
3636
build-command: mkdir dist && npm run package -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons -w packages/parameters && npm run package-bundle -w packages/logger -w packages/tracer -w packages/metrics -w packages/commons -w packages/parameters && bash -c "mv ./packages/*/dist/* dist/" && ls dist
3737
dist-directory: /dist

Diff for: .github/workflows/on-merge-to-main.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@ jobs:
2121
needs: get_pr_details
2222
if: ${{ needs.get_pr_details.outputs.prIsMerged == 'true' }}
2323
uses: ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml
24-
publish:
25-
needs:
26-
[get_pr_details, run-unit-tests]
27-
uses: ./.github/workflows/reusable-publish-docs.yml
28-
with:
29-
workflow_origin: ${{ github.event.repository.full_name }}
30-
prIsMerged: ${{ needs.get_pr_details.outputs.prIsMerged }}
31-
secrets:
32-
token: ${{ secrets.GITHUB_TOKEN }}
3324
update-release-draft:
34-
needs: publish
25+
needs: run-unit-tests
3526
runs-on: ubuntu-latest
3627
steps:
3728
- name: Checkout code
3829
uses: actions/checkout@v3
3930
- name: Update release draft
40-
uses: release-drafter/release-drafter@v5.20.0
31+
uses: release-drafter/release-drafter@569eb7ee3a85817ab916c8f8ff03a5bd96c9c83e # v5.23.0
4132
env:
4233
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4334
release_label_on_merge:

Diff for: .github/workflows/on-workflows-push-pr.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lockdown untrusted workflows
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/**"
7+
pull_request:
8+
paths:
9+
- ".github/workflows/**"
10+
11+
jobs:
12+
enforce_pinned_workflows:
13+
name: Harden Security
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
- name: Ensure 3rd party workflows have SHA pinned
19+
uses: zgosalvez/github-actions-ensure-sha-pinned-actions@b9ddf6a5153efe6fb94f071c8915175afdce60fa # v2.1.0
20+
with:
21+
# Trusted GitHub Actions and/or organizations
22+
allowlist: |
23+
aws-actions/
24+
actions/checkout
25+
actions/github-script
26+
actions/setup-node
27+
actions/setup-python
28+
actions/upload-artifact
29+
actions/download-artifact
30+
github/codeql-action/init
31+
github/codeql-action/analyze
32+
dependabot/fetch-metadata

Diff for: .github/workflows/on_doc_merge.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
- "mkdocs.yml"
10+
- "examples/**"
11+
12+
jobs:
13+
release-docs:
14+
permissions:
15+
contents: write
16+
pages: write
17+
uses: ./.github/workflows/reusable-publish-docs.yml
18+
with:
19+
workflow_origin: ${{ github.event.repository.full_name }}
20+
version: dev
21+
alias: stage
22+
secrets:
23+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)