From f05c217ecb587007b53b5117a755799d8769ee13 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Tue, 10 Sep 2024 17:43:24 +0200 Subject: [PATCH 01/13] fix(cli): deployment errors are printed 3 times The CLI prints deployment errors 3 times. This is caused by an catching an error, printing it, and then throwing it again; to another `catch` statement that catches the error, prints it, and then throws it again. In this PR, get rid of one catch and change the error that gets rethrown in a different case. Also in this PR: fix the inconsistency of printing the progress of asset publishing. Compared to the progress of stack deployments, the stack name isn't bold and there is a single space offset. --- packages/aws-cdk/lib/api/deployments.ts | 5 +++-- packages/aws-cdk/lib/cdk-toolkit.ts | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/aws-cdk/lib/api/deployments.ts b/packages/aws-cdk/lib/api/deployments.ts index ee357e01b525c..ed9caff349678 100644 --- a/packages/aws-cdk/lib/api/deployments.ts +++ b/packages/aws-cdk/lib/api/deployments.ts @@ -1,6 +1,7 @@ import * as cxapi from '@aws-cdk/cx-api'; import * as cdk_assets from 'cdk-assets'; import { AssetManifest, IManifestEntry } from 'cdk-assets'; +import * as chalk from 'chalk'; import { Mode } from './aws-auth/credentials'; import { ISDK } from './aws-auth/sdk'; import { CredentialsOptions, SdkForEnvironment, SdkProvider } from './aws-auth/sdk-provider'; @@ -692,7 +693,7 @@ export class Deployments { if (existing) { return existing; } - const prefix = stackName ? `${stackName}: ` : ''; + const prefix = stackName ? `${chalk.bold(stackName)}: ` : ''; const publisher = new cdk_assets.AssetPublishing(assetManifest, { aws: new PublishingAws(this.sdkProvider, env), progressListener: new ParallelSafeAssetProgress(prefix, this.props.quiet ?? false), @@ -711,7 +712,7 @@ class ParallelSafeAssetProgress implements cdk_assets.IPublishProgressListener { public onPublishEvent(type: cdk_assets.EventType, event: cdk_assets.IPublishProgress): void { const handler = this.quiet && type !== 'fail' ? debug : EVENT_TO_LOGGER[type]; - handler(`${this.prefix} ${type}: ${event.message}`); + handler(`${this.prefix}${type}: ${event.message}`); } } diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index af64056e2fc29..04d15cc435ec0 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -374,9 +374,6 @@ export class CdkToolkit { print('Stack ARN:'); data(result.stackArn); - } catch (e) { - error('\n ❌ %s failed: %s', chalk.bold(stack.displayName), e); - throw e; } finally { if (options.cloudWatchLogMonitor) { const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack); @@ -427,9 +424,11 @@ export class CdkToolkit { buildAsset, publishAsset, }); - } catch (e) { - error('\n ❌ Deployment failed: %s', e); - throw e; + } catch (e: any) { + error('\n ❌ Deployment failed: %s', e.message); + throw new Error('There was an error deploying (see above for details)'); + } + } } } From 86b73c0d11de34dc1f9ca1f5c5b430b0a031287b Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 11 Sep 2024 11:52:32 +0200 Subject: [PATCH 02/13] Fix syntax --- packages/aws-cdk/lib/cdk-toolkit.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index 04d15cc435ec0..f14ae723ce33e 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -429,8 +429,6 @@ export class CdkToolkit { throw new Error('There was an error deploying (see above for details)'); } } - } - } public async watch(options: WatchOptions) { const rootDir = path.dirname(path.resolve(PROJECT_CONFIG)); From 712ba86fde4b2d73555e4db21d5d248fe1f5930a Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Sep 2024 11:30:10 +0200 Subject: [PATCH 03/13] Fix error reporting to pass integ test --- packages/aws-cdk/lib/cdk-toolkit.ts | 48 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index f14ae723ce33e..a759da6cb5e7f 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -374,6 +374,9 @@ export class CdkToolkit { print('Stack ARN:'); data(result.stackArn); + } catch (e: any) { + // It has to be exactly this string because an integration test tests for it + throw new Error(`❌ ${chalk.bold(stack.stackName)} failed: ${e.message}`); } finally { if (options.cloudWatchLogMonitor) { const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack); @@ -401,33 +404,28 @@ export class CdkToolkit { warning('⚠️ The --concurrency flag only supports --progress "events". Switching to "events".'); } - try { - const stacksAndTheirAssetManifests = stacks.flatMap(stack => [ - stack, - ...stack.dependencies.filter(cxapi.AssetManifestArtifact.isAssetManifestArtifact), - ]); - const workGraph = new WorkGraphBuilder(prebuildAssets).build(stacksAndTheirAssetManifests); - - // Unless we are running with '--force', skip already published assets - if (!options.force) { - await this.removePublishedAssets(workGraph, options); - } - - const graphConcurrency: Concurrency = { - 'stack': concurrency, - 'asset-build': 1, // This will be CPU-bound/memory bound, mostly matters for Docker builds - 'asset-publish': (options.assetParallelism ?? true) ? 8 : 1, // This will be I/O-bound, 8 in parallel seems reasonable - }; + const stacksAndTheirAssetManifests = stacks.flatMap(stack => [ + stack, + ...stack.dependencies.filter(cxapi.AssetManifestArtifact.isAssetManifestArtifact), + ]); + const workGraph = new WorkGraphBuilder(prebuildAssets).build(stacksAndTheirAssetManifests); - await workGraph.doParallel(graphConcurrency, { - deployStack, - buildAsset, - publishAsset, - }); - } catch (e: any) { - error('\n ❌ Deployment failed: %s', e.message); - throw new Error('There was an error deploying (see above for details)'); + // Unless we are running with '--force', skip already published assets + if (!options.force) { + await this.removePublishedAssets(workGraph, options); } + + const graphConcurrency: Concurrency = { + 'stack': concurrency, + 'asset-build': 1, // This will be CPU-bound/memory bound, mostly matters for Docker builds + 'asset-publish': (options.assetParallelism ?? true) ? 8 : 1, // This will be I/O-bound, 8 in parallel seems reasonable + }; + + await workGraph.doParallel(graphConcurrency, { + deployStack, + buildAsset, + publishAsset, + }); } public async watch(options: WatchOptions) { From 193711b654999611fd1a91967894e52869558790 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Sep 2024 11:30:58 +0200 Subject: [PATCH 04/13] Make the integ test less strict --- .../cli-integ/tests/cli-integ-tests/cli.integtest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index 8ebfcc0752716..7f9af979608f6 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -2169,7 +2169,7 @@ integTest( }); const stackName = `${fixture.stackNamePrefix}-ecs-hotswap`; - const expectedSubstring = `❌ ${chalk.bold(stackName)} failed: ResourceNotReady: Resource is not in the state deploymentCompleted`; + const expectedSubstring = 'Resource is not in the state deploymentCompleted'; expect(deployOutput).toContain(expectedSubstring); expect(deployOutput).not.toContain('hotswapped!'); From 10b30d206e1746e35c72419f24233d83402858a0 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Sep 2024 11:35:09 +0200 Subject: [PATCH 05/13] Remove some warnings --- .../cli-integ/tests/cli-integ-tests/cli.integtest.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts index 7f9af979608f6..88b3c35ca0b55 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli.integtest.ts @@ -19,7 +19,6 @@ import { import { InvokeCommand } from '@aws-sdk/client-lambda'; import { CreateTopicCommand, DeleteTopicCommand } from '@aws-sdk/client-sns'; import { AssumeRoleCommand, GetCallerIdentityCommand } from '@aws-sdk/client-sts'; -import * as chalk from 'chalk'; import { integTest, cloneDirectory, @@ -2168,7 +2167,6 @@ integTest( allowErrExit: true, }); - const stackName = `${fixture.stackNamePrefix}-ecs-hotswap`; const expectedSubstring = 'Resource is not in the state deploymentCompleted'; expect(deployOutput).toContain(expectedSubstring); From 4e1c488f7fcb73b61f3efa626b0a80a28be8407f Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Sep 2024 14:10:46 +0200 Subject: [PATCH 06/13] Include error type --- packages/aws-cdk/lib/cdk-toolkit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index a759da6cb5e7f..d5a2f44529b79 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -376,7 +376,7 @@ export class CdkToolkit { data(result.stackArn); } catch (e: any) { // It has to be exactly this string because an integration test tests for it - throw new Error(`❌ ${chalk.bold(stack.stackName)} failed: ${e.message}`); + throw new Error(`❌ ${chalk.bold(stack.stackName)} failed: ${e.constructor.name}: ${e.message}`); } finally { if (options.cloudWatchLogMonitor) { const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack); From 70d3568be1df94689cd6cba45686586ad9c4fb03 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Thu, 12 Sep 2024 14:22:36 +0200 Subject: [PATCH 07/13] Need to raise timeout --- packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts index 619ca8b96175c..69a6949b6d07e 100644 --- a/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts +++ b/packages/@aws-cdk-testing/cli-integ/lib/with-cdk-app.ts @@ -13,7 +13,7 @@ import { shell, ShellOptions, ShellHelper, rimraf } from './shell'; import { AwsContext, withAws } from './with-aws'; import { withTimeout } from './with-timeout'; -export const DEFAULT_TEST_TIMEOUT_S = 10 * 60; +export const DEFAULT_TEST_TIMEOUT_S = 20 * 60; export const EXTENDED_TEST_TIMEOUT_S = 30 * 60; /** From d673af674b474cd12b4b94d7e3f02be107e28f2f Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 13 Sep 2024 11:54:42 +0200 Subject: [PATCH 08/13] Another exact error message test --- .../cli-integ-tests/cli-lib.integtest.ts | 2 +- .../cli-lib-alpha/THIRD_PARTY_LICENSES | 36 +++++-------------- 2 files changed, 9 insertions(+), 29 deletions(-) diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts index c0b90cf503642..578e287096689 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts @@ -75,7 +75,7 @@ integTest( 'This deployment will make potentially sensitive changes according to your current security approval level', ); expect(stdErr).toContain( - 'Deployment failed: Error: "--require-approval" is enabled and stack includes security-sensitive updates', + 'Error: "--require-approval" is enabled and stack includes security-sensitive updates', ); // Ensure stack was not deployed diff --git a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES index bcafab7566719..ea4999a4e10d3 100644 --- a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES @@ -207,7 +207,7 @@ The @aws-cdk/cli-lib-alpha package includes the following third-party software/l ---------------- -** @jsii/check-node@1.102.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.102.0 | Apache-2.0 +** @jsii/check-node@1.103.1 - https://www.npmjs.com/package/@jsii/check-node/v/1.103.1 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -266,7 +266,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------- -** ajv@8.16.0 - https://www.npmjs.com/package/ajv/v/8.16.0 | MIT +** ajv@8.17.1 - https://www.npmjs.com/package/ajv/v/8.17.1 | MIT The MIT License (MIT) Copyright (c) 2015-2021 Evgeny Poberezkin @@ -458,7 +458,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ---------------- -** async@3.2.5 - https://www.npmjs.com/package/async/v/3.2.5 | MIT +** async@3.2.6 - https://www.npmjs.com/package/async/v/3.2.6 | MIT Copyright (c) 2010-2018 Caolan McMahon Permission is hereby granted, free of charge, to any person obtaining a copy @@ -493,7 +493,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1653.0 - https://www.npmjs.com/package/aws-sdk/v/2.1653.0 | Apache-2.0 +** aws-sdk@2.1688.0 - https://www.npmjs.com/package/aws-sdk/v/2.1688.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -503,7 +503,7 @@ Amazon Web Services, Inc. (http://aws.amazon.com/). ---------------- -** aws-sdk@2.1675.0 - https://www.npmjs.com/package/aws-sdk/v/2.1675.0 | Apache-2.0 +** aws-sdk@2.1691.0 - https://www.npmjs.com/package/aws-sdk/v/2.1691.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -1133,7 +1133,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------- -** debug@4.3.5 - https://www.npmjs.com/package/debug/v/4.3.5 | MIT +** debug@4.3.6 - https://www.npmjs.com/package/debug/v/4.3.6 | MIT (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk @@ -1260,7 +1260,7 @@ THE SOFTWARE. ---------------- -** escalade@3.1.2 - https://www.npmjs.com/package/escalade/v/3.1.2 | MIT +** escalade@3.2.0 - https://www.npmjs.com/package/escalade/v/3.2.0 | MIT MIT License Copyright (c) Luke Edwards (lukeed.com) @@ -3151,26 +3151,6 @@ Copyright (c) 2010-2024 Mathias Bynens WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ----------------- - -** semver@7.6.2 - https://www.npmjs.com/package/semver/v/7.6.2 | ISC -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - ---------------- ** semver@7.6.3 - https://www.npmjs.com/package/semver/v/7.6.3 | ISC @@ -3578,7 +3558,7 @@ THE SOFTWARE. ---------------- -** tslib@2.6.3 - https://www.npmjs.com/package/tslib/v/2.6.3 | 0BSD +** tslib@2.7.0 - https://www.npmjs.com/package/tslib/v/2.7.0 | 0BSD Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any From 5c9b33d1a809c0db75f47666b50a0d2514715993 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 13 Sep 2024 12:00:05 +0200 Subject: [PATCH 09/13] Nother fix --- packages/aws-cdk/lib/cdk-toolkit.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index d5a2f44529b79..38574298a39cd 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -375,8 +375,18 @@ export class CdkToolkit { data(result.stackArn); } catch (e: any) { - // It has to be exactly this string because an integration test tests for it + // We need to emit this string to satisfy a CLI integ test that expects + // the literal string "Deployment failed: ". + debug('\n ❌ Deployment failed: %s', e); + + // It has to be exactly this string because an integration test tests for + // "bold(stackname) failed: ResourceNotReady: " throw new Error(`❌ ${chalk.bold(stack.stackName)} failed: ${e.constructor.name}: ${e.message}`); + + // By the time you read this, the 'debug' can probably be removed, as + // the same commit that introduced this output to make the backwards + // compatibility tests pass, also loosened the tests to only check for + // the actual error message, and not any additional decoration. } finally { if (options.cloudWatchLogMonitor) { const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack); From da03003a9d7c3bb2b00847a9c6e21cc9ac1eb59f Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 13 Sep 2024 12:00:57 +0200 Subject: [PATCH 10/13] Undo pointless change --- .../cli-lib-alpha/THIRD_PARTY_LICENSES | 36 ++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES index ea4999a4e10d3..bcafab7566719 100644 --- a/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES +++ b/packages/@aws-cdk/cli-lib-alpha/THIRD_PARTY_LICENSES @@ -207,7 +207,7 @@ The @aws-cdk/cli-lib-alpha package includes the following third-party software/l ---------------- -** @jsii/check-node@1.103.1 - https://www.npmjs.com/package/@jsii/check-node/v/1.103.1 | Apache-2.0 +** @jsii/check-node@1.102.0 - https://www.npmjs.com/package/@jsii/check-node/v/1.102.0 | Apache-2.0 jsii Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -266,7 +266,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------- -** ajv@8.17.1 - https://www.npmjs.com/package/ajv/v/8.17.1 | MIT +** ajv@8.16.0 - https://www.npmjs.com/package/ajv/v/8.16.0 | MIT The MIT License (MIT) Copyright (c) 2015-2021 Evgeny Poberezkin @@ -458,7 +458,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI ---------------- -** async@3.2.6 - https://www.npmjs.com/package/async/v/3.2.6 | MIT +** async@3.2.5 - https://www.npmjs.com/package/async/v/3.2.5 | MIT Copyright (c) 2010-2018 Caolan McMahon Permission is hereby granted, free of charge, to any person obtaining a copy @@ -493,7 +493,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH RE ---------------- -** aws-sdk@2.1688.0 - https://www.npmjs.com/package/aws-sdk/v/2.1688.0 | Apache-2.0 +** aws-sdk@2.1653.0 - https://www.npmjs.com/package/aws-sdk/v/2.1653.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -503,7 +503,7 @@ Amazon Web Services, Inc. (http://aws.amazon.com/). ---------------- -** aws-sdk@2.1691.0 - https://www.npmjs.com/package/aws-sdk/v/2.1691.0 | Apache-2.0 +** aws-sdk@2.1675.0 - https://www.npmjs.com/package/aws-sdk/v/2.1675.0 | Apache-2.0 AWS SDK for JavaScript Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. @@ -1133,7 +1133,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------- -** debug@4.3.6 - https://www.npmjs.com/package/debug/v/4.3.6 | MIT +** debug@4.3.5 - https://www.npmjs.com/package/debug/v/4.3.5 | MIT (The MIT License) Copyright (c) 2014-2017 TJ Holowaychuk @@ -1260,7 +1260,7 @@ THE SOFTWARE. ---------------- -** escalade@3.2.0 - https://www.npmjs.com/package/escalade/v/3.2.0 | MIT +** escalade@3.1.2 - https://www.npmjs.com/package/escalade/v/3.1.2 | MIT MIT License Copyright (c) Luke Edwards (lukeed.com) @@ -3151,6 +3151,26 @@ Copyright (c) 2010-2024 Mathias Bynens WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +---------------- + +** semver@7.6.2 - https://www.npmjs.com/package/semver/v/7.6.2 | ISC +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + ---------------- ** semver@7.6.3 - https://www.npmjs.com/package/semver/v/7.6.3 | ISC @@ -3558,7 +3578,7 @@ THE SOFTWARE. ---------------- -** tslib@2.7.0 - https://www.npmjs.com/package/tslib/v/2.7.0 | 0BSD +** tslib@2.6.3 - https://www.npmjs.com/package/tslib/v/2.6.3 | 0BSD Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any From e698a1234b14e3655a4e5ca4390ec9d635f4c290 Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 13 Sep 2024 14:03:37 +0200 Subject: [PATCH 11/13] Try and format error slightly differently to try and get past backwards compat tests --- packages/aws-cdk/lib/cdk-toolkit.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index 38574298a39cd..196f83a552f6e 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -381,7 +381,11 @@ export class CdkToolkit { // It has to be exactly this string because an integration test tests for // "bold(stackname) failed: ResourceNotReady: " - throw new Error(`❌ ${chalk.bold(stack.stackName)} failed: ${e.constructor.name}: ${e.message}`); + throw new Error([ + `❌ ${chalk.bold(stack.stackName)} failed:`, + ...e.code ? [`${e.code}:`] : [], + e.message, + ].join(' ')); // By the time you read this, the 'debug' can probably be removed, as // the same commit that introduced this output to make the backwards From 4fbcb600716fff4d957dffbb1f72b2257e6919de Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 13 Sep 2024 14:12:46 +0200 Subject: [PATCH 12/13] Skip some regression tests --- .../cli-regression-patches/v2.158.0/skip-tests.txt | 2 ++ packages/@aws-cdk-testing/cli-integ/skip-tests.txt | 2 +- packages/aws-cdk/lib/cdk-toolkit.ts | 9 --------- 3 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt diff --git a/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt new file mode 100644 index 0000000000000..3f514816d0b88 --- /dev/null +++ b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt @@ -0,0 +1,2 @@ +# This test asserts too much about the output of the CLI. +security related changes without a CLI are expected to fail when approval is required \ No newline at end of file diff --git a/packages/@aws-cdk-testing/cli-integ/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/skip-tests.txt index bb43b8f55b68f..e48344380dbaf 100644 --- a/packages/@aws-cdk-testing/cli-integ/skip-tests.txt +++ b/packages/@aws-cdk-testing/cli-integ/skip-tests.txt @@ -1,7 +1,7 @@ # This file is empty on purpose. Leave it here as documentation # and an example. # -# Copy this file to cli-regression-patches/vX.Y.Z/skip-tests.txt +# Copy this file to resources/cli-regression-patches/vX.Y.Z/skip-tests.txt # and edit it there if you want to exclude certain tests from running # when performing a certain version's regression tests. # diff --git a/packages/aws-cdk/lib/cdk-toolkit.ts b/packages/aws-cdk/lib/cdk-toolkit.ts index 196f83a552f6e..5f05f6095c43f 100644 --- a/packages/aws-cdk/lib/cdk-toolkit.ts +++ b/packages/aws-cdk/lib/cdk-toolkit.ts @@ -375,10 +375,6 @@ export class CdkToolkit { data(result.stackArn); } catch (e: any) { - // We need to emit this string to satisfy a CLI integ test that expects - // the literal string "Deployment failed: ". - debug('\n ❌ Deployment failed: %s', e); - // It has to be exactly this string because an integration test tests for // "bold(stackname) failed: ResourceNotReady: " throw new Error([ @@ -386,11 +382,6 @@ export class CdkToolkit { ...e.code ? [`${e.code}:`] : [], e.message, ].join(' ')); - - // By the time you read this, the 'debug' can probably be removed, as - // the same commit that introduced this output to make the backwards - // compatibility tests pass, also loosened the tests to only check for - // the actual error message, and not any additional decoration. } finally { if (options.cloudWatchLogMonitor) { const foundLogGroupsResult = await findCloudWatchLogGroups(this.props.sdkProvider, stack); From cc6daea8d55a34d124f64a29c0d8316162e85d6f Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Wed, 25 Sep 2024 12:41:34 +0200 Subject: [PATCH 13/13] Woohoo --- .../{v2.158.0 => v2.160.0}/skip-tests.txt | 0 .../cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/{v2.158.0 => v2.160.0}/skip-tests.txt (100%) diff --git a/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt b/packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.160.0/skip-tests.txt similarity index 100% rename from packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.158.0/skip-tests.txt rename to packages/@aws-cdk-testing/cli-integ/resources/cli-regression-patches/v2.160.0/skip-tests.txt diff --git a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts index 578e287096689..f41b97e257c77 100644 --- a/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts +++ b/packages/@aws-cdk-testing/cli-integ/tests/cli-integ-tests/cli-lib.integtest.ts @@ -75,7 +75,7 @@ integTest( 'This deployment will make potentially sensitive changes according to your current security approval level', ); expect(stdErr).toContain( - 'Error: "--require-approval" is enabled and stack includes security-sensitive updates', + '"--require-approval" is enabled and stack includes security-sensitive updates', ); // Ensure stack was not deployed