From f1008402a27d4aecd06a4c2a6be5b3c023f78730 Mon Sep 17 00:00:00 2001 From: lazerg Date: Thu, 15 Oct 2026 16:23:37 +0500 Subject: [PATCH 1/2] test(cli): io snapshot tests fail when color is not supported --- packages/aws-cdk/test/_helpers/io-recorder.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/aws-cdk/test/_helpers/io-recorder.ts b/packages/aws-cdk/test/_helpers/io-recorder.ts index ca5ebdff6..2bebad70a 100644 --- a/packages/aws-cdk/test/_helpers/io-recorder.ts +++ b/packages/aws-cdk/test/_helpers/io-recorder.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; +import chalk from 'chalk'; import type { IoMessageLevel } from '../../lib/api'; import { isMessageRelevantForLevel } from '../../lib/api-private'; import type { IoMessageObservation, ObservableIoHost } from '../../lib/cli/io-host'; @@ -222,6 +223,10 @@ export class IoHostRecorder { * observation buffer, so each test starts fresh. */ public static create(host: ObservableIoHost, options: IoHostRecorderOptions = {}): IoHostRecorder { + // toolkit-lib trims whitespace around messages, but not when the message is + // wrapped in color codes. Always emit color so the snapshots don't depend on + // whether the environment supports it (nx forces color, plain jest does not). + chalk.level = 1; const existing = IoHostRecorder.cache.get(host); if (existing) { // Same recorder across the (singleton) host; clear the per-test From 349575fc905f15d7758648ad7048bdc9bcbec72f Mon Sep 17 00:00:00 2001 From: lazerg Date: Mon, 26 Oct 2026 20:28:51 +0500 Subject: [PATCH 2/2] fix(toolkit-lib): trim whitespace inside color codes --- .../lib/api/io/private/io-host-wrappers.ts | 27 +++++++++++++++++-- .../toolkit-lib/test/toolkit/toolkit.test.ts | 17 ++++++++++++ packages/aws-cdk/test/_helpers/io-recorder.ts | 5 ---- ...no_resources_are_still_tearing_down.ndjson | 2 +- ...down_when_destroyStack_reports_them.ndjson | 4 +-- ...and_proceeds_when_the_user_confirms.ndjson | 2 +- ...ck_fromDeploy_makes_it_say_deployed.ndjson | 2 +- ...l_top-level_stacks_with_concurrency.ndjson | 4 +-- ...orwards_the_roleArn_to_destroyStack.ndjson | 2 +- ...s_dependency_order_with_concurrency.ndjson | 4 +-- ...esource_without_creating_a_refactor.ndjson | 4 +-- ...s_a_resource_moved_to_another_stack.ndjson | 4 +-- ..._the_direction_of_the_override_file.ndjson | 4 +-- ...verride_file_resolves_the_ambiguity.ndjson | 4 +-- ...us_mappings_and_refuses_to_refactor.ndjson | 4 +-- ..._is_too_old_to_refactor_is_rejected.ndjson | 4 +-- ...he_refactor_then_deploys_the_stacks.ndjson | 6 ++--- ...he_bucket_of_a_custom_toolkit_stack.ndjson | 4 +-- ...bucket_of_the_default_toolkit_stack.ndjson | 4 +-- ...the_environment_is_not_bootstrapped.ndjson | 4 +-- ..._local_and_deployed_templates_match.ndjson | 2 +- ...ds_or_removes_resources_is_rejected.ndjson | 2 +- ...t_are_not_deployed_yet_are_rejected.ndjson | 2 +- 23 files changed, 76 insertions(+), 41 deletions(-) diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/io-host-wrappers.ts b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/io-host-wrappers.ts index 6c7570c12..88f8ec7e5 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/io-host-wrappers.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/io-host-wrappers.ts @@ -61,14 +61,37 @@ export function withTrimmedWhitespace(ioHost: IIoHost): IIoHost { notify: async (msg: IoMessage) => { await ioHost.notify({ ...msg, - message: msg.message.trim(), + message: trimWhitespace(msg.message), }); }, requestResponse: async (msg: IoRequest) => { return ioHost.requestResponse({ ...msg, - message: msg.message.trim(), + message: trimWhitespace(msg.message), }); }, }; } + +/** + * Trims whitespace at both ends of a message, also when it sits inside + * ANSI style codes (e.g. a colored message that starts with a newline). + * The style codes themselves are kept. + */ +function trimWhitespace(msg: string): string { + // Even indices are text, odd indices are the style codes between them + const parts = msg.split(/(\u001b\[[0-9;]*m)/); + for (let i = 0; i < parts.length; i += 2) { + parts[i] = parts[i].trimStart(); + if (parts[i]) { + break; + } + } + for (let i = parts.length - 1; i >= 0; i -= 2) { + parts[i] = parts[i].trimEnd(); + if (parts[i]) { + break; + } + } + return parts.join(''); +} diff --git a/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts b/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts index 4e33e5b80..52dc19a2e 100644 --- a/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts +++ b/packages/@aws-cdk/toolkit-lib/test/toolkit/toolkit.test.ts @@ -73,6 +73,23 @@ describe('message formatting', () => { message: 'test message', })); }); + + test('whitespace inside color codes is trimmed from a message', async () => { + toolkit = new Toolkit({ ioHost }); + + await toolkit.ioHost.notify({ + message: '\u001b[1m\n\u001b[32m test message \u001b[39m\n\u001b[22m', + action: 'deploy', + level: 'info', + code: 'CDK_TOOLKIT_I0000', + time: new Date(), + data: undefined, + }); + + expect(ioHost.notifySpy).toHaveBeenCalledWith(expect.objectContaining({ + message: '\u001b[1m\u001b[32mtest message\u001b[39m\u001b[22m', + })); + }); }); test('outputs of assembly are measured', async () => { diff --git a/packages/aws-cdk/test/_helpers/io-recorder.ts b/packages/aws-cdk/test/_helpers/io-recorder.ts index 2bebad70a..ca5ebdff6 100644 --- a/packages/aws-cdk/test/_helpers/io-recorder.ts +++ b/packages/aws-cdk/test/_helpers/io-recorder.ts @@ -1,7 +1,6 @@ import * as fs from 'fs'; import * as os from 'os'; import * as path from 'path'; -import chalk from 'chalk'; import type { IoMessageLevel } from '../../lib/api'; import { isMessageRelevantForLevel } from '../../lib/api-private'; import type { IoMessageObservation, ObservableIoHost } from '../../lib/cli/io-host'; @@ -223,10 +222,6 @@ export class IoHostRecorder { * observation buffer, so each test starts fresh. */ public static create(host: ObservableIoHost, options: IoHostRecorderOptions = {}): IoHostRecorder { - // toolkit-lib trims whitespace around messages, but not when the message is - // wrapped in color codes. Always emit color so the snapshots don't depend on - // whether the environment supports it (nx forces color, plain jest does not). - chalk.level = 1; const existing = IoHostRecorder.cache.get(host); if (existing) { // Same recorder across the (singleton) host; clear the per-test diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_does_not_warn_when_no_resources_are_still_tearing_down.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_does_not_warn_when_no_resources_are_still_tearing_down.ndjson index 01ddef768..5e3908ebc 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_does_not_warn_when_no_resources_are_still_tearing_down.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_does_not_warn_when_no_resources_are_still_tearing_down.ndjson @@ -1,4 +1,4 @@ {"seq":0,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-B: destroying... [1/1]"} -{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-B: destroyed"} +{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-B: destroyed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_warns_about_resources_still_tearing_down_when_destroyStack_reports_them.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_warns_about_resources_still_tearing_down_when_destroyStack_reports_them.ndjson index 55f88dc49..fc30d254a 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_warns_about_resources_still_tearing_down_when_destroyStack_reports_them.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/--express_warns_about_resources_still_tearing_down_when_destroyStack_reports_them.ndjson @@ -1,5 +1,5 @@ {"seq":0,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-B: destroying... [1/1]"} -{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-B: destroyed"} -{"seq":4,"type":"notify","action":"destroy","level":"warn","code":"CDK_TOOLKIT_W7902","message":"⚠️ Stack deleted using Express Mode. Resources still tearing down: MyResource\n"} +{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-B: destroyed"} +{"seq":4,"type":"notify","action":"destroy","level":"warn","code":"CDK_TOOLKIT_W7902","message":"⚠️ Stack deleted using Express Mode. Resources still tearing down: MyResource"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_false_confirmation_prompt_asks_for_confirmation_and_proceeds_when_the_user_confirms.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_false_confirmation_prompt_asks_for_confirmation_and_proceeds_when_the_user_confirms.ndjson index c6f474c9b..a44ccdf18 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_false_confirmation_prompt_asks_for_confirmation_and_proceeds_when_the_user_confirms.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_false_confirmation_prompt_asks_for_confirmation_and_proceeds_when_the_user_confirms.ndjson @@ -2,4 +2,4 @@ {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"request","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7010","message":"Are you sure you want to delete: Test-Stack-B","response":true} {"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-B: destroying... [1/1]"} -{"seq":4,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-B: destroyed"} +{"seq":4,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-B: destroyed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_a_single_nested_stack_fromDeploy_makes_it_say_deployed.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_a_single_nested_stack_fromDeploy_makes_it_say_deployed.ndjson index f62dcb006..8a27248c3 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_a_single_nested_stack_fromDeploy_makes_it_say_deployed.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_a_single_nested_stack_fromDeploy_makes_it_say_deployed.ndjson @@ -1,4 +1,4 @@ {"seq":0,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-A/Test-Stack-C: destroying... [1/1]"} -{"seq":3,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-A/Test-Stack-C: deployed"} +{"seq":3,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-A/Test-Stack-C: deployed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_all_top-level_stacks_with_concurrency.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_all_top-level_stacks_with_concurrency.ndjson index f092fc23e..ceff8d714 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_all_top-level_stacks_with_concurrency.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_destroys_all_top-level_stacks_with_concurrency.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-A-Display-Name: destroying... [1/2]"} {"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-B: destroying... [2/2]"} -{"seq":4,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-A-Display-Name: destroyed"} -{"seq":5,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-B: destroyed"} +{"seq":4,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-A-Display-Name: destroyed"} +{"seq":5,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-B: destroyed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_forwards_the_roleArn_to_destroyStack.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_forwards_the_roleArn_to_destroyStack.ndjson index 01ddef768..5e3908ebc 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_forwards_the_roleArn_to_destroyStack.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_forwards_the_roleArn_to_destroyStack.ndjson @@ -1,4 +1,4 @@ {"seq":0,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-B: destroying... [1/1]"} -{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-B: destroyed"} +{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-B: destroyed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_respects_dependency_order_with_concurrency.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_respects_dependency_order_with_concurrency.ndjson index 2837e8986..97759d6a5 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_respects_dependency_order_with_concurrency.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/destroy/force_true_no_confirmation_prompt_respects_dependency_order_with_concurrency.ndjson @@ -1,6 +1,6 @@ {"seq":0,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":1,"type":"notify","action":"destroy","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":2,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-D: destroying... [1/2]"} -{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-D: destroyed"} +{"seq":3,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-D: destroyed"} {"seq":4,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7100","message":"Test-Stack-C: destroying... [2/2]"} -{"seq":5,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"\n✅ Test-Stack-C: destroyed"} +{"seq":5,"type":"notify","action":"destroy","level":"info","code":"CDK_TOOLKIT_I7900","message":"✅ Test-Stack-C: destroyed"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_renamed_resource_without_creating_a_refactor.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_renamed_resource_without_creating_a_refactor.ndjson index 7f4cac1a8..b47ba424f 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_renamed_resource_without_creating_a_refactor.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_renamed_resource_without_creating_a_refactor.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_resource_moved_to_another_stack.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_resource_moved_to_another_stack.ndjson index c56ff1a9e..ddb6ed6fb 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_resource_moved_to_another_stack.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/--dry-run_detects_a_resource_moved_to_another_stack.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬──────────────────────────┬──────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼──────────────────────────┼──────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/MyBucket/Resource │ Stack2/MyBucket/Resource │\n└─────────────────┴──────────────────────────┴──────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬──────────────────────────┬──────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼──────────────────────────┼──────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/MyBucket/Resource │ Stack2/MyBucket/Resource │\n└─────────────────┴──────────────────────────┴──────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_--revert_swaps_the_direction_of_the_override_file.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_--revert_swaps_the_direction_of_the_override_file.ndjson index 97db21d96..e21fc5319 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_--revert_swaps_the_direction_of_the_override_file.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_--revert_swaps_the_direction_of_the_override_file.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬─────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket3/Resource │ Stack1/Bucket1/Resource │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket4/Resource │ Stack1/Bucket2/Resource │\n└─────────────────┴─────────────────────────┴─────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬─────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket3/Resource │ Stack1/Bucket1/Resource │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket4/Resource │ Stack1/Bucket2/Resource │\n└─────────────────┴─────────────────────────┴─────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_an_override_file_resolves_the_ambiguity.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_an_override_file_resolves_the_ambiguity.ndjson index 419d98dfc..c17ce36d4 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_an_override_file_resolves_the_ambiguity.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_an_override_file_resolves_the_ambiguity.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬─────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket1/Resource │ Stack1/Bucket3/Resource │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket2/Resource │ Stack1/Bucket4/Resource │\n└─────────────────┴─────────────────────────┴─────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬─────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket1/Resource │ Stack1/Bucket3/Resource │\n├─────────────────┼─────────────────────────┼─────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket2/Resource │ Stack1/Bucket4/Resource │\n└─────────────────┴─────────────────────────┴─────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_reports_ambiguous_mappings_and_refuses_to_refactor.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_reports_ambiguous_mappings_and_refuses_to_refactor.ndjson index 5710af2f1..9520b6047 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_reports_ambiguous_mappings_and_refuses_to_refactor.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/ambiguity_reports_ambiguous_mappings_and_refuses_to_refactor.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"Detected ambiguities:\n┌───┬─────────────────────────┐\n│ │ Resource │\n├───┼─────────────────────────┤\n│ - │ Stack1/Bucket1/Resource │\n│ │ Stack1/Bucket2/Resource │\n├───┼─────────────────────────┤\n│ + │ Stack1/Bucket3/Resource │\n│ │ Stack1/Bucket4/Resource │\n└───┴─────────────────────────┘\n \nPlease provide an override file to resolve these ambiguous mappings.\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"Detected ambiguities:\n┌───┬─────────────────────────┐\n│ │ Resource │\n├───┼─────────────────────────┤\n│ - │ Stack1/Bucket1/Resource │\n│ │ Stack1/Bucket2/Resource │\n├───┼─────────────────────────┤\n│ + │ Stack1/Bucket3/Resource │\n│ │ Stack1/Bucket4/Resource │\n└───┴─────────────────────────┘\n \nPlease provide an override file to resolve these ambiguous mappings."} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_a_bootstrap_stack_that_is_too_old_to_refactor_is_rejected.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_a_bootstrap_stack_that_is_too_old_to_refactor_is_rejected.ndjson index 500ea4531..be570498e 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_a_bootstrap_stack_that_is_too_old_to_refactor_is_rejected.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_a_bootstrap_stack_that_is_too_old_to_refactor_is_rejected.ndjson @@ -2,8 +2,8 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘"} {"seq":6,"type":"notify","action":"refactor","level":"info","code":null,"message":"Refactoring..."} {"seq":7,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack CDKToolkit to finish creating or updating..."} {"seq":8,"type":"notify","action":"refactor","level":"error","code":"CDK_TOOLKIT_E8900","message":"❌ Refactor failed: The CDK toolkit stack in environment aws://123456789012/bermuda-triangle-1 doesn't support refactoring. Please run 'cdk bootstrap aws://123456789012/bermuda-triangle-1' to update it."} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_creates_and_executes_the_refactor_then_deploys_the_stacks.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_creates_and_executes_the_refactor_then_deploys_the_stacks.ndjson index ef0f63cf9..58675c644 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_creates_and_executes_the_refactor_then_deploys_the_stacks.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/execution_creates_and_executes_the_refactor_then_deploys_the_stacks.ndjson @@ -2,8 +2,8 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} -{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘\n "} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} +{"seq":5,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬───────────────────────────┬───────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼───────────────────────────┼───────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/OldBucket/Resource │ Stack1/NewBucket/Resource │\n└─────────────────┴───────────────────────────┴───────────────────────────┘"} {"seq":6,"type":"notify","action":"refactor","level":"info","code":null,"message":"Refactoring..."} {"seq":7,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack CDKToolkit to finish creating or updating..."} {"seq":8,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack Stack1 to finish creating or updating..."} @@ -15,7 +15,7 @@ {"seq":14,"type":"notify","action":"deploy","level":"debug","code":null,"message":"0 total assets, 0 still need to be published"} {"seq":15,"type":"request","action":"deploy","level":"info","code":"CDK_TOOLKIT_I5060","message":"Stack Stack1\nResources\n[+] AWS::S3::Bucket NewBucket NewBucket\n\n\n\nStack includes updates. Do you wish to deploy these changes?","response":true} {"seq":16,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I5100","message":"Stack1: deploying... [1/1]"} -{"seq":17,"type":"notify","action":"deploy","level":"result","code":"CDK_TOOLKIT_I5900","message":"\n✅ Stack1"} +{"seq":17,"type":"notify","action":"deploy","level":"result","code":"CDK_TOOLKIT_I5900","message":"✅ Stack1"} {"seq":18,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I5000","message":"✨ Deployment time: "} {"seq":19,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I5901","message":"Stack ARN:\narn:aws:cloudformation:bermuda-triangle-1:123456789012:stack/Stack1/abcd"} {"seq":20,"type":"notify","action":"deploy","level":"info","code":"CDK_TOOLKIT_I5001","message":"✨ Total time: "} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_a_custom_toolkit_stack.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_a_custom_toolkit_stack.ndjson index e8d58d826..5841a2bcf 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_a_custom_toolkit_stack.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_a_custom_toolkit_stack.ndjson @@ -2,7 +2,7 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack MyCustomToolkit to finish creating or updating..."} {"seq":6,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Storing template for stack Stack1 in S3 at: https://MyCustomToolkit-bucket.s3.amazonaws.com/cdk-refactor/Stack1/414006b004b5209a7dbe586333d988417e9e7d4ceb6bdf880521bb776a619425.json"} -{"seq":7,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬───────────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼───────────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket0/Resource │ Stack1/RenamedBucket/Resource │\n└─────────────────┴─────────────────────────┴───────────────────────────────┘\n "} +{"seq":7,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬───────────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼───────────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket0/Resource │ Stack1/RenamedBucket/Resource │\n└─────────────────┴─────────────────────────┴───────────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_the_default_toolkit_stack.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_the_default_toolkit_stack.ndjson index c9b3d5b88..abf1b97d9 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_the_default_toolkit_stack.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_are_uploaded_to_the_bucket_of_the_default_toolkit_stack.ndjson @@ -2,7 +2,7 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack CDKToolkit to finish creating or updating..."} {"seq":6,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Storing template for stack Stack1 in S3 at: https://CDKToolkit-bucket.s3.amazonaws.com/cdk-refactor/Stack1/414006b004b5209a7dbe586333d988417e9e7d4ceb6bdf880521bb776a619425.json"} -{"seq":7,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬───────────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼───────────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket0/Resource │ Stack1/RenamedBucket/Resource │\n└─────────────────┴─────────────────────────┴───────────────────────────────┘\n "} +{"seq":7,"type":"notify","action":"refactor","level":"result","code":"CDK_TOOLKIT_I8900","message":"The following resources were moved or renamed:\n┌─────────────────┬─────────────────────────┬───────────────────────────────┐\n│ Resource Type │ Old Construct Path │ New Construct Path │\n├─────────────────┼─────────────────────────┼───────────────────────────────┤\n│ AWS::S3::Bucket │ Stack1/Bucket0/Resource │ Stack1/RenamedBucket/Resource │\n└─────────────────┴─────────────────────────┴───────────────────────────────┘"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_fail_when_the_environment_is_not_bootstrapped.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_fail_when_the_environment_is_not_bootstrapped.ndjson index 96ad4faef..a3e1c86c5 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_fail_when_the_environment_is_not_bootstrapped.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/large_templates_fail_when_the_environment_is_not_bootstrapped.ndjson @@ -2,10 +2,10 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Waiting for stack CDKToolkit to finish creating or updating..."} {"seq":6,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Stack CDKToolkit does not exist"} {"seq":7,"type":"notify","action":"refactor","level":"debug","code":null,"message":"The environment aws://123456789012/bermuda-triangle-1 doesn't have the CDK toolkit stack (CDKToolkit) installed. Use cdk bootstrap \"aws://123456789012/bermuda-triangle-1\" to setup your environment for use with the toolkit."} -{"seq":8,"type":"notify","action":"refactor","level":"error","code":null,"message":"The template for stack \"Stack1\" is 173KiB. Templates larger than 50KiB must be uploaded to S3.\nRun the following command in order to setup an S3 bucket in this environment, and then re-refactor:\n\n \t$ cdk bootstrap aws://123456789012/bermuda-triangle-1\n"} +{"seq":8,"type":"notify","action":"refactor","level":"error","code":null,"message":"The template for stack \"Stack1\" is 173KiB. Templates larger than 50KiB must be uploaded to S3.\nRun the following command in order to setup an S3 bucket in this environment, and then re-refactor:\n\n \t$ cdk bootstrap aws://123456789012/bermuda-triangle-1"} {"seq":9,"type":"notify","action":"refactor","level":"error","code":"CDK_TOOLKIT_E8900","message":"❌ Refactor failed: Template too large to refactor (\"cdk bootstrap\" is required)"} {"seq":10,"type":"notify","action":"refactor","level":"debug","code":null,"message":"Template too large to refactor (\"cdk bootstrap\" is required)"} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/nothing_to_do_reports_that_there_is_nothing_to_refactor_when_local_and_deployed_templates_match.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/nothing_to_do_reports_that_there_is_nothing_to_refactor_when_local_and_deployed_templates_match.ndjson index e6863cbba..67e78f684 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/nothing_to_do_reports_that_there_is_nothing_to_refactor_when_local_and_deployed_templates_match.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/nothing_to_do_reports_that_there_is_nothing_to_refactor_when_local_and_deployed_templates_match.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"info","code":null,"message":"Nothing to refactor."} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_a_refactor_that_adds_or_removes_resources_is_rejected.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_a_refactor_that_adds_or_removes_resources_is_rejected.ndjson index efdfb47a6..659091b29 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_a_refactor_that_adds_or_removes_resources_is_rejected.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_a_refactor_that_adds_or_removes_resources_is_rejected.ndjson @@ -2,6 +2,6 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"error","code":"CDK_TOOLKIT_E8900","message":"❌ Refactor failed: A refactor operation cannot add, remove or update resources. Only resource moves and renames are allowed.\n\nThe following resources are present only in your CDK application:\n [+] Stack1/MyQueue/Resource\n\nThe following stacks were used in the comparison:\n - Deployed: Stack1\n - Local: Stack1\n\nHint: by default, only deployed stacks that have the same name as a local stack are included.\nIf you want to include additional deployed stacks for comparison, re-run the command with the option '--additional-stack-name=' for each stack."} {"seq":6,"type":"notify","action":"refactor","level":"debug","code":null,"message":"A refactor operation cannot add, remove or update resources. Only resource moves and renames are allowed.\n\nThe following resources are present only in your CDK application:\n [+] Stack1/MyQueue/Resource\n\nThe following stacks were used in the comparison:\n - Deployed: Stack1\n - Local: Stack1\n\nHint: by default, only deployed stacks that have the same name as a local stack are included.\nIf you want to include additional deployed stacks for comparison, re-run the command with the option '--additional-stack-name=' for each stack."} diff --git a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_stacks_that_are_not_deployed_yet_are_rejected.ndjson b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_stacks_that_are_not_deployed_yet_are_rejected.ndjson index abf699287..52547a66d 100644 --- a/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_stacks_that_are_not_deployed_yet_are_rejected.ndjson +++ b/packages/aws-cdk/test/commands/__io_snapshots__/refactor/refusals_stacks_that_are_not_deployed_yet_are_rejected.ndjson @@ -2,5 +2,5 @@ {"seq":1,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1000","message":"Starting Synthesis ..."} {"seq":2,"type":"notify","action":"refactor","level":"trace","code":"CDK_CLI_I1001","message":"\n✨ Synthesis time: \n"} {"seq":3,"type":"notify","action":"refactor","level":"info","code":"CDK_TOOLKIT_I1000","message":"✨ Synthesis time: "} -{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1\n"} +{"seq":4,"type":"notify","action":"refactor","level":"info","code":null,"message":"aws://123456789012/bermuda-triangle-1"} {"seq":5,"type":"notify","action":"refactor","level":"error","code":null,"message":"The following stack is new: Stack1\nCreation of new stacks is not yet supported by the refactor command. Please deploy any new stacks separately before refactoring your stacks."}