Skip to content

Commit

Permalink
refactor(cx-api): bump cli <=> cdk protocol version (#2956)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Elad Ben-Israel committed Jun 23, 2019
1 parent a942e4c commit 8ab84ec
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cdk/test/test.synthesis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cx-api/lib/cloud-assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cx-api/lib/versioning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Array [

exports[`empty assembly 1`] = `
Object {
"version": "0.34.0",
"version": "0.36.0",
}
`;

Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/cx-api/test/cloud-assembly.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 >= 99.99.99 is required to interact with this app`);
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"StackA": {
"type": "aws:cloudformation:stack",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cx-api/test/fixtures/empty/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.34.0"
"version": "0.36.0"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyArt": {
"type": "who:am:i",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"StackA": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"missing": {
"key": "missing:context:key",
"provider": "context-provider",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.34.0",
"version": "0.36.0",
"artifacts": {
"MyStackName": {
"type": "aws:cloudformation:stack",
Expand Down

0 comments on commit 8ab84ec

Please sign in to comment.