From f32feca9db5b34fbd90c4b4fe8605de5597306fe Mon Sep 17 00:00:00 2001 From: Kaizen Conroy Date: Mon, 23 Jan 2023 16:14:33 -0500 Subject: [PATCH 1/2] fix(cfnpsec): incorrectly handling array result from jsondiff --- .../@aws-cdk/cfnspec/build-tools/spec-diff.ts | 6 ++- packages/@aws-cdk/cfnspec/package.json | 2 +- packages/aws-cdk/package.json | 2 +- yarn.lock | 54 ++++++++++++------- 4 files changed, 42 insertions(+), 22 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/build-tools/spec-diff.ts b/packages/@aws-cdk/cfnspec/build-tools/spec-diff.ts index 86fb8a6145f21..465637b789522 100644 --- a/packages/@aws-cdk/cfnspec/build-tools/spec-diff.ts +++ b/packages/@aws-cdk/cfnspec/build-tools/spec-diff.ts @@ -237,6 +237,10 @@ async function main() { if (Array.isArray(update)) { changes.push(`* ${namespace} ${prefix} (__changed__)`); for (const entry of update) { + if (entry.length === 1 && entry[0] === ' ') { + // This means that this element of the array is unchanged + continue; + } if (entry.length !== 2) { throw new Error(`Unexpected array diff entry: ${JSON.stringify(entry)}`); } @@ -247,7 +251,7 @@ async function main() { case '-': throw new Error(`Something awkward happened: ${entry[1]} was deleted from ${namespace} ${prefix}!`); case ' ': - // This entry is "context" + // This entry is "context" break; default: throw new Error(`Unexpected array diff entry: ${JSON.stringify(entry)}`); diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 1059a75dd0e8c..3193b1d97cd2d 100644 --- a/packages/@aws-cdk/cfnspec/package.json +++ b/packages/@aws-cdk/cfnspec/package.json @@ -37,7 +37,7 @@ "@types/md5": "^2.3.2", "fast-json-patch": "^3.1.1", "jest": "^27.5.1", - "json-diff": "^0.10.0", + "json-diff": "^1.0.0", "sort-json": "^2.0.1" }, "dependencies": { diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index 2ffe78205e747..bd5788e719add 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -109,7 +109,7 @@ "decamelize": "^5.0.1", "fs-extra": "^9.1.0", "glob": "^7.2.3", - "json-diff": "^0.10.0", + "json-diff": "^1.0.0", "minimatch": ">=3.1", "p-queue": "^6.6.2", "promptly": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 33eb7ae6bfacb..81de647b506db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -500,6 +500,13 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@ewoudenberg/difflib@0.1.0": + version "0.1.0" + resolved "https://registry.npmjs.org/@ewoudenberg/difflib/-/difflib-0.1.0.tgz#a2ae5d3321ffa7c1b47691cf0db189d1264aaaa4" + integrity sha512-OU5P5mJyD3OoWYMWY+yIgwvgNS9cFAU10f+DDuvtogcWQOoJIsQ4Hy2McSfUfhKjq8L0FuWVb4Rt7kgA+XK86A== + dependencies: + heap ">= 0.2.0" + "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -1987,7 +1994,7 @@ dependencies: "@types/glob" "*" -"@types/aws-lambda@^8.10.109": +"@types/aws-lambda@^8.10.101", "@types/aws-lambda@^8.10.109": version "8.10.109" resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.109.tgz#2f434cbfafe083529e365fe9c114787827a169a8" integrity sha512-/ME92FneNyXQzrAfcnQQlW1XkCZGPDlpi2ao1MJwecN+6SbeonKeggU8eybv1DfKli90FAVT1MlIZVXfwVuCyg== @@ -2184,16 +2191,16 @@ resolved "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== +"@types/node@^14.18.23", "@types/node@^14.18.36": + version "14.18.36" + resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" + integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== + "@types/node@^14.18.31": version "14.18.35" resolved "https://registry.npmjs.org/@types/node/-/node-14.18.35.tgz#879c4659cb7b3fe515844f029c75079c941bb65c" integrity sha512-2ATO8pfhG1kDvw4Lc4C0GXIMSQFFJBCo/R1fSgTwmUlq5oy95LXyjDQinsRVgQY6gp6ghh3H91wk9ES5/5C+Tw== -"@types/node@^14.18.36": - version "14.18.36" - resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" - integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== - "@types/node@^16.9.2": version "16.18.11" resolved "https://registry.npmjs.org/@types/node/-/node-16.18.11.tgz#cbb15c12ca7c16c85a72b6bdc4d4b01151bb3cae" @@ -2911,6 +2918,22 @@ aws-sdk-mock@5.6.0: sinon "^11.1.1" traverse "^0.6.6" +aws-sdk@^2.1093.0, aws-sdk@^2.848.0: + version "2.1299.0" + resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1299.0.tgz#493254104af5b9aaee0d7cd9150611d137e4f205" + integrity sha512-xTh6pmCUEJljkFfTM3sE8UozDxal80uX/5WZl8GcjQ+NbrGeQEdvL6wFWBwEEVbhR0VBVuU37cKPuQlfENbRYA== + dependencies: + buffer "4.9.2" + events "1.1.1" + ieee754 "1.1.13" + jmespath "0.16.0" + querystring "0.2.0" + sax "1.2.1" + url "0.10.3" + util "^0.12.4" + uuid "8.0.0" + xml2js "0.4.19" + aws-sdk@^2.1211.0, aws-sdk@^2.596.0, aws-sdk@^2.928.0: version "2.1292.0" resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1292.0.tgz#bff92d794b8bbb71628c2f7b9d799c34ef2f27b4" @@ -4348,13 +4371,6 @@ diff@^5.0.0, diff@^5.1.0: resolved "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== -difflib@~0.2.1: - version "0.2.4" - resolved "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz#b5e30361a6db023176d562892db85940a718f47e" - integrity sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w== - dependencies: - heap ">= 0.2.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -7127,13 +7143,13 @@ json-buffer@3.0.0: resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== -json-diff@^0.10.0: - version "0.10.0" - resolved "https://registry.npmjs.org/json-diff/-/json-diff-0.10.0.tgz#9ded0aea47bccad7900eabce441d03a82cbd19af" - integrity sha512-jOkbyMEdbIhROk4s9qWyD+YZ1jSHX8mHlUqWz71jwnRB/rDhWZBLdhv84j5pu4Ri8fFAnFOZANHKIlExcf2+KQ== +json-diff@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/json-diff/-/json-diff-1.0.0.tgz#73fe9642778cbe5a99eec515ff0de065cf22de6a" + integrity sha512-9M6M60W4GUxmha6eoFhRVKF+tDw70jdqrxo3u6aqQ6/cwW6RhkSTPI0gvfCRcBwbWiUWvJo9jR6e9TZxcQdhnA== dependencies: + "@ewoudenberg/difflib" "0.1.0" cli-color "^2.0.0" - difflib "~0.2.1" dreamopt "~0.8.0" json-parse-better-errors@^1.0.1: @@ -8282,7 +8298,7 @@ nise@^5.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^13.3.0: +nock@^13.2.9, nock@^13.3.0: version "13.3.0" resolved "https://registry.npmjs.org/nock/-/nock-13.3.0.tgz#b13069c1a03f1ad63120f994b04bfd2556925768" integrity sha512-HHqYQ6mBeiMc+N038w8LkMpDCRquCHWeNmN3v6645P3NhN2+qXOBqvPqo7Rt1VyCMzKhJ733wZqw5B7cQVFNPg== From ef27325edf15e0eb97c3d0e5be17466c1bab98cf Mon Sep 17 00:00:00 2001 From: Kaizen Conroy Date: Mon, 23 Jan 2023 16:19:17 -0500 Subject: [PATCH 2/2] revert version bump --- packages/@aws-cdk/cfnspec/package.json | 2 +- packages/aws-cdk/package.json | 2 +- yarn.lock | 54 +++++++++----------------- 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/packages/@aws-cdk/cfnspec/package.json b/packages/@aws-cdk/cfnspec/package.json index 3193b1d97cd2d..1059a75dd0e8c 100644 --- a/packages/@aws-cdk/cfnspec/package.json +++ b/packages/@aws-cdk/cfnspec/package.json @@ -37,7 +37,7 @@ "@types/md5": "^2.3.2", "fast-json-patch": "^3.1.1", "jest": "^27.5.1", - "json-diff": "^1.0.0", + "json-diff": "^0.10.0", "sort-json": "^2.0.1" }, "dependencies": { diff --git a/packages/aws-cdk/package.json b/packages/aws-cdk/package.json index bd5788e719add..2ffe78205e747 100644 --- a/packages/aws-cdk/package.json +++ b/packages/aws-cdk/package.json @@ -109,7 +109,7 @@ "decamelize": "^5.0.1", "fs-extra": "^9.1.0", "glob": "^7.2.3", - "json-diff": "^1.0.0", + "json-diff": "^0.10.0", "minimatch": ">=3.1", "p-queue": "^6.6.2", "promptly": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 81de647b506db..33eb7ae6bfacb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -500,13 +500,6 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@ewoudenberg/difflib@0.1.0": - version "0.1.0" - resolved "https://registry.npmjs.org/@ewoudenberg/difflib/-/difflib-0.1.0.tgz#a2ae5d3321ffa7c1b47691cf0db189d1264aaaa4" - integrity sha512-OU5P5mJyD3OoWYMWY+yIgwvgNS9cFAU10f+DDuvtogcWQOoJIsQ4Hy2McSfUfhKjq8L0FuWVb4Rt7kgA+XK86A== - dependencies: - heap ">= 0.2.0" - "@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" @@ -1994,7 +1987,7 @@ dependencies: "@types/glob" "*" -"@types/aws-lambda@^8.10.101", "@types/aws-lambda@^8.10.109": +"@types/aws-lambda@^8.10.109": version "8.10.109" resolved "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.109.tgz#2f434cbfafe083529e365fe9c114787827a169a8" integrity sha512-/ME92FneNyXQzrAfcnQQlW1XkCZGPDlpi2ao1MJwecN+6SbeonKeggU8eybv1DfKli90FAVT1MlIZVXfwVuCyg== @@ -2191,16 +2184,16 @@ resolved "https://registry.npmjs.org/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== -"@types/node@^14.18.23", "@types/node@^14.18.36": - version "14.18.36" - resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" - integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== - "@types/node@^14.18.31": version "14.18.35" resolved "https://registry.npmjs.org/@types/node/-/node-14.18.35.tgz#879c4659cb7b3fe515844f029c75079c941bb65c" integrity sha512-2ATO8pfhG1kDvw4Lc4C0GXIMSQFFJBCo/R1fSgTwmUlq5oy95LXyjDQinsRVgQY6gp6ghh3H91wk9ES5/5C+Tw== +"@types/node@^14.18.36": + version "14.18.36" + resolved "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835" + integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ== + "@types/node@^16.9.2": version "16.18.11" resolved "https://registry.npmjs.org/@types/node/-/node-16.18.11.tgz#cbb15c12ca7c16c85a72b6bdc4d4b01151bb3cae" @@ -2918,22 +2911,6 @@ aws-sdk-mock@5.6.0: sinon "^11.1.1" traverse "^0.6.6" -aws-sdk@^2.1093.0, aws-sdk@^2.848.0: - version "2.1299.0" - resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1299.0.tgz#493254104af5b9aaee0d7cd9150611d137e4f205" - integrity sha512-xTh6pmCUEJljkFfTM3sE8UozDxal80uX/5WZl8GcjQ+NbrGeQEdvL6wFWBwEEVbhR0VBVuU37cKPuQlfENbRYA== - dependencies: - buffer "4.9.2" - events "1.1.1" - ieee754 "1.1.13" - jmespath "0.16.0" - querystring "0.2.0" - sax "1.2.1" - url "0.10.3" - util "^0.12.4" - uuid "8.0.0" - xml2js "0.4.19" - aws-sdk@^2.1211.0, aws-sdk@^2.596.0, aws-sdk@^2.928.0: version "2.1292.0" resolved "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1292.0.tgz#bff92d794b8bbb71628c2f7b9d799c34ef2f27b4" @@ -4371,6 +4348,13 @@ diff@^5.0.0, diff@^5.1.0: resolved "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== +difflib@~0.2.1: + version "0.2.4" + resolved "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz#b5e30361a6db023176d562892db85940a718f47e" + integrity sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w== + dependencies: + heap ">= 0.2.0" + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -7143,13 +7127,13 @@ json-buffer@3.0.0: resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" integrity sha512-CuUqjv0FUZIdXkHPI8MezCnFCdaTAacej1TZYulLoAg1h/PhwkdXFN4V/gzY4g+fMBCOV2xF+rp7t2XD2ns/NQ== -json-diff@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/json-diff/-/json-diff-1.0.0.tgz#73fe9642778cbe5a99eec515ff0de065cf22de6a" - integrity sha512-9M6M60W4GUxmha6eoFhRVKF+tDw70jdqrxo3u6aqQ6/cwW6RhkSTPI0gvfCRcBwbWiUWvJo9jR6e9TZxcQdhnA== +json-diff@^0.10.0: + version "0.10.0" + resolved "https://registry.npmjs.org/json-diff/-/json-diff-0.10.0.tgz#9ded0aea47bccad7900eabce441d03a82cbd19af" + integrity sha512-jOkbyMEdbIhROk4s9qWyD+YZ1jSHX8mHlUqWz71jwnRB/rDhWZBLdhv84j5pu4Ri8fFAnFOZANHKIlExcf2+KQ== dependencies: - "@ewoudenberg/difflib" "0.1.0" cli-color "^2.0.0" + difflib "~0.2.1" dreamopt "~0.8.0" json-parse-better-errors@^1.0.1: @@ -8298,7 +8282,7 @@ nise@^5.1.0: just-extend "^4.0.2" path-to-regexp "^1.7.0" -nock@^13.2.9, nock@^13.3.0: +nock@^13.3.0: version "13.3.0" resolved "https://registry.npmjs.org/nock/-/nock-13.3.0.tgz#b13069c1a03f1ad63120f994b04bfd2556925768" integrity sha512-HHqYQ6mBeiMc+N038w8LkMpDCRquCHWeNmN3v6645P3NhN2+qXOBqvPqo7Rt1VyCMzKhJ733wZqw5B7cQVFNPg==