From 9581ca15da4162aaaeeb1dd2372ad10606d07e4b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:34:30 +0000 Subject: [PATCH 01/10] chore(deps): update pnpm to v8.13.0 (#26428) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 639b38e81b0c47c..214a45a7c3407e9 100644 --- a/package.json +++ b/package.json @@ -348,7 +348,7 @@ "typescript": "5.3.3", "unified": "9.2.2" }, - "packageManager": "pnpm@8.12.1", + "packageManager": "pnpm@8.13.0", "files": [ "dist", "renovate-schema.json" From b8a28e0309def1ede5e723dbb460fde52e520892 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 16:44:31 +0000 Subject: [PATCH 02/10] chore(deps): update pnpm to v8.13.1 (#26430) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 214a45a7c3407e9..516945440ebe6a0 100644 --- a/package.json +++ b/package.json @@ -348,7 +348,7 @@ "typescript": "5.3.3", "unified": "9.2.2" }, - "packageManager": "pnpm@8.13.0", + "packageManager": "pnpm@8.13.1", "files": [ "dist", "renovate-schema.json" From 109883fd76ea55185d07b7f9f47825c27a19e436 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 05:09:48 +0000 Subject: [PATCH 03/10] chore(deps): update dependency @types/eslint to v8.56.0 (#26433) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 516945440ebe6a0..29d6f3c09ebed22 100644 --- a/package.json +++ b/package.json @@ -278,7 +278,7 @@ "@types/common-tags": "1.8.4", "@types/conventional-commits-detector": "1.0.2", "@types/diff": "5.0.9", - "@types/eslint": "8.44.9", + "@types/eslint": "8.56.0", "@types/fs-extra": "11.0.4", "@types/git-url-parse": "9.0.3", "@types/github-url-from-git": "1.5.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b130cc8357697d8..e2556c11f41e6e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -398,8 +398,8 @@ importers: specifier: 5.0.9 version: 5.0.9 '@types/eslint': - specifier: 8.44.9 - version: 8.44.9 + specifier: 8.56.0 + version: 8.56.0 '@types/fs-extra': specifier: 11.0.4 version: 11.0.4 @@ -3733,8 +3733,8 @@ packages: resolution: {integrity: sha512-TB/6hBkYQJxsZHSqyeuO1Jt0AB/bW6G7rHt9g7lML7SOF6lbgcHvw/Lr+69iqN0qxgXLhWKScAon73JNnptuDw==} dev: false - /@types/eslint@8.44.9: - resolution: {integrity: sha512-6yBxcvwnnYoYT1Uk2d+jvIfsuP4mb2EdIxFnrPABj5a/838qe5bGkNLFOiipX4ULQ7XVQvTxOh7jO+BTAiqsEw==} + /@types/eslint@8.56.0: + resolution: {integrity: sha512-FlsN0p4FhuYRjIxpbdXovvHQhtlG05O1GG/RNWvdAxTboR438IOTwmrY/vLA+Xfgg06BTkP045M3vpFwTMv1dg==} dependencies: '@types/estree': 1.0.5 '@types/json-schema': 7.0.15 From 0f01e8aaf92eaf3eeaeffaea379e8df170613b6f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Dec 2023 05:29:15 +0000 Subject: [PATCH 04/10] chore(deps): update linters to v6.16.0 (#26434) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 +- pnpm-lock.yaml | 107 +++++++++++++++++++++++++------------------------ 2 files changed, 56 insertions(+), 55 deletions(-) diff --git a/package.json b/package.json index 29d6f3c09ebed22..7977ec473cc803b 100644 --- a/package.json +++ b/package.json @@ -306,8 +306,8 @@ "@types/url-join": "4.0.3", "@types/validate-npm-package-name": "4.0.2", "@types/xmldoc": "1.1.9", - "@typescript-eslint/eslint-plugin": "6.15.0", - "@typescript-eslint/parser": "6.15.0", + "@typescript-eslint/eslint-plugin": "6.16.0", + "@typescript-eslint/parser": "6.16.0", "aws-sdk-client-mock": "3.0.0", "callsite": "1.0.0", "common-tags": "1.8.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e2556c11f41e6e3..4dc154501e13e2b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -482,11 +482,11 @@ importers: specifier: 1.1.9 version: 1.1.9 '@typescript-eslint/eslint-plugin': - specifier: 6.15.0 - version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.16.0 + version: 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: 6.15.0 - version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) + specifier: 6.16.0 + version: 6.16.0(eslint@8.56.0)(typescript@5.3.3) aws-sdk-client-mock: specifier: 3.0.0 version: 3.0.0 @@ -516,13 +516,13 @@ importers: version: 1.4.3 eslint-import-resolver-typescript: specifier: 3.6.1 - version: 3.6.1(@typescript-eslint/parser@6.15.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + version: 3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) eslint-plugin-import: specifier: 2.29.1 - version: 2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + version: 2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) eslint-plugin-jest: specifier: 27.6.0 - version: 27.6.0(@typescript-eslint/eslint-plugin@6.15.0)(eslint@8.56.0)(jest@29.7.0)(typescript@5.3.3) + version: 27.6.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint@8.56.0)(jest@29.7.0)(typescript@5.3.3) eslint-plugin-jest-formatting: specifier: 3.1.0 version: 3.1.0(eslint@8.56.0) @@ -3988,8 +3988,8 @@ packages: dev: false optional: true - /@typescript-eslint/eslint-plugin@6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg==} + /@typescript-eslint/eslint-plugin@6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-O5f7Kv5o4dLWQtPX4ywPPa+v9G+1q1x8mz0Kr0pXUtKsevo+gIJHLkGc8RxaZWtP8RrhwhSNIWThnW42K9/0rQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -4000,11 +4000,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/type-utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -4030,8 +4030,8 @@ packages: - typescript dev: true - /@typescript-eslint/parser@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==} + /@typescript-eslint/parser@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -4040,10 +4040,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -4059,16 +4059,16 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/scope-manager@6.15.0: - resolution: {integrity: sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==} + /@typescript-eslint/scope-manager@6.16.0: + resolution: {integrity: sha512-0N7Y9DSPdaBQ3sqSCwlrm9zJwkpOuc6HYm7LpzLAPqBL7dmzAUimr4M29dMkOP/tEwvOCC/Cxo//yOfJD3HUiw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/visitor-keys': 6.16.0 dev: true - /@typescript-eslint/type-utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-CnmHKTfX6450Bo49hPg2OkIm/D/TVYV7jO1MCfPYGwf6x3GO0VU8YMO5AYMn+u3X05lRRxA4fWCz87GFQV6yVQ==} + /@typescript-eslint/type-utils@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-ThmrEOcARmOnoyQfYkHw/DX2SEYBalVECmoldVuH6qagKROp/jMnfXpAU/pAIWub9c4YTxga+XwgAkoA0pxfmg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -4077,8 +4077,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -4092,8 +4092,8 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@6.15.0: - resolution: {integrity: sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==} + /@typescript-eslint/types@6.16.0: + resolution: {integrity: sha512-hvDFpLEvTJoHutVl87+MG/c5C8I6LOgEx05zExTSJDEVU7hhR3jhV8M5zuggbdFCw98+HhZWPHZeKS97kS3JoQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -4118,8 +4118,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.15.0(typescript@5.3.3): - resolution: {integrity: sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==} + /@typescript-eslint/typescript-estree@6.16.0(typescript@5.3.3): + resolution: {integrity: sha512-VTWZuixh/vr7nih6CfrdpmFNLEnoVBF1skfjdyGnNwXOH1SLeHItGdZDHhhAIzd3ACazyY2Fg76zuzOVTaknGA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -4127,11 +4127,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 + minimatch: 9.0.3 semver: 7.5.4 ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 @@ -4159,8 +4160,8 @@ packages: - typescript dev: true - /@typescript-eslint/utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==} + /@typescript-eslint/utils@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-T83QPKrBm6n//q9mv7oiSvy/Xq/7Hyw9SzSEhMHJwznEmQayfBM87+oAlkNAMEO7/MjIwKyOHgBJbxB0s7gx2A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -4168,9 +4169,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -4186,11 +4187,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.15.0: - resolution: {integrity: sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==} + /@typescript-eslint/visitor-keys@6.16.0: + resolution: {integrity: sha512-QSFQLruk7fhs91a/Ep/LqRdbJCZ1Rq03rqBdKT5Ky17Sz8zRLUksqIe9DW0pKtg/Z35/ztbLQ6qpOCN6rOC11A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/types': 6.16.0 eslint-visitor-keys: 3.4.3 dev: true @@ -5628,7 +5629,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.15.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -5638,8 +5639,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.15.0 eslint: 8.56.0 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.13.1 @@ -5651,7 +5652,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-module-utils@2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: @@ -5672,16 +5673,16 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) debug: 3.2.7 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.15.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.16.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -5691,7 +5692,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) array-includes: 3.1.7 array.prototype.findlastindex: 1.2.3 array.prototype.flat: 1.3.2 @@ -5700,7 +5701,7 @@ packages: doctrine: 2.1.0 eslint: 8.56.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.15.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.16.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) hasown: 2.0.0 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -5725,7 +5726,7 @@ packages: eslint: 8.56.0 dev: true - /eslint-plugin-jest@27.6.0(@typescript-eslint/eslint-plugin@6.15.0)(eslint@8.56.0)(jest@29.7.0)(typescript@5.3.3): + /eslint-plugin-jest@27.6.0(@typescript-eslint/eslint-plugin@6.16.0)(eslint@8.56.0)(jest@29.7.0)(typescript@5.3.3): resolution: {integrity: sha512-MTlusnnDMChbElsszJvrwD1dN3x6nZl//s4JD23BxB6MgR66TZlL064su24xEIS3VACfAoHV1vgyMgPw8nkdng==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -5738,7 +5739,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/eslint-plugin': 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/utils': 5.62.0(eslint@8.56.0)(typescript@5.3.3) eslint: 8.56.0 jest: 29.7.0(@types/node@18.19.3)(ts-node@10.9.2) From 84270beec4c42d483a9d949553dcfa18898d21d0 Mon Sep 17 00:00:00 2001 From: Gabriel-Ladzaretti <97394622+Gabriel-Ladzaretti@users.noreply.github.com> Date: Wed, 27 Dec 2023 10:03:30 +0200 Subject: [PATCH 05/10] fix(matchConfidence): align supported datasources list with internal preset (#26420) Co-authored-by: Michael Kriese --- docs/usage/merge-confidence.md | 1 + docs/usage/self-hosted-experimental.md | 5 ++ .../presets/internal/merge-confidence.ts | 30 ++++---- lib/util/merge-confidence/index.spec.ts | 72 ++++++++++++++++++- lib/util/merge-confidence/index.ts | 43 ++++++++++- 5 files changed, 127 insertions(+), 24 deletions(-) diff --git a/docs/usage/merge-confidence.md b/docs/usage/merge-confidence.md index 76e361aa616b1c6..01a24c4633abbb4 100644 --- a/docs/usage/merge-confidence.md +++ b/docs/usage/merge-confidence.md @@ -29,6 +29,7 @@ Renovate will show Merge Confidence badges for these languages: | Language | Datasource | | ---------- | ----------- | +| Golang | `go` | | JavaScript | `npm` | | Java | `maven` | | Python | `pypi` | diff --git a/docs/usage/self-hosted-experimental.md b/docs/usage/self-hosted-experimental.md index 45d7c8fffc70037..01a2993e4148737 100644 --- a/docs/usage/self-hosted-experimental.md +++ b/docs/usage/self-hosted-experimental.md @@ -126,6 +126,11 @@ Skip initializing `RE2` for regular expressions and instead use Node-native `Reg If set, Renovate will query this API for Merge Confidence data. This feature is in private beta. +## `RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES` + +If set, Renovate will query the merge-confidence JSON API only for datasources that are part of this list. +The expected value for this environment variable is a JSON array of strings. + ## `RENOVATE_X_PLATFORM_VERSION` If set, Renovate will use this string as GitLab server version instead of checking via the GitLab API. diff --git a/lib/config/presets/internal/merge-confidence.ts b/lib/config/presets/internal/merge-confidence.ts index abde81e4398f2a0..f2e900c8bf621b4 100644 --- a/lib/config/presets/internal/merge-confidence.ts +++ b/lib/config/presets/internal/merge-confidence.ts @@ -1,19 +1,21 @@ import type { Preset } from '../types'; +export const supportedDatasources = [ + 'go', + 'maven', + 'npm', + 'nuget', + 'packagist', + 'pypi', + 'rubygems', +]; + export const presets: Record = { 'all-badges': { description: 'Show all Merge Confidence badges for pull requests.', packageRules: [ { - matchDatasources: [ - 'maven', - 'npm', - 'nuget', - 'packagist', - 'pypi', - 'rubygems', - 'go', - ], + matchDatasources: supportedDatasources, matchUpdateTypes: ['patch', 'minor', 'major'], prBodyColumns: [ 'Package', @@ -31,15 +33,7 @@ export const presets: Record = { 'Show only the Age and Confidence Merge Confidence badges for pull requests.', packageRules: [ { - matchDatasources: [ - 'maven', - 'npm', - 'nuget', - 'packagist', - 'pypi', - 'rubygems', - 'go', - ], + matchDatasources: supportedDatasources, matchUpdateTypes: ['patch', 'minor', 'major'], prBodyColumns: ['Package', 'Change', 'Age', 'Confidence'], }, diff --git a/lib/util/merge-confidence/index.spec.ts b/lib/util/merge-confidence/index.spec.ts index a347fd0170f3066..6c9e379abe23cc2 100644 --- a/lib/util/merge-confidence/index.spec.ts +++ b/lib/util/merge-confidence/index.spec.ts @@ -9,6 +9,7 @@ import { initConfig, initMergeConfidence, isActiveConfidenceLevel, + parseSupportedDatasourceString, resetConfig, satisfiesConfidenceLevel, } from '.'; @@ -296,8 +297,11 @@ describe('util/merge-confidence/index', () => { }); describe('initMergeConfidence()', () => { - it('using default base url if none is set', async () => { + beforeEach(() => { resetConfig(); + }); + + it('using default base url if none is set', async () => { delete process.env.RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL; httpMock .scope(defaultApiBaseUrl) @@ -309,12 +313,22 @@ describe('util/merge-confidence/index', () => { 'using default merge confidence API base URL', ); expect(logger.debug).toHaveBeenCalledWith( + { + supportedDatasources: [ + 'go', + 'maven', + 'npm', + 'nuget', + 'packagist', + 'pypi', + 'rubygems', + ], + }, 'merge confidence API - successfully authenticated', ); }); it('warns and then resolves if base url is invalid', async () => { - resetConfig(); process.env.RENOVATE_X_MERGE_CONFIDENCE_API_BASE_URL = 'invalid-url.com'; httpMock @@ -328,12 +342,12 @@ describe('util/merge-confidence/index', () => { 'invalid merge confidence API base URL found in environment variables - using default value instead', ); expect(logger.debug).toHaveBeenCalledWith( + expect.anything(), 'merge confidence API - successfully authenticated', ); }); it('resolves if no token', async () => { - resetConfig(); hostRules.clear(); await expect(initMergeConfidence()).toResolve(); @@ -347,6 +361,7 @@ describe('util/merge-confidence/index', () => { await expect(initMergeConfidence()).toResolve(); expect(logger.debug).toHaveBeenCalledWith( + expect.anything(), 'merge confidence API - successfully authenticated', ); }); @@ -389,6 +404,57 @@ describe('util/merge-confidence/index', () => { 'merge confidence API request failed - aborting run', ); }); + + describe('parseSupportedDatasourceList()', () => { + type ParseSupportedDatasourceTestCase = { + name: string; + datasourceListString: string | undefined; + expected: string[] | undefined; + }; + + afterEach(() => { + delete process.env.RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES; + }); + + it.each([ + { + name: 'it should do nothing when the input is undefined', + datasourceListString: undefined, + expected: undefined, + }, + { + name: 'it should successfully parse the given datasource list', + datasourceListString: `["go","npm"]`, + expected: ['go', 'npm'], + }, + { + name: 'it should gracefully handle invalid json', + datasourceListString: `{`, + expected: undefined, + }, + { + name: 'it should discard non-array JSON input', + datasourceListString: `{}`, + expected: undefined, + }, + { + name: 'it should discard non-string array JSON input', + datasourceListString: `[1,2]`, + expected: undefined, + }, + ])( + `$name`, + ({ + datasourceListString, + expected, + }: ParseSupportedDatasourceTestCase) => { + process.env.RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES = + datasourceListString; + + expect(parseSupportedDatasourceString()).toStrictEqual(expected); + }, + ); + }); }); }); }); diff --git a/lib/util/merge-confidence/index.ts b/lib/util/merge-confidence/index.ts index e903d32cab0f4b8..95386836a04a365 100644 --- a/lib/util/merge-confidence/index.ts +++ b/lib/util/merge-confidence/index.ts @@ -1,8 +1,10 @@ import is from '@sindresorhus/is'; +import { supportedDatasources as presetSupportedDatasources } from '../../config/presets/internal/merge-confidence'; import type { UpdateType } from '../../config/types'; import { logger } from '../../logger'; import { ExternalHostError } from '../../types/errors/external-host-error'; import * as packageCache from '../cache/package'; +import { parseJson } from '../common'; import * as hostRules from '../host-rules'; import { Http } from '../http'; import { MERGE_CONFIDENCE } from './common'; @@ -12,8 +14,7 @@ const hostType = 'merge-confidence'; const http = new Http(hostType); let token: string | undefined; let apiBaseUrl: string | undefined; - -const supportedDatasources = ['npm', 'maven', 'pypi']; +let supportedDatasources: string[] = []; export const confidenceLevels: Record = { low: -1, @@ -25,14 +26,47 @@ export const confidenceLevels: Record = { export function initConfig(): void { apiBaseUrl = getApiBaseUrl(); token = getApiToken(); + supportedDatasources = + parseSupportedDatasourceString() ?? presetSupportedDatasources; + if (!is.nullOrUndefined(token)) { logger.debug(`Merge confidence token found for ${apiBaseUrl}`); } } +export function parseSupportedDatasourceString(): string[] | undefined { + const supportedDatasourceString = + process.env.RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES; + + if (!is.string(supportedDatasourceString)) { + return undefined; + } + + let parsedDatasourceList: unknown; + try { + parsedDatasourceList = parseJson(supportedDatasourceString, '.json5'); + } catch (err) { + logger.error( + { supportedDatasourceString, err }, + 'Failed to parse supported datasources list; Invalid JSON format', + ); + } + + if (!is.array(parsedDatasourceList, is.string)) { + logger.warn( + { parsedDatasourceList }, + `Expected a string array but got ${typeof parsedDatasourceList}`, + ); + return undefined; + } + + return parsedDatasourceList; +} + export function resetConfig(): void { token = undefined; apiBaseUrl = undefined; + supportedDatasources = []; } export function isMergeConfidence(value: string): value is MergeConfidence { @@ -190,7 +224,10 @@ export async function initMergeConfidence(): Promise { apiErrorHandler(err); } - logger.debug('merge confidence API - successfully authenticated'); + logger.debug( + { supportedDatasources }, + 'merge confidence API - successfully authenticated', + ); return; } From 1786438d33c8282de786862dd2a863bf67109e0f Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman2@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:17:03 +0200 Subject: [PATCH 06/10] feat(platform/azure): implement automergeStrategy for Azure DevOps platform (#26429) --- lib/config/options/index.ts | 2 +- lib/modules/platform/azure/index.spec.ts | 182 +++++++++++++++++++++- lib/modules/platform/azure/index.ts | 12 +- lib/modules/platform/azure/readme.md | 4 - lib/modules/platform/azure/util.ts | 18 +++ lib/modules/platform/types.ts | 1 + lib/workers/repository/update/pr/index.ts | 1 + 7 files changed, 210 insertions(+), 10 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 06319babafae1f6..1a32eb51dc3e4ca 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1828,7 +1828,7 @@ const options: RenovateOptions[] = [ type: 'string', allowedValues: ['auto', 'fast-forward', 'merge-commit', 'rebase', 'squash'], default: 'auto', - supportedPlatforms: ['bitbucket', 'gitea'], + supportedPlatforms: ['azure', 'bitbucket', 'gitea'], }, { name: 'automergeComment', diff --git a/lib/modules/platform/azure/index.spec.ts b/lib/modules/platform/azure/index.spec.ts index 3924120dd94b7e9..50610286181d1dd 100644 --- a/lib/modules/platform/azure/index.spec.ts +++ b/lib/modules/platform/azure/index.spec.ts @@ -2,6 +2,7 @@ import { Readable } from 'node:stream'; import is from '@sindresorhus/is'; import type { IGitApi } from 'azure-devops-node-api/GitApi'; import { + GitPullRequest, GitPullRequestMergeStrategy, GitStatusState, PullRequestStatus, @@ -936,7 +937,7 @@ describe('modules/platform/azure/index', () => { expect(pr).toMatchSnapshot(); }); - it('should only call getMergeMethod once per run', async () => { + it('should only call getMergeMethod once per run when automergeStrategy is auto', async () => { await initRepo({ repository: 'some/repo' }); const prResult = [ { @@ -1001,7 +1002,10 @@ describe('modules/platform/azure/index', () => { prTitle: 'The Title', prBody: 'Hello world', labels: ['deps', 'renovate'], - platformOptions: { usePlatformAutomerge: true }, + platformOptions: { + automergeStrategy: 'auto', + usePlatformAutomerge: true, + }, }); await azure.createPr({ @@ -1010,12 +1014,128 @@ describe('modules/platform/azure/index', () => { prTitle: 'The Second Title', prBody: 'Hello world', labels: ['deps', 'renovate'], - platformOptions: { usePlatformAutomerge: true }, + platformOptions: { + automergeStrategy: 'auto', + usePlatformAutomerge: true, + }, }); expect(updateFn).toHaveBeenCalledTimes(2); expect(azureHelper.getMergeMethod).toHaveBeenCalledTimes(1); }); + + it.each` + automergeStrategy + ${'fast-forward'} + ${'merge-commit'} + ${'rebase'} + ${'squash'} + `( + 'should not call getMergeMethod when automergeStrategy is $automergeStrategy', + async (automergeStrategy) => { + await initRepo({ repository: 'some/repo' }); + const prResult = { + pullRequestId: 123, + title: 'The Title', + createdBy: { + id: '123', + }, + }; + const prUpdateResults = { + ...prResult, + autoCompleteSetBy: { + id: prResult.createdBy.id, + }, + completionOptions: { + squashMerge: true, + deleteSourceBranch: true, + mergeCommitMessage: 'The Title', + }, + }; + const updateFn = jest.fn(() => Promise.resolve(prUpdateResults)); + + azureApi.gitApi.mockResolvedValue( + partial({ + createPullRequest: jest.fn(() => Promise.resolve(prResult)), + createPullRequestLabel: jest.fn().mockResolvedValue({}), + updatePullRequest: updateFn, + }), + ); + await azure.createPr({ + sourceBranch: 'some-branch', + targetBranch: 'dev', + prTitle: 'The Title', + prBody: 'Hello world', + labels: ['deps', 'renovate'], + platformOptions: { + automergeStrategy, + usePlatformAutomerge: true, + }, + }); + + expect(azureHelper.getMergeMethod).toHaveBeenCalledTimes(0); + }, + ); + + it.each` + automergeStrategy | prMergeStrategy + ${'fast-forward'} | ${GitPullRequestMergeStrategy.Rebase} + ${'merge-commit'} | ${GitPullRequestMergeStrategy.NoFastForward} + ${'rebase'} | ${GitPullRequestMergeStrategy.Rebase} + ${'squash'} | ${GitPullRequestMergeStrategy.Squash} + `( + 'should create PR with mergeStrategy $prMergeStrategy', + async ({ automergeStrategy, prMergeStrategy }) => { + await initRepo({ repository: 'some/repo' }); + const prResult = { + pullRequestId: 456, + title: 'The Title', + createdBy: { + id: '123', + }, + }; + const prUpdateResult = { + ...prResult, + autoCompleteSetBy: { + id: prResult.createdBy.id, + }, + completionOptions: { + mergeStrategy: prMergeStrategy, + squashMerge: false, + deleteSourceBranch: true, + mergeCommitMessage: 'The Title', + }, + }; + const updateFn = jest.fn().mockResolvedValue(prUpdateResult); + azureApi.gitApi.mockResolvedValueOnce( + partial({ + createPullRequest: jest.fn().mockResolvedValue(prResult), + createPullRequestLabel: jest.fn().mockResolvedValue({}), + updatePullRequest: updateFn, + }), + ); + const pr = await azure.createPr({ + sourceBranch: 'some-branch', + targetBranch: 'dev', + prTitle: 'The Title', + prBody: 'Hello world', + labels: ['deps', 'renovate'], + platformOptions: { + automergeStrategy, + usePlatformAutomerge: true, + }, + }); + + expect((pr as GitPullRequest).completionOptions?.mergeStrategy).toBe( + prMergeStrategy, + ); + expect(updateFn).toHaveBeenCalled(); + expect( + updateFn.mock.calls[0][0].completionOptions.mergeStrategy, + ).toBe(prMergeStrategy); + expect(azureHelper.getMergeMethod).toHaveBeenCalledTimes(0); + }, + ); }); it('should create and return an approved PR object', async () => { @@ -1528,6 +1648,7 @@ describe('modules/platform/azure/index', () => { const res = await azure.mergePr({ branchName: branchNameMock, id: pullRequestIdMock, + strategy: 'auto', }); expect(updatePullRequestMock).toHaveBeenCalledWith( @@ -1546,6 +1667,59 @@ describe('modules/platform/azure/index', () => { expect(res).toBeTrue(); }); + it.each` + automergeStrategy | prMergeStrategy + ${'fast-forward'} | ${GitPullRequestMergeStrategy.Rebase} + ${'merge-commit'} | ${GitPullRequestMergeStrategy.NoFastForward} + ${'rebase'} | ${GitPullRequestMergeStrategy.Rebase} + ${'squash'} | ${GitPullRequestMergeStrategy.Squash} + `( + 'should complete PR with mergeStrategy $prMergeStrategy', + async ({ automergeStrategy, prMergeStrategy }) => { + await initRepo({ repository: 'some/repo' }); + const pullRequestIdMock = 12345; + const branchNameMock = 'test'; + const lastMergeSourceCommitMock = { commitId: 'abcd1234' }; + const updatePullRequestMock = jest.fn(() => ({ + status: 3, + })); + azureApi.gitApi.mockImplementationOnce( + () => + ({ + getPullRequestById: jest.fn(() => ({ + lastMergeSourceCommit: lastMergeSourceCommitMock, + targetRefName: 'refs/heads/ding', + title: 'title', + })), + updatePullRequest: updatePullRequestMock, + }) as any, + ); + + azureHelper.getMergeMethod = jest.fn().mockReturnValue(prMergeStrategy); + + const res = await azure.mergePr({ + branchName: branchNameMock, + id: pullRequestIdMock, + strategy: automergeStrategy, + }); + + expect(updatePullRequestMock).toHaveBeenCalledWith( + { + status: PullRequestStatus.Completed, + lastMergeSourceCommit: lastMergeSourceCommitMock, + completionOptions: { + mergeStrategy: prMergeStrategy, + deleteSourceBranch: true, + mergeCommitMessage: 'title', + }, + }, + '1', + pullRequestIdMock, + ); + expect(res).toBeTrue(); + }, + ); + it('should return false if the PR does not update successfully', async () => { await initRepo({ repository: 'some/repo' }); const pullRequestIdMock = 12345; @@ -1593,10 +1767,12 @@ describe('modules/platform/azure/index', () => { await azure.mergePr({ branchName: 'test-branch-1', id: 1234, + strategy: 'auto', }); await azure.mergePr({ branchName: 'test-branch-2', id: 5678, + strategy: 'auto', }); expect(azureHelper.getMergeMethod).toHaveBeenCalledTimes(1); diff --git a/lib/modules/platform/azure/index.ts b/lib/modules/platform/azure/index.ts index c154d4cd6b8c7b5..fe9fa26c19d8334 100644 --- a/lib/modules/platform/azure/index.ts +++ b/lib/modules/platform/azure/index.ts @@ -52,6 +52,7 @@ import { getRenovatePRFormat, getRepoByName, getStorageExtraCloneOpts, + mapMergeStrategy, max4000Chars, } from './util'; @@ -491,7 +492,10 @@ export async function createPr({ config.repoId, ); if (platformOptions?.usePlatformAutomerge) { - const mergeStrategy = await getMergeStrategy(pr.targetRefName!); + const mergeStrategy = + platformOptions.automergeStrategy === 'auto' + ? await getMergeStrategy(pr.targetRefName!) + : mapMergeStrategy(platformOptions.automergeStrategy); pr = await azureApiGit.updatePullRequest( { autoCompleteSetBy: { @@ -736,13 +740,17 @@ export async function setBranchStatus({ export async function mergePr({ branchName, id: pullRequestId, + strategy, }: MergePRConfig): Promise { logger.debug(`mergePr(${pullRequestId}, ${branchName!})`); const azureApiGit = await azureApi.gitApi(); let pr = await azureApiGit.getPullRequestById(pullRequestId, config.project); - const mergeStrategy = await getMergeStrategy(pr.targetRefName!); + const mergeStrategy = + strategy === 'auto' + ? await getMergeStrategy(pr.targetRefName!) + : mapMergeStrategy(strategy); const objToUpdate: GitPullRequest = { status: PullRequestStatus.Completed, lastMergeSourceCommit: pr.lastMergeSourceCommit, diff --git a/lib/modules/platform/azure/readme.md b/lib/modules/platform/azure/readme.md index b65aaa7b87f3e3a..cb06f4b7a66080c 100644 --- a/lib/modules/platform/azure/readme.md +++ b/lib/modules/platform/azure/readme.md @@ -18,10 +18,6 @@ Permissions for your PAT should be at minimum: Remember to set `platform=azure` somewhere in your Renovate config file. -## Features awaiting implementation - -- The `automergeStrategy` configuration option has not been implemented for this platform, and all values behave as if the value `auto` was used. Renovate will use the merge strategy configured in the Azure Repos repository itself, and this cannot be overridden yet - ## Running Renovate in Azure Pipelines ### Setting up a new pipeline diff --git a/lib/modules/platform/azure/util.ts b/lib/modules/platform/azure/util.ts index adbb2560a6ff868..9ca3563961bcb5e 100644 --- a/lib/modules/platform/azure/util.ts +++ b/lib/modules/platform/azure/util.ts @@ -1,9 +1,11 @@ import { GitPullRequest, + GitPullRequestMergeStrategy, GitRepository, GitStatusContext, PullRequestStatus, } from 'azure-devops-node-api/interfaces/GitInterfaces.js'; +import type { MergeStrategy } from '../../../config/types'; import { logger } from '../../../logger'; import type { HostRule, PrState } from '../../../types'; import type { GitOptions } from '../../../types/git'; @@ -181,3 +183,19 @@ export function getRepoByName( } return foundRepo ?? null; } + +export function mapMergeStrategy( + mergeStrategy?: MergeStrategy, +): GitPullRequestMergeStrategy { + switch (mergeStrategy) { + case 'rebase': + case 'fast-forward': + return GitPullRequestMergeStrategy.Rebase; + case 'merge-commit': + return GitPullRequestMergeStrategy.NoFastForward; + case 'squash': + return GitPullRequestMergeStrategy.Squash; + default: + return GitPullRequestMergeStrategy.NoFastForward; + } +} diff --git a/lib/modules/platform/types.ts b/lib/modules/platform/types.ts index 4f9a980d566d81a..78587912fe026fc 100644 --- a/lib/modules/platform/types.ts +++ b/lib/modules/platform/types.ts @@ -96,6 +96,7 @@ export interface Issue { } export type PlatformPrOptions = { autoApprove?: boolean; + automergeStrategy?: MergeStrategy; azureWorkItemId?: number; bbUseDefaultReviewers?: boolean; gitLabIgnoreApprovals?: boolean; diff --git a/lib/workers/repository/update/pr/index.ts b/lib/workers/repository/update/pr/index.ts index 6eb44a70eb04a6f..e9dccd6b4a18462 100644 --- a/lib/workers/repository/update/pr/index.ts +++ b/lib/workers/repository/update/pr/index.ts @@ -55,6 +55,7 @@ export function getPlatformPrOptions( return { autoApprove: !!config.autoApprove, + automergeStrategy: config.automergeStrategy, azureWorkItemId: config.azureWorkItemId ?? 0, bbUseDefaultReviewers: !!config.bbUseDefaultReviewers, gitLabIgnoreApprovals: !!config.gitLabIgnoreApprovals, From 4345212cff909ecfb8e749eaaa4946200cdf7a75 Mon Sep 17 00:00:00 2001 From: joegoldman2 <147369450+joegoldman2@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:52:08 +0200 Subject: [PATCH 07/10] test(platform/azure): replace squashMerge by mergeStrategy (#26436) --- .../platform/azure/__snapshots__/index.spec.ts.snap | 2 +- lib/modules/platform/azure/index.spec.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/modules/platform/azure/__snapshots__/index.spec.ts.snap b/lib/modules/platform/azure/__snapshots__/index.spec.ts.snap index ecd7882d4abbc23..147506066058082 100644 --- a/lib/modules/platform/azure/__snapshots__/index.spec.ts.snap +++ b/lib/modules/platform/azure/__snapshots__/index.spec.ts.snap @@ -60,7 +60,7 @@ exports[`modules/platform/azure/index createPr() when usePlatformAutomerge is se "completionOptions": { "deleteSourceBranch": true, "mergeCommitMessage": "The Title", - "squashMerge": true, + "mergeStrategy": 2, }, "createdAt": undefined, "createdBy": { diff --git a/lib/modules/platform/azure/index.spec.ts b/lib/modules/platform/azure/index.spec.ts index 50610286181d1dd..9aaa23a87ef0faf 100644 --- a/lib/modules/platform/azure/index.spec.ts +++ b/lib/modules/platform/azure/index.spec.ts @@ -912,7 +912,7 @@ describe('modules/platform/azure/index', () => { id: prResult.createdBy.id, }, completionOptions: { - squashMerge: true, + mergeStrategy: GitPullRequestMergeStrategy.Squash, deleteSourceBranch: true, mergeCommitMessage: 'The Title', }, @@ -962,7 +962,7 @@ describe('modules/platform/azure/index', () => { id: prResult[0].createdBy.id, }, completionOptions: { - squashMerge: true, + mergeStrategy: GitPullRequestMergeStrategy.Squash, deleteSourceBranch: true, mergeCommitMessage: 'The Title', }, @@ -973,7 +973,7 @@ describe('modules/platform/azure/index', () => { id: prResult[1].createdBy.id, }, completionOptions: { - squashMerge: true, + mergeStrategy: GitPullRequestMergeStrategy.Squash, deleteSourceBranch: true, mergeCommitMessage: 'The Second Title', }, @@ -1047,7 +1047,7 @@ describe('modules/platform/azure/index', () => { id: prResult.createdBy.id, }, completionOptions: { - squashMerge: true, + mergeStrategy: GitPullRequestMergeStrategy.Squash, deleteSourceBranch: true, mergeCommitMessage: 'The Title', }, @@ -1101,7 +1101,6 @@ describe('modules/platform/azure/index', () => { }, completionOptions: { mergeStrategy: prMergeStrategy, - squashMerge: false, deleteSourceBranch: true, mergeCommitMessage: 'The Title', }, From 9e171ff861b6a125b6fbe796595bd02c278cbd6b Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Wed, 27 Dec 2023 20:39:32 +0545 Subject: [PATCH 08/10] fix(onboarding): add `commitBody` to commitMessage (#26426) --- lib/config/types.ts | 1 + .../onboarding/branch/create.spec.ts | 48 +++++++++++++++++++ .../repository/onboarding/branch/create.ts | 15 +++++- 3 files changed, 62 insertions(+), 2 deletions(-) diff --git a/lib/config/types.ts b/lib/config/types.ts index 777f27b3aa0a000..9f3a6d46f858794 100644 --- a/lib/config/types.ts +++ b/lib/config/types.ts @@ -208,6 +208,7 @@ export interface RenovateConfig Record { depName?: string; baseBranches?: string[]; + commitBody?: string; useBaseBranchConfig?: UseBaseBranchConfigType; baseBranch?: string; defaultBranch?: string; diff --git a/lib/workers/repository/onboarding/branch/create.spec.ts b/lib/workers/repository/onboarding/branch/create.spec.ts index e58bd7aec5ef1b0..db9b3b8ddf75a4c 100644 --- a/lib/workers/repository/onboarding/branch/create.spec.ts +++ b/lib/workers/repository/onboarding/branch/create.spec.ts @@ -57,6 +57,54 @@ describe('workers/repository/onboarding/branch/create', () => { }); }); + describe('applies the commitBody value', () => { + it('to the default commit message', async () => { + await createOnboardingBranch({ + ...config, + commitBody: 'some commit body', + }); + expect(scm.commitAndPush).toHaveBeenCalledWith({ + branchName: 'renovate/configure', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: '{"foo":"bar"}', + }, + ], + force: true, + message: `Add renovate.json\n\nsome commit body`, + platformCommit: false, + }); + }); + + it('to the supplied commit message', async () => { + const message = + 'We can Renovate if we want to, we can leave PRs in decline'; + + config.onboardingCommitMessage = message; + + await createOnboardingBranch({ + ...config, + commitBody: 'Signed Off: {{{gitAuthor}}}', + gitAuthor: '', + }); + expect(scm.commitAndPush).toHaveBeenCalledWith({ + branchName: 'renovate/configure', + files: [ + { + type: 'addition', + path: 'renovate.json', + contents: '{"foo":"bar"}', + }, + ], + force: true, + message: `We can Renovate if we want to, we can leave PRs in decline\n\nSigned Off: `, + platformCommit: false, + }); + }); + }); + describe('applies the commitMessagePrefix value', () => { it('to the default commit message', async () => { const prefix = 'RENOV-123'; diff --git a/lib/workers/repository/onboarding/branch/create.ts b/lib/workers/repository/onboarding/branch/create.ts index e90459e3100c8bb..708d82cc33f1674 100644 --- a/lib/workers/repository/onboarding/branch/create.ts +++ b/lib/workers/repository/onboarding/branch/create.ts @@ -3,6 +3,7 @@ import { GlobalConfig } from '../../../../config/global'; import type { RenovateConfig } from '../../../../config/types'; import { logger } from '../../../../logger'; import { scm } from '../../../../modules/platform/scm'; +import { compile } from '../../../../util/template'; import { OnboardingCommitMessageFactory } from './commit-message'; import { getOnboardingConfigContents } from './config'; @@ -25,7 +26,17 @@ export async function createOnboardingBranch( config, configFile!, ); - const commitMessage = commitMessageFactory.create(); + let commitMessage = commitMessageFactory.create().toString(); + + if (config.commitBody) { + commitMessage = `${commitMessage}\n\n${compile( + config.commitBody, + // only allow gitAuthor template value in the commitBody + { gitAuthor: config.gitAuthor }, + )}`; + + logger.trace(`commitMessage: ${commitMessage}`); + } // istanbul ignore if if (GlobalConfig.get('dryRun')) { @@ -44,7 +55,7 @@ export async function createOnboardingBranch( contents, }, ], - message: commitMessage.toString(), + message: commitMessage, platformCommit: !!config.platformCommit, force: true, }); From 3a8574bbd7e0a95006d6cfe847d00b7e0ffb4f95 Mon Sep 17 00:00:00 2001 From: Patrick Lannigan Date: Wed, 27 Dec 2023 14:52:22 -0500 Subject: [PATCH 09/10] feat(manager/pep621): Add support for python build-system dependencies (#26440) --- lib/modules/manager/pep621/extract.spec.ts | 45 ++++++++++++++++++++++ lib/modules/manager/pep621/extract.ts | 6 +++ lib/modules/manager/pep621/readme.md | 1 + lib/modules/manager/pep621/schema.ts | 5 +++ lib/modules/manager/pep621/utils.ts | 1 + 5 files changed, 58 insertions(+) diff --git a/lib/modules/manager/pep621/extract.spec.ts b/lib/modules/manager/pep621/extract.spec.ts index 63aa8bcbdd11ff9..4911bc35b732ad4 100644 --- a/lib/modules/manager/pep621/extract.spec.ts +++ b/lib/modules/manager/pep621/extract.spec.ts @@ -281,6 +281,13 @@ describe('modules/manager/pep621/extract', () => { depType: 'project.dependencies', packageName: 'requests', }, + { + datasource: 'pypi', + depName: 'hatchling', + depType: 'build-system.requires', + packageName: 'hatchling', + skipReason: 'unspecified-version', + }, { currentValue: '==6.5', datasource: 'pypi', @@ -323,5 +330,43 @@ describe('modules/manager/pep621/extract', () => { const res = extractPackageFile(content, 'pyproject.toml'); expect(res?.packageFileVersion).toBe('0.0.2'); }); + + it('should extract dependencies from build-system.requires', function () { + const content = codeBlock` + [build-system] + requires = ["hatchling==1.18.0", "setuptools==69.0.3"] + build-backend = "hatchling.build" + + [project] + name = "test" + version = "0.0.2" + dependencies = [ "requests==2.30.0" ] + `; + const result = extractPackageFile(content, 'pyproject.toml'); + + expect(result?.deps).toEqual([ + { + currentValue: '==2.30.0', + datasource: 'pypi', + depName: 'requests', + depType: 'project.dependencies', + packageName: 'requests', + }, + { + currentValue: '==1.18.0', + datasource: 'pypi', + depName: 'hatchling', + depType: 'build-system.requires', + packageName: 'hatchling', + }, + { + currentValue: '==69.0.3', + datasource: 'pypi', + depName: 'setuptools', + depType: 'build-system.requires', + packageName: 'setuptools', + }, + ]); + }); }); }); diff --git a/lib/modules/manager/pep621/extract.ts b/lib/modules/manager/pep621/extract.ts index d1f8e4accf7bf20..66648663dcddafa 100644 --- a/lib/modules/manager/pep621/extract.ts +++ b/lib/modules/manager/pep621/extract.ts @@ -43,6 +43,12 @@ export function extractPackageFile( def.project?.['optional-dependencies'], ), ); + deps.push( + ...parseDependencyList( + depTypes.buildSystemRequires, + def['build-system']?.requires, + ), + ); // process specific tool sets let processedDeps = deps; diff --git a/lib/modules/manager/pep621/readme.md b/lib/modules/manager/pep621/readme.md index 344e3948559e4e0..3d3009e5b558564 100644 --- a/lib/modules/manager/pep621/readme.md +++ b/lib/modules/manager/pep621/readme.md @@ -9,5 +9,6 @@ Available `depType`s: - `project.dependencies` - `project.optional-dependencies` +- `build-system.requires` - `tool.pdm.dev-dependencies` - `tool.hatch.envs.` diff --git a/lib/modules/manager/pep621/schema.ts b/lib/modules/manager/pep621/schema.ts index 880336adb38dc52..212a1301c1b2576 100644 --- a/lib/modules/manager/pep621/schema.ts +++ b/lib/modules/manager/pep621/schema.ts @@ -16,6 +16,11 @@ export const PyProjectSchema = z.object({ 'optional-dependencies': DependencyRecordSchema, }) .optional(), + 'build-system': z + .object({ + requires: DependencyListSchema, + }) + .optional(), tool: z .object({ pdm: z diff --git a/lib/modules/manager/pep621/utils.ts b/lib/modules/manager/pep621/utils.ts index 4420992bcb4f43a..5b28541993508f0 100644 --- a/lib/modules/manager/pep621/utils.ts +++ b/lib/modules/manager/pep621/utils.ts @@ -15,6 +15,7 @@ export const depTypes = { dependencies: 'project.dependencies', optionalDependencies: 'project.optional-dependencies', pdmDevDependencies: 'tool.pdm.dev-dependencies', + buildSystemRequires: 'build-system.requires', }; export function parsePEP508( From 53e1ca654c01340917c0ab1abf1991d6ad461b98 Mon Sep 17 00:00:00 2001 From: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> Date: Thu, 28 Dec 2023 11:48:41 +0100 Subject: [PATCH 10/10] docs(renovate style guide): avoid manually ordering numbered lists (#26445) --- docs/development/style-guide.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/development/style-guide.md b/docs/development/style-guide.md index 82c5939dc4ee93e..628697993fd0d80 100644 --- a/docs/development/style-guide.md +++ b/docs/development/style-guide.md @@ -21,6 +21,24 @@ Second sentence on a new line. And so on. ``` +## Avoid manually ordering numbered lists + +Avoid: + +```markdown +1. First item +2. Second item +3. Third item +``` + +Do: + +```markdown +1. First item +1. Second item +1. Third item +``` + ## Avoid punctuation at the end of list items In Markdown files, avoid punctuation at the end of a list item.