From 72622d914368cc78395688954780deec97b90859 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Jul 2022 14:18:17 +0000 Subject: [PATCH 1/2] fix(deps): update dependency yaml to v2 Signed-off-by: Renovate Bot --- .changeset/renovate-33c3cf4.md | 14 ++++++++++++++ packages/catalog-model/package.json | 2 +- packages/cli/package.json | 2 +- packages/config-loader/package.json | 2 +- plugins/catalog-backend-module-aws/package.json | 2 +- plugins/catalog-backend/package.json | 2 +- plugins/catalog-import/package.json | 2 +- plugins/catalog-react/package.json | 2 +- plugins/proxy-backend/package.json | 2 +- plugins/scaffolder-backend/package.json | 4 ++-- plugins/scaffolder/package.json | 2 +- yarn.lock | 4 ++-- 12 files changed, 27 insertions(+), 13 deletions(-) create mode 100644 .changeset/renovate-33c3cf4.md diff --git a/.changeset/renovate-33c3cf4.md b/.changeset/renovate-33c3cf4.md new file mode 100644 index 0000000000..8389a89ea1 --- /dev/null +++ b/.changeset/renovate-33c3cf4.md @@ -0,0 +1,14 @@ +--- +'@backstage/catalog-model': patch +'@backstage/cli': patch +'@backstage/config-loader': patch +'@backstage/plugin-catalog-backend-module-aws': patch +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-catalog-import': patch +'@backstage/plugin-catalog-react': patch +'@backstage/plugin-proxy-backend': patch +'@backstage/plugin-scaffolder-backend': patch +'@backstage/plugin-scaffolder': patch +--- + +Updated dependency `yaml` to `^2.0.0`. diff --git a/packages/catalog-model/package.json b/packages/catalog-model/package.json index a58fdcf4d5..460dafa43a 100644 --- a/packages/catalog-model/package.json +++ b/packages/catalog-model/package.json @@ -47,7 +47,7 @@ "@types/jest": "^26.0.7", "@types/json-schema": "^7.0.5", "@types/lodash": "^4.14.151", - "yaml": "^1.9.2" + "yaml": "^2.0.0" }, "files": [ "dist", diff --git a/packages/cli/package.json b/packages/cli/package.json index aead136ec6..a4742ff8ff 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -120,7 +120,7 @@ "webpack": "^5.66.0", "webpack-dev-server": "^4.7.3", "webpack-node-externals": "^3.0.0", - "yaml": "^1.10.0", + "yaml": "^2.0.0", "yml-loader": "^2.1.0", "yn": "^4.0.0", "zod": "^3.11.6" diff --git a/packages/config-loader/package.json b/packages/config-loader/package.json index 3ca4b1455f..638e3dc8e0 100644 --- a/packages/config-loader/package.json +++ b/packages/config-loader/package.json @@ -47,7 +47,7 @@ "json-schema-traverse": "^1.0.0", "node-fetch": "^2.6.7", "typescript-json-schema": "^0.54.0", - "yaml": "^1.9.2", + "yaml": "^2.0.0", "yup": "^0.32.9" }, "devDependencies": { diff --git a/plugins/catalog-backend-module-aws/package.json b/plugins/catalog-backend-module-aws/package.json index c768bbe9e4..4b4e60cf4d 100644 --- a/plugins/catalog-backend-module-aws/package.json +++ b/plugins/catalog-backend-module-aws/package.json @@ -51,7 +51,7 @@ "@backstage/cli": "^0.18.0-next.1", "@types/lodash": "^4.14.151", "aws-sdk-mock": "^5.2.1", - "yaml": "^1.9.2" + "yaml": "^2.0.0" }, "files": [ "dist", diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index ebed76ca90..1e3c4cf1a3 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -63,7 +63,7 @@ "prom-client": "^14.0.1", "uuid": "^8.0.0", "winston": "^3.2.1", - "yaml": "^1.9.2", + "yaml": "^2.0.0", "yn": "^4.0.0", "zod": "^3.11.6" }, diff --git a/plugins/catalog-import/package.json b/plugins/catalog-import/package.json index 042e85f792..49f248ed41 100644 --- a/plugins/catalog-import/package.json +++ b/plugins/catalog-import/package.json @@ -53,7 +53,7 @@ "react-hook-form": "^7.12.2", "react-router": "6.0.0-beta.0", "react-use": "^17.2.4", - "yaml": "^1.10.0" + "yaml": "^2.0.0" }, "peerDependencies": { "@types/react": "^16.13.1 || ^17.0.0", diff --git a/plugins/catalog-react/package.json b/plugins/catalog-react/package.json index 3f3ee5f402..560690245f 100644 --- a/plugins/catalog-react/package.json +++ b/plugins/catalog-react/package.json @@ -55,7 +55,7 @@ "qs": "^6.9.4", "react-router": "6.0.0-beta.0", "react-use": "^17.2.4", - "yaml": "^1.10.0", + "yaml": "^2.0.0", "zen-observable": "^0.8.15" }, "peerDependencies": { diff --git a/plugins/proxy-backend/package.json b/plugins/proxy-backend/package.json index 7eba901c54..e21173910e 100644 --- a/plugins/proxy-backend/package.json +++ b/plugins/proxy-backend/package.json @@ -41,7 +41,7 @@ "morgan": "^1.10.0", "uuid": "^8.0.0", "winston": "^3.2.1", - "yaml": "^1.9.2", + "yaml": "^2.0.0", "yn": "^4.0.0", "yup": "^0.32.9" }, diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index a70e60f714..e889dc0ebf 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -70,7 +70,7 @@ "p-limit": "^3.1.0", "uuid": "^8.2.0", "winston": "^3.2.1", - "yaml": "^1.10.0", + "yaml": "^2.0.0", "vm2": "^3.9.6", "zen-observable": "^0.8.15", "zod": "^3.11.6" @@ -90,7 +90,7 @@ "mock-fs": "^5.1.0", "msw": "^0.43.0", "supertest": "^6.1.3", - "yaml": "^1.10.0" + "yaml": "^2.0.0" }, "files": [ "dist", diff --git a/plugins/scaffolder/package.json b/plugins/scaffolder/package.json index e6223d1952..ad46f47433 100644 --- a/plugins/scaffolder/package.json +++ b/plugins/scaffolder/package.json @@ -72,7 +72,7 @@ "react-router-dom": "6.0.0-beta.0", "react-use": "^17.2.4", "use-immer": "^0.7.0", - "yaml": "^1.9.2", + "yaml": "^2.0.0", "zen-observable": "^0.8.15" }, "peerDependencies": { diff --git a/yarn.lock b/yarn.lock index f06a187ebf..2dfadeaf70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26467,12 +26467,12 @@ yaml-ast-parser@0.0.43, yaml-ast-parser@^0.0.43: resolved "https://registry.npmjs.org/yaml-ast-parser/-/yaml-ast-parser-0.0.43.tgz#e8a23e6fb4c38076ab92995c5dca33f3d3d7c9bb" integrity sha512-2PTINUwsRqSd+s8XxKaJWQlUuEMHJQyEuh2edBbW8KNJz0SJPwUSD2zRWqezFEdN7IzAgeuYHFUCF7o8zRdZ0A== -yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2, yaml@^1.9.2: +yaml@^1.10.0, yaml@^1.10.2, yaml@^1.7.2: version "1.10.2" resolved "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== -yaml@^2.1.1: +yaml@^2.0.0, yaml@^2.1.1: version "2.1.1" resolved "https://registry.npmjs.org/yaml/-/yaml-2.1.1.tgz#1e06fb4ca46e60d9da07e4f786ea370ed3c3cfec" integrity sha512-o96x3OPo8GjWeSLF+wOAbrPfhFOGY0W00GNaxCDv+9hkcDJEnev1yh8S7pgHF0ik6zc8sQLuL8hjHjJULZp8bw== From 51fb0a1d80051355ad689b56c4695f4af26efb46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Wed, 6 Jul 2022 16:39:19 +0200 Subject: [PATCH 2/2] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../src/lib/transform/include.test.ts | 2 +- .../modules/core/PlaceholderProcessor.test.ts | 2 +- .../src/modules/util/parse.test.ts | 34 ++++++++++++------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/packages/config-loader/src/lib/transform/include.test.ts b/packages/config-loader/src/lib/transform/include.test.ts index 91df723621..0913b31f66 100644 --- a/packages/config-loader/src/lib/transform/include.test.ts +++ b/packages/config-loader/src/lib/transform/include.test.ts @@ -155,7 +155,7 @@ describe('includeTransform', () => { await expect( includeTransform({ $include: 'invalid.yaml' }, root), ).rejects.toThrow( - 'failed to parse included file invalid.yaml, YAMLSyntaxError: Flow sequence contains an unexpected }', + /failed to parse included file invalid.yaml, YAMLParseError: Flow sequence in block collection must be sufficiently indented and end with a \] at line 1, column 7:\s+foo: \[\}/, ); }); diff --git a/plugins/catalog-backend/src/modules/core/PlaceholderProcessor.test.ts b/plugins/catalog-backend/src/modules/core/PlaceholderProcessor.test.ts index adff97336e..50cbdf9dd4 100644 --- a/plugins/catalog-backend/src/modules/core/PlaceholderProcessor.test.ts +++ b/plugins/catalog-backend/src/modules/core/PlaceholderProcessor.test.ts @@ -376,7 +376,7 @@ describe('yamlPlaceholderResolver', () => { it('rejects invalid yaml', async () => { read.mockResolvedValue(Buffer.from('a: 1\n----\n', 'utf-8')); await expect(yamlPlaceholderResolver(params)).rejects.toThrow( - 'Placeholder $a found an error in the data at ./file.yaml, YAMLSemanticError: Implicit map keys need to be followed by map values', + /Placeholder \$a found an error in the data at .\/file.yaml, YAMLParseError: Implicit map keys need to be followed by map values at line 2, column 1:\s+a: 1/, ); }); diff --git a/plugins/catalog-backend/src/modules/util/parse.test.ts b/plugins/catalog-backend/src/modules/util/parse.test.ts index e87de1c9a3..eda1723198 100644 --- a/plugins/catalog-backend/src/modules/util/parse.test.ts +++ b/plugins/catalog-backend/src/modules/util/parse.test.ts @@ -156,12 +156,16 @@ describe('parseEntityYaml', () => { ); // Parse errors are always per document - expect(results).toEqual([ - processingResult.generalError( - testLoc, - 'YAML error at my-loc-type:my-loc-target, YAMLSemanticError: Plain value cannot start with reserved character `', - ), - ]); + expect(results.length).toBe(1); + expect(results[0]).toEqual({ + type: 'error', + location: testLoc, + error: expect.objectContaining({ + message: expect.stringMatching( + /YAML error at my-loc-type:my-loc-target, YAMLParseError: Plain value cannot start with reserved character ` at line 1, column 1:/, + ), + }), + }); }); it('should emit parsing errors for individual documents', () => { @@ -185,7 +189,8 @@ describe('parseEntityYaml', () => { ), ); - expect(results).toEqual([ + expect(results.length).toBe(2); + expect(results[0]).toEqual( processingResult.entity(testLoc, { apiVersion: 'backstage.io/v1alpha1', kind: 'Component', @@ -196,11 +201,16 @@ describe('parseEntityYaml', () => { type: 'website', }, }), - processingResult.generalError( - testLoc, - 'YAML error at my-loc-type:my-loc-target, YAMLSemanticError: Nested mappings are not allowed in compact mappings', - ), - ]); + ); + expect(results[1]).toEqual({ + type: 'error', + location: testLoc, + error: expect.objectContaining({ + message: expect.stringMatching( + /YAML error at my-loc-type:my-loc-target, YAMLParseError: Nested mappings are not allowed in compact mappings at line 9, column 19:\s+apiVersion: backstage.io\/v1alpha1/, + ), + }), + }); }); it('must be an object at root', () => {