From 6683cd226f2ebf182d368303c7e2921f2a1350f8 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 20 Jun 2019 15:16:04 +0300 Subject: [PATCH 1/3] refactor(cx-api): bump cli <=> cdk protocol version following up on #2922, manifest may include "env" that indicates unknown-account/unknown-region, which will cause old CLIs to fail, so we must bump the version to ensure compatibility. BREAKING CHANGE: Previous versions of the CDK CLI will not be fully compatible with this version of the framework and vice versa. --- packages/@aws-cdk/cdk/test/test.synthesis.ts | 2 +- packages/@aws-cdk/cx-api/lib/cloud-assembly.ts | 2 +- packages/@aws-cdk/cx-api/lib/versioning.ts | 2 +- .../cx-api/test/__snapshots__/cloud-assembly.test.js.snap | 2 +- packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts | 6 +++--- packages/@aws-cdk/cx-api/test/fixtures/assets/manifest.json | 2 +- .../@aws-cdk/cx-api/test/fixtures/depends/manifest.json | 2 +- packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json | 2 +- .../test/fixtures/invalid-artifact-type/manifest.json | 2 +- .../cx-api/test/fixtures/invalid-depends/manifest.json | 2 +- .../cx-api/test/fixtures/invalid-env-format/manifest.json | 2 +- .../cx-api/test/fixtures/logical-id-map/manifest.json | 2 +- .../@aws-cdk/cx-api/test/fixtures/messages/manifest.json | 2 +- .../cx-api/test/fixtures/missing-context/manifest.json | 2 +- .../cx-api/test/fixtures/multiple-stacks/manifest.json | 2 +- .../cx-api/test/fixtures/single-stack/manifest.json | 2 +- .../cx-api/test/fixtures/stack-without-params/manifest.json | 2 +- 17 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/@aws-cdk/cdk/test/test.synthesis.ts b/packages/@aws-cdk/cdk/test/test.synthesis.ts index c7b2a506e8c7c..f4786f9007b97 100644 --- a/packages/@aws-cdk/cdk/test/test.synthesis.ts +++ b/packages/@aws-cdk/cdk/test/test.synthesis.ts @@ -78,7 +78,7 @@ export = { ]); test.deepEqual(readJson(session.directory, 'foo.json'), { bar: 123 }); test.deepEqual(session.manifest, { - version: '0.34.0', + version: '0.36.0', artifacts: { 'my-random-construct': { type: 'aws:cloudformation:stack', diff --git a/packages/@aws-cdk/cx-api/lib/cloud-assembly.ts b/packages/@aws-cdk/cx-api/lib/cloud-assembly.ts index cc48c79cdacc7..6412a42d16dbe 100644 --- a/packages/@aws-cdk/cx-api/lib/cloud-assembly.ts +++ b/packages/@aws-cdk/cx-api/lib/cloud-assembly.ts @@ -209,7 +209,7 @@ export class CloudAssemblyBuilder { // "backwards compatibility": in order for the old CLI to tell the user they // need a new version, we'll emit the legacy manifest with only "version". - // this will result in an error "CDK Toolkit >= 0.34.0 is required in order to interact with this program." + // this will result in an error "CDK Toolkit >= CLOUD_ASSEMBLY_VERSION is required in order to interact with this program." fs.writeFileSync(path.join(this.outdir, 'cdk.out'), JSON.stringify({ version: CLOUD_ASSEMBLY_VERSION })); return new CloudAssembly(this.outdir); diff --git a/packages/@aws-cdk/cx-api/lib/versioning.ts b/packages/@aws-cdk/cx-api/lib/versioning.ts index f5d2be483dc91..ae684a8361bc0 100644 --- a/packages/@aws-cdk/cx-api/lib/versioning.ts +++ b/packages/@aws-cdk/cx-api/lib/versioning.ts @@ -16,7 +16,7 @@ import semver = require('semver'); * updated (as the current verison in package.json has already been released!) * - The request does not have versioning yet, only the response. */ -export const CLOUD_ASSEMBLY_VERSION = '0.34.0'; +export const CLOUD_ASSEMBLY_VERSION = '0.36.0'; /** * Look at the type of response we get and upgrade it to the latest expected version diff --git a/packages/@aws-cdk/cx-api/test/__snapshots__/cloud-assembly.test.js.snap b/packages/@aws-cdk/cx-api/test/__snapshots__/cloud-assembly.test.js.snap index 76fbb4eeb9785..c80da3f4d669b 100644 --- a/packages/@aws-cdk/cx-api/test/__snapshots__/cloud-assembly.test.js.snap +++ b/packages/@aws-cdk/cx-api/test/__snapshots__/cloud-assembly.test.js.snap @@ -39,7 +39,7 @@ Array [ exports[`empty assembly 1`] = ` Object { - "version": "0.34.0", + "version": "0.36.0", } `; diff --git a/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts b/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts index 3f66e6c38f215..979ff20606206 100644 --- a/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts +++ b/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts @@ -87,7 +87,7 @@ test('fails for invalid dependencies', () => { }); test('verifyManifestVersion', () => { - verifyManifestVersion('0.34.0'); - expect(() => verifyManifestVersion('0.31.0')).toThrow('CDK CLI can only be used with apps created by CDK >= 0.34.0'); - expect(() => verifyManifestVersion('0.35.0')).toThrow('CDK CLI >= 0.35.0 is required to interact with this app'); + verifyManifestVersion(CLOUD_ASSEMBLY_VERSION); + expect(() => verifyManifestVersion('0.31.0')).toThrow(`CDK CLI can only be used with apps created by CDK >= ${CLOUD_ASSEMBLY_VERSION}`); + expect(() => verifyManifestVersion('99.99.99')).toThrow(`CDK CLI >= ${CLOUD_ASSEMBLY_VERSION} is required to interact with this app`); }); \ No newline at end of file diff --git a/packages/@aws-cdk/cx-api/test/fixtures/assets/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/assets/manifest.json index 7a82e769c79e4..353fb533e0d85 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/assets/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/assets/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/depends/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/depends/manifest.json index a611f4b5b62b3..d33226288d567 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/depends/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/depends/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "StackA": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json index 11b30463aa234..066fd21aa9379 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json @@ -1,3 +1,3 @@ { - "version": "0.34.0" + "version": "0.36.0" } \ No newline at end of file diff --git a/packages/@aws-cdk/cx-api/test/fixtures/invalid-artifact-type/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/invalid-artifact-type/manifest.json index 0c92139477a1d..3f62abc47b4c0 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/invalid-artifact-type/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/invalid-artifact-type/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyArt": { "type": "who:am:i", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/invalid-depends/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/invalid-depends/manifest.json index 2f15a7b00a313..adfb3c85ac697 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/invalid-depends/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/invalid-depends/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "StackA": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/invalid-env-format/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/invalid-env-format/manifest.json index db458ca00d7b5..89ad8f9c5296e 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/invalid-env-format/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/invalid-env-format/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/logical-id-map/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/logical-id-map/manifest.json index 063f712757085..18901db071707 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/logical-id-map/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/logical-id-map/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/messages/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/messages/manifest.json index d90c854d19241..c5e99392312c9 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/messages/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/messages/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/missing-context/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/missing-context/manifest.json index 033e0298244b1..70eaa1758b4df 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/missing-context/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/missing-context/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "missing": { "key": "missing:context:key", "provider": "context-provider", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/multiple-stacks/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/multiple-stacks/manifest.json index 419fb9720861e..054e01f01204d 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/multiple-stacks/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/multiple-stacks/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/single-stack/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/single-stack/manifest.json index 52431c4ec78f0..fc95445f48e0c 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/single-stack/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/single-stack/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", diff --git a/packages/@aws-cdk/cx-api/test/fixtures/stack-without-params/manifest.json b/packages/@aws-cdk/cx-api/test/fixtures/stack-without-params/manifest.json index 1a13623b27127..162f05483a9f5 100644 --- a/packages/@aws-cdk/cx-api/test/fixtures/stack-without-params/manifest.json +++ b/packages/@aws-cdk/cx-api/test/fixtures/stack-without-params/manifest.json @@ -1,5 +1,5 @@ { - "version": "0.34.0", + "version": "0.36.0", "artifacts": { "MyStackName": { "type": "aws:cloudformation:stack", From 30c35d184b09b0575b9f50230862c310d0e4c4c6 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 23 Jun 2019 21:57:03 +0300 Subject: [PATCH 2/3] fix test message --- packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts b/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts index 979ff20606206..87ef7f7da341b 100644 --- a/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts +++ b/packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts @@ -89,5 +89,5 @@ test('fails for invalid dependencies', () => { test('verifyManifestVersion', () => { verifyManifestVersion(CLOUD_ASSEMBLY_VERSION); expect(() => verifyManifestVersion('0.31.0')).toThrow(`CDK CLI can only be used with apps created by CDK >= ${CLOUD_ASSEMBLY_VERSION}`); - expect(() => verifyManifestVersion('99.99.99')).toThrow(`CDK CLI >= ${CLOUD_ASSEMBLY_VERSION} is required to interact with this app`); + expect(() => verifyManifestVersion('99.99.99')).toThrow(`CDK CLI >= 99.99.99 is required to interact with this app`); }); \ No newline at end of file From 4d55e182fdc986ae9200e78dd32f9bf756e3c947 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Sun, 23 Jun 2019 22:32:06 +0300 Subject: [PATCH 3/3] chore: fix build break caused by parallel PRs --- packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts index 4ab9a98ee8aa4..cf9043fc8f13d 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts @@ -329,7 +329,7 @@ export = { Name: 'foo.com', })); - test.equal(cluster.defaultNamespace!.type, cloudmap.NamespaceType.DNS_PUBLIC); + test.equal(cluster.defaultCloudMapNamespace!.type, cloudmap.NamespaceType.DNS_PUBLIC); test.done(); },