From d50de47335ef3772047d8204b2da1c529183febe Mon Sep 17 00:00:00 2001 From: Hung-Che Lo Date: Thu, 12 Mar 2026 01:06:15 +0800 Subject: [PATCH] fix(notices): join dynamic values with spaces instead of commas The `addDynamicValues` method joined multiple dynamic values with commas, producing invalid `cdk bootstrap` commands like: cdk bootstrap aws://acct/us-east-1,aws://acct/us-west-2 Changed to space separator so the command is valid: cdk bootstrap aws://acct/us-east-1 aws://acct/us-west-2 Also updated JSDoc comments to reflect the new separator. Closes aws/aws-cdk#31963 --- packages/@aws-cdk/toolkit-lib/lib/api/notices/filter.ts | 6 +++--- packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/notices/filter.ts b/packages/@aws-cdk/toolkit-lib/lib/api/notices/filter.ts index 976c1c82e..1f2adb424 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/notices/filter.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/notices/filter.ts @@ -52,7 +52,7 @@ interface ActualComponent { * placeholders look like `{resolve:XYZ}`. * * If there is more than one component with the same dynamic name, they are - * joined by ','. + * joined by ' '. * * @default - Don't add to the set of dynamic values */ @@ -188,7 +188,7 @@ export class NoticesFilter { * Adds dynamic values from the given ActualComponents * * If there are multiple components with the same dynamic name, they are joined - * by a comma. + * by a space. */ private addDynamicValues(comps: ActualComponent[], notice: FilteredNotice) { const dynamicValues: Record = {}; @@ -199,7 +199,7 @@ export class NoticesFilter { } } for (const [key, values] of Object.entries(dynamicValues)) { - notice.addDynamicValue(key, values.join(',')); + notice.addDynamicValue(key, values.join(' ')); } } diff --git a/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts b/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts index 9e79c04df..c829f46c2 100644 --- a/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/api/notices.test.ts @@ -424,7 +424,7 @@ describe(NoticesFilter, () => { bootstrappedEnvironments: bootstrappedEnvironments, }); expect((await filtered).map((f) => f.notice)).toEqual([BASIC_BOOTSTRAP_NOTICE]); - expect((await filtered).map((f) => f.format()).join('\n')).toContain('env1,env2'); + expect((await filtered).map((f) => f.format()).join('\n')).toContain('env1 env2'); }); test('ignores invalid bootstrap versions', async () => {