Skip to content

Commit e8c1ef2

Browse files
authored
Merge branch 'main' into 3183-idempotency-redis
2 parents b8e8f83 + 9f8e224 commit e8c1ef2

File tree

10 files changed

+73
-34
lines changed

10 files changed

+73
-34
lines changed

.github/scripts/update_layer_arn.sh

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/bin/bash
22

3-
# This script is run during the reusable_update_v2_layer_arn_docs CI job,
3+
# This script is run during the publish_layer workflow,
44
# 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.
5+
# based on the output files generated by CDK.
66
#
7-
# see .github/workflows/reusable_deploy_v2_layer_stack.yml
7+
# see .github/workflows/publish_layer.yml
88

99
set -eo pipefail
1010

@@ -18,6 +18,7 @@ EOM
1818
fi
1919

2020
CDK_OUTPUT_DIR=$1
21+
DOCS_FILE="docs/getting-started/lambda-layers.md"
2122

2223
# Check if CDK output dir is a directory
2324
if [ ! -d "$CDK_OUTPUT_DIR" ]; then
@@ -44,7 +45,7 @@ for file in $files; do
4445
# Now replace the all "prefix"s in the file with the full new Layer ARN (line)
4546
# prefix:\d+ ==> line
4647
# 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+
sed -i -e "s/$prefix:[[:digit:]][[:digit:]]*/$line/g" $DOCS_FILE
4849

4950
# We use the eu-central-1 layer as the version for all the frameworks (SAM, CDK, SLS, etc)
5051
# We could have used any other region. What's important is the version at the end.
@@ -65,8 +66,33 @@ for file in $files; do
6566

6667
# Replace all the "prefix_pseudo_region"'s in the file
6768
# 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+
sed -i -e "s/$prefix_pseudo_region:[[:digit:]][[:digit:]]*/$line_pseudo_region/g" $DOCS_FILE
6970
done
7071
fi
7172
done
7273
done
74+
75+
echo "[+] Finished processing all commercial regions"
76+
77+
# Now we need to process GovCloud regions
78+
#
79+
# GovCloud layers are not available in the CDK output files, but we know the ARN format and that the version is the same
80+
# as the one in eu-central-1. So we can optimistically update the version of the GovCloud layers in the documentation.
81+
#
82+
# The GovCloud ARNs are (note that the account IDs are different in both):
83+
# arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsTypeScriptV2:25
84+
# arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsTypeScriptV2:25
85+
86+
version=$(echo "$line" | cut -d ':' -f 8) # version = 25
87+
arn_us_gov_west_1="arn:aws-us-gov:lambda:us-gov-west-1:165093116878:layer:AWSLambdaPowertoolsTypeScriptV2:$version"
88+
prefix_us_gov_west_1=$(echo "$arn_us_gov_west_1" | cut -d ':' -f 1-7)
89+
arn_us_gov_east_1="arn:aws-us-gov:lambda:us-gov-east-1:165087284144:layer:AWSLambdaPowertoolsTypeScriptV2:$version"
90+
prefix_us_gov_east_1=$(echo "$arn_us_gov_east_1" | cut -d ':' -f 1-7)
91+
echo -e "\t[*] ARN GovCloud US West 1: $arn_us_gov_west_1"
92+
echo -e "\t[*] ARN GovCloud US East 1: $arn_us_gov_east_1"
93+
# Replace all the "arn_us_gov_west_1"'s in the file
94+
sed -i -e "s/$prefix_us_gov_west_1:[[:digit:]][[:digit:]]*/$arn_us_gov_west_1/g" $DOCS_FILE
95+
# Replace all the "arn_us_gov_east_1"'s in the file
96+
sed -i -e "s/$prefix_us_gov_east_1:[[:digit:]][[:digit:]]*/$arn_us_gov_east_1/g" $DOCS_FILE
97+
echo "[+] Finished processing all GovCloud regions"
98+
echo "[+] Finished processing all regions"

.github/workflows/ossf_scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ jobs:
4343

4444
# Upload the results to GitHub's code scanning dashboard.
4545
- name: "Upload to code-scanning"
46-
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
46+
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
4747
with:
4848
sarif_file: results.sarif

.github/workflows/publish_layer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
id: create-pr
111111
uses: ./.github/actions/create-pr
112112
with:
113-
files: 'docs/index.md'
113+
files: 'docs/getting-started/lambda-layers.md'
114114
temp_branch_prefix: 'ci-layer-docs'
115115
pull_request_title: 'chore(ci): update layer ARN on documentation'
116116
github_token: ${{ secrets.GITHUB_TOKEN }}

docs/maintainers.md

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -163,18 +163,22 @@ Some examples using our initial and new RFC templates: [#447](https://github.com
163163

164164
### Releasing a new version
165165

166-
Firstly, make sure all the PRs that you want to include in the release are merged into the `main` branch.
167-
168-
Next, run the integration tests one last time to make sure everything is working as expected. See [Run end to end tests](#run-end-to-end-tests) for more details.
169-
170-
**Looks good, what's next?**
171-
172-
Kickoff the `Make Release` workflow with the intended version - this might take around 20m-25m to complete.
166+
Releasing a new version is a multi-step process that requires up to 3 hours to complete. Below a checklist of the main steps to follow:
167+
168+
1. **End to end tests**: Run the [e2e tests](#run-end-to-end-tests) and make sure they pass.
169+
2. **Version bump**: Run the `Make Version` workflow to bump the version. This will create a PR with the new version and a changelog. Visually inspect the diff and make sure the changelog and version are correct, then merge the PR.
170+
3. **Make Release**: Run the `Make Release` workflow. This will: 1/ run the unit tests again, 2/ build and publish to npmjs.com, 3/ build and deploy the Lambda layers to beta and prod, 4/ run canary tests, 5/ update the documentation with the new version.
171+
4. **Review and approve docs PR**: Once the `Make Release` workflow is complete, a PR will be created to update the documentation with the new version. Review and approve this PR **but do not merge it yet**. Take note of the Lambda layer version that was deployed, as this will be used in the next step.
172+
5. **Publish GovCloud Layers (Gamma)**: Run the `Layer Deployment (GovCloud)` workflow with the `main` branch, targeting the `gamma` account, and using the Lambda layer version from the previous step. This will publish the Lambda layers to GovCloud. Visually inspect the output JSON files and make sure the Lambda layer version and package version are correct.
173+
6. **Publish GovCloud Layers (Prod)**: Run the `Layer Deployment (GovCloud)` workflow with the `main` branch, targeting the `prod` account, and using the Lambda layer version from the previous step. This will publish the Lambda layers to GovCloud. Visually inspect the output JSON files and make sure the Lambda layer version and package version are correct.
174+
7. **Merge docs PR**: Once the `Layer Deployment (GovCloud)` workflow is complete, merge the PR to update the documentation with the new version.
175+
8. **Update SSM Parameters (Beta)**: Run the `SSM Parameters` workflow with the `main` branch, targeting the `beta` account, and using the package version from npm (i.e. `2.20.0`) and Lambda layer version from the previous steps. This will update the SSM parameters with the new version.
176+
9. **Verify SSM Parameters (Beta)**: Use the AWS CLI to verify that the SSM parameters were updated correctly. Run the following command: `aws ssm get-parameter --name=/aws/service/powertools/typescript/generic/all/latest` and `aws ssm get-parameter --name=/aws/service/powertools/typescript/generic/all/<version>` to verify that the SSM parameters were updated correctly.
177+
10. **Update SSM Parameters (Prod)**: Run the `SSM Parameters` workflow with the `main` branch, targeting the `prod` account, and using the package version from npm (i.e. `2.20.0`) and Lambda layer version from the previous steps. This will update the SSM parameters with the new version.
178+
11. **Update Docs**: Run the `Rebuild latest docs` workflow with the `main` branch using the package version from npm (i.e. `2.20.0`). This will update the documentation with the new version.
173179

174180
Once complete, you can start drafting the release notes to let customers know **what changed and what's in it for them (a.k.a why they should care)**. We have guidelines in the release notes section so you know what good looks like.
175181

176-
> **NOTE**: Documentation might take a few minutes to reflect the latest version due to caching and CDN invalidations.
177-
178182
#### Release process visualized
179183

180184
Every release makes dozens of checks, linting, canaries and deployments - all of these are automated through a number of distinct workflows that together make up the release process.
@@ -228,13 +232,25 @@ section Docs
228232
Create commit (Layer ARN) : active, 10:18, 8s
229233
Open docs PR : active, 8s
230234
231-
Review andmerge docs PR : milestone, m5
235+
Review and merge docs PR : milestone, m5
232236
233237
Publish updated docs : active, 2m
234238
235-
Documentation release : milestone, m6
239+
section GovCloud
240+
Publish GovCloud layers (Beta) : active, 8s
241+
Publish GovCloud layers (Prod) : active, 8s
242+
GovCloud layers published : milestone, m6
243+
244+
245+
section Documentation
246+
Update SSM parameters (Beta) : active, 8s
247+
Update SSM parameters (Prod) : active, 8s
248+
249+
SSM Parameters updated: milestone, m7
250+
251+
Documentation release : milestone, m8
236252
237-
Release complete : milestone, m7
253+
Release complete : milestone, m9
238254
```
239255

240256
#### Drafting release notes

examples/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"devDependencies": {
3131
"@types/aws-lambda": "^8.10.149",
3232
"@types/node": "22.15.3",
33-
"aws-cdk-lib": "^2.193.0",
33+
"aws-cdk-lib": "^2.194.0",
3434
"constructs": "^10.4.2",
3535
"source-map-support": "^0.5.21",
3636
"tsx": "^4.19.4",

layers/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"dependencies": {
4343
"aws-cdk": "^2.1013.0",
44-
"aws-cdk-lib": "^2.193.0",
44+
"aws-cdk-lib": "^2.194.0",
4545
"esbuild": "^0.25.3",
4646
"tsx": "^4.19.4"
4747
}

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/event-handler/src/appsync-events/AppSyncEventsResolver.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,7 @@ class AppSyncEventsResolver extends Router {
173173
}
174174
const { handler } = routeHandlerOptions;
175175
try {
176-
return await (handler as OnSubscribeHandler).apply(this, [
177-
event,
178-
context,
179-
]);
176+
await (handler as OnSubscribeHandler).apply(this, [event, context]);
180177
} catch (error) {
181178
this.logger.error(`An error occurred in handler ${path}`, error);
182179
if (error instanceof UnauthorizedException) throw error;

packages/event-handler/tests/unit/AppSyncEventsResolver.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('Class: AppSyncEventsResolver', () => {
7575
expect(result).toEqual(null);
7676
});
7777

78-
it('returns the response of the onSubscribe handler', async () => {
78+
it('ignores the response of the onSubscribe handler', async () => {
7979
// Prepare
8080
const app = new AppSyncEventsResolver({ logger: console });
8181
app.onSubscribe('/foo', async () => true);
@@ -87,7 +87,7 @@ describe('Class: AppSyncEventsResolver', () => {
8787
);
8888

8989
// Assess
90-
expect(result).toBe(true);
90+
expect(result).toBe(undefined);
9191
});
9292

9393
it.each([

packages/testing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"@aws-cdk/toolkit-lib": "^0.3.3",
101101
"@aws-sdk/client-lambda": "^3.799.0",
102102
"@smithy/util-utf8": "^4.0.0",
103-
"aws-cdk-lib": "^2.193.0",
103+
"aws-cdk-lib": "^2.194.0",
104104
"esbuild": "^0.25.3",
105105
"promise-retry": "^2.0.1"
106106
},

0 commit comments

Comments
 (0)