From 1cc54b9220789680670152a51678489230a9d8da Mon Sep 17 00:00:00 2001 From: aws-amplify-bot Date: Tue, 25 Nov 2025 13:44:07 -0500 Subject: [PATCH 1/3] fix rendering for vended logs lists --- .../service-spec-importers/src/diff-fmt.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts index f4cd04f50..84a298dd9 100644 --- a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts +++ b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts @@ -373,14 +373,15 @@ export class DiffFormatter { private renderVendedLogListDiff(diff: ScalarDiff, tree: PrintableTree[], diffShown: string) { if (diff.old && diff.new) { - const oldList = new Set(diff.old.logTypes); - const newList = new Set(diff.new.logTypes); - const addedTypes = [...newList].filter((t) => !oldList.has(t)); - const removedTypes = [...oldList].filter((t) => !newList.has(t)); - if (addedTypes.length > 0 || removedTypes.length > 0) { + // the array should correspond to the value of diffShown + const oldList = new Set(diffShown === 'logTypes' ? diff.new.logTypes: diff.new.destinations); + const newList = new Set(diffShown === 'logTypes' ? diff.new.logTypes: diff.new.destinations); + const added = [...newList].filter((t) => !oldList.has(t)); + const removed = [...oldList].filter((t) => !newList.has(t)); + if (added.length > 0 || removed.length > 0) { const bullets: PrintableTree[] = []; - removedTypes.forEach((type) => bullets.push(new PrintableTree(`- ${type}`).colorize(chalk.red))); - addedTypes.forEach((type) => bullets.push(new PrintableTree(`+ ${type}`).colorize(chalk.green))); + removed.forEach((diff) => bullets.push(new PrintableTree(`- ${diff}`).colorize(chalk.red))); + added.forEach((diff) => bullets.push(new PrintableTree(`+ ${diff}`).colorize(chalk.green))); tree.push(new PrintableTree(`${diffShown}:`).addBullets(bullets)); } } From 578a3416e71ccb5062fbe87398741140ac93af50 Mon Sep 17 00:00:00 2001 From: aws-amplify-bot Date: Tue, 25 Nov 2025 13:57:08 -0500 Subject: [PATCH 2/3] change var name --- packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts index 84a298dd9..5d3d732c7 100644 --- a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts +++ b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts @@ -380,8 +380,8 @@ export class DiffFormatter { const removed = [...oldList].filter((t) => !newList.has(t)); if (added.length > 0 || removed.length > 0) { const bullets: PrintableTree[] = []; - removed.forEach((diff) => bullets.push(new PrintableTree(`- ${diff}`).colorize(chalk.red))); - added.forEach((diff) => bullets.push(new PrintableTree(`+ ${diff}`).colorize(chalk.green))); + removed.forEach((obj) => bullets.push(new PrintableTree(`- ${obj}`).colorize(chalk.red))); + added.forEach((obj) => bullets.push(new PrintableTree(`+ ${obj}`).colorize(chalk.green))); tree.push(new PrintableTree(`${diffShown}:`).addBullets(bullets)); } } From 62dc3a74e2db8952bdb17c44cb98cc9aa39385ff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 25 Nov 2025 19:01:46 +0000 Subject: [PATCH 3/3] chore: self mutation Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts index 5d3d732c7..1b95a2530 100644 --- a/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts +++ b/packages/@aws-cdk/service-spec-importers/src/diff-fmt.ts @@ -374,8 +374,8 @@ export class DiffFormatter { private renderVendedLogListDiff(diff: ScalarDiff, tree: PrintableTree[], diffShown: string) { if (diff.old && diff.new) { // the array should correspond to the value of diffShown - const oldList = new Set(diffShown === 'logTypes' ? diff.new.logTypes: diff.new.destinations); - const newList = new Set(diffShown === 'logTypes' ? diff.new.logTypes: diff.new.destinations); + const oldList = new Set(diffShown === 'logTypes' ? diff.new.logTypes : diff.new.destinations); + const newList = new Set(diffShown === 'logTypes' ? diff.new.logTypes : diff.new.destinations); const added = [...newList].filter((t) => !oldList.has(t)); const removed = [...oldList].filter((t) => !newList.has(t)); if (added.length > 0 || removed.length > 0) {