From 74c87b41e95d2dbfb1228bd30832f038e444af03 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 26 Nov 2024 00:43:20 -0500 Subject: [PATCH 01/29] feat: convert `sourceDirectory` to a template eligible config (#32701) Signed-off-by: Adam Setch --- lib/util/template/index.ts | 1 + .../repository/updates/flatten.spec.ts | 39 ++++++++++++++++--- lib/workers/repository/updates/flatten.ts | 7 ++++ 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 1e3ab8e9c95182..c7a4b453ed6147 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -147,6 +147,7 @@ export const exposedConfigOptions = [ 'semanticCommitType', 'separateMajorMinor', 'separateMinorPatch', + 'sourceDirectory', ]; export const allowedFields = { diff --git a/lib/workers/repository/updates/flatten.spec.ts b/lib/workers/repository/updates/flatten.spec.ts index 402efb5d6833b2..42cd3a7b3b6fe7 100644 --- a/lib/workers/repository/updates/flatten.spec.ts +++ b/lib/workers/repository/updates/flatten.spec.ts @@ -29,6 +29,11 @@ describe('workers/repository/updates/flatten', () => { enabled: false, }, }, + { + matchPackageNames: ['@monorepo/package'], + sourceUrl: 'https://github.com/some/monorepo', + sourceDirectory: "subfolder/{{ lookup (split packageName '/') 1 }}", + }, ]; config.remediations = { 'package-lock.json': [ @@ -65,6 +70,17 @@ describe('workers/repository/updates/flatten', () => { }, ], }, + { + depName: '@monorepo/package', + updates: [ + { + newValue: '2.0.0', + sourceUrl: 'https://github.com/some/monorepo', + sourceDirectory: + "subfolder/{{ lookup (split depName '/') 1 }}", + }, + ], + }, { updateTypes: ['pin'], updates: [{ newValue: '2.0.0' }], @@ -144,7 +160,7 @@ describe('workers/repository/updates/flatten', () => { ], }; const res = await flattenUpdates(config, packageFiles); - expect(res).toHaveLength(14); + expect(res).toHaveLength(15); expect( res.every( (upgrade) => @@ -178,16 +194,29 @@ describe('workers/repository/updates/flatten', () => { res.filter((update) => update.sourceRepoName)[1].sourceRepoName, ).toBe('repo'); expect( - res.filter((update) => update.sourceRepoSlug)[2].sourceRepoSlug, + res.filter((update) => update.depName === '@monorepo/package')[0], + ).toEqual( + expect.objectContaining({ + depName: '@monorepo/package', + sourceRepoOrg: 'some', + sourceRepoName: 'monorepo', + sourceRepo: 'some/monorepo', + sourceRepoSlug: 'some-monorepo', + sourceUrl: 'https://github.com/some/monorepo', + sourceDirectory: 'subfolder/package', + }), + ); + expect( + res.filter((update) => update.sourceRepoSlug)[3].sourceRepoSlug, ).toBe('nodejs-node'); - expect(res.filter((update) => update.sourceRepo)[2].sourceRepo).toBe( + expect(res.filter((update) => update.sourceRepo)[3].sourceRepo).toBe( 'nodejs/node', ); expect( - res.filter((update) => update.sourceRepoOrg)[2].sourceRepoOrg, + res.filter((update) => update.sourceRepoOrg)[3].sourceRepoOrg, ).toBe('nodejs'); expect( - res.filter((update) => update.sourceRepoName)[2].sourceRepoName, + res.filter((update) => update.sourceRepoName)[3].sourceRepoName, ).toBe('node'); expect( res.filter( diff --git a/lib/workers/repository/updates/flatten.ts b/lib/workers/repository/updates/flatten.ts index 1ff393b4abeff8..93b1d51c8556c4 100644 --- a/lib/workers/repository/updates/flatten.ts +++ b/lib/workers/repository/updates/flatten.ts @@ -9,6 +9,7 @@ import { get } from '../../../modules/manager'; import { detectSemanticCommits } from '../../../util/git/semantic'; import { applyPackageRules } from '../../../util/package-rules'; import { regEx } from '../../../util/regex'; +import * as template from '../../../util/template'; import { parseUrl } from '../../../util/url'; import type { BranchUpgradeConfig } from '../../types'; import { generateBranchName } from './branch-name'; @@ -57,6 +58,12 @@ export function applyUpdateConfig(input: BranchUpgradeConfig): any { ); // remove everything up to the last slash } } + if (updateConfig.sourceDirectory) { + updateConfig.sourceDirectory = template.compile( + updateConfig.sourceDirectory, + updateConfig, + ); + } generateBranchName(updateConfig); return updateConfig; } From a704057ab0c36d72cd00d49daca949ca72f739c4 Mon Sep 17 00:00:00 2001 From: ITaluone <44049228+ITaluone@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:03:22 +0100 Subject: [PATCH 02/29] docs(versioning/same-major): fix typo (#32732) --- lib/modules/versioning/same-major/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/versioning/same-major/readme.md b/lib/modules/versioning/same-major/readme.md index 5a95fe4634d917..6b5285b5978929 100644 --- a/lib/modules/versioning/same-major/readme.md +++ b/lib/modules/versioning/same-major/readme.md @@ -1,4 +1,4 @@ -The 'Same Major' versioning is designed to handle the case where a version needs to treated as a "greate than or equal to" constraint. +The 'Same Major' versioning is designed to handle the case where a version needs to treated as a "greater than or equal to" constraint. Specifically, the case where the version say, `X.Y.Z` signifies a range of compatibility from greater than or equal to `X.Y.Z` to less than `X+1`. This process uses Semver-Coerced versioning beneath the surface, single versions (e.g., `X.Y.Z`) are converted to a range like `X+1` and then passed to the corresponding semver-coerced method. From 43be8805bd6fa26a044a9791c83f2afc79ef31ca Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:13:36 +0000 Subject: [PATCH 03/29] chore(deps): update containerbase/internal-tools action to v3.5.1 (#32737) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 304489dac7cd8e..f0f2f9990e5298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -684,7 +684,7 @@ jobs: show-progress: false - name: docker-config - uses: containerbase/internal-tools@0b2d87b3f40e59986fc748c902bff40119629435 # v3.5.0 + uses: containerbase/internal-tools@6a3ee2b64874b17e9ce3e4a6c84257abd2ece9cc # v3.5.1 with: command: docker-config From c51fe04576a82b55f94383d5dea94ea40b636d3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:13:49 +0000 Subject: [PATCH 04/29] build(deps): update dependency @yarnpkg/core to v4.1.6 (#32736) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 32 +++++++++++--------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 76e14e7cd689d3..dc39459c4f2e1a 100644 --- a/package.json +++ b/package.json @@ -168,7 +168,7 @@ "@renovatebot/pep440": "4.0.1", "@renovatebot/ruby-semver": "4.0.0", "@sindresorhus/is": "4.6.0", - "@yarnpkg/core": "4.1.4", + "@yarnpkg/core": "4.1.6", "@yarnpkg/parsers": "3.0.2", "agentkeepalive": "4.5.0", "aggregate-error": "3.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cdd6294e6b9a0..1b5c84cdffb3c6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,8 +87,8 @@ importers: specifier: 4.6.0 version: 4.6.0 '@yarnpkg/core': - specifier: 4.1.4 - version: 4.1.4(typanion@3.14.0) + specifier: 4.1.6 + version: 4.1.6(typanion@3.14.0) '@yarnpkg/parsers': specifier: 3.0.2 version: 3.0.2 @@ -2304,8 +2304,8 @@ packages: '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - '@yarnpkg/core@4.1.4': - resolution: {integrity: sha512-aaftrtm5sfwMlqmj3CYqp1a1Lbd0UR7dOk3K5pMCV3VTDwXWQWw9uwGm4QpE5YairVG30jpOdbTLUcoota55HQ==} + '@yarnpkg/core@4.1.6': + resolution: {integrity: sha512-iF8LOSd4K0RVSB56c4IMYcXp6aiCT3wyWfMmiYSAiLm8tepwEtBOcrL9gzTzrT09NnDRz1CV/YB7iwfnUOMsAg==} engines: {node: '>=18.12.0'} '@yarnpkg/fslib@3.1.1': @@ -2322,8 +2322,8 @@ packages: resolution: {integrity: sha512-/HcYgtUSiJiot/XWGLOlGxPYUG65+/31V8oqk17vZLW1xlCoR4PampyePljOxY2n8/3jz9+tIFzICsyGujJZoA==} engines: {node: '>=18.12.0'} - '@yarnpkg/shell@4.1.0': - resolution: {integrity: sha512-vm0QqqCBuNrVZbzk1gre0G/FUoT8naCYu/gjz+WlmBKPgV5MmFe2Bdm4ApGLQqvg6eS94TXmUpjSHdBzzN3P0Q==} + '@yarnpkg/shell@4.1.1': + resolution: {integrity: sha512-0aS71iJrNQ4cezU5BJ5JpBTXkFQPKkzOEpDtMQm8E2H3g9PLxUe/5VdA60bZq/4N/qazLLYEOngcFZ6QRpraVQ==} engines: {node: '>=18.12.0'} hasBin: true @@ -2852,10 +2852,6 @@ packages: resolution: {integrity: sha512-7EG9VaZZ5SRbZ7m25dmP6xaS0qe9ay6wywMskFOU/lMDKa+3gZr2oeT5OUfXwRP/Bcj8wxdYJ65AHU70CI3tsw==} hasBin: true - cross-spawn@7.0.3: - resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} - engines: {node: '>= 8'} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -8916,7 +8912,7 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@yarnpkg/core@4.1.4(typanion@3.14.0)': + '@yarnpkg/core@4.1.6(typanion@3.14.0)': dependencies: '@arcanis/slice-ansi': 1.1.1 '@types/semver': 7.5.8 @@ -8924,12 +8920,12 @@ snapshots: '@yarnpkg/fslib': 3.1.1 '@yarnpkg/libzip': 3.1.0(@yarnpkg/fslib@3.1.1) '@yarnpkg/parsers': 3.0.2 - '@yarnpkg/shell': 4.1.0(typanion@3.14.0) + '@yarnpkg/shell': 4.1.1(typanion@3.14.0) camelcase: 5.3.1 chalk: 3.0.0 ci-info: 4.1.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 diff: 5.2.0 dotenv: 16.4.5 fast-glob: 3.3.2 @@ -8962,13 +8958,13 @@ snapshots: js-yaml: 3.14.1 tslib: 2.8.1 - '@yarnpkg/shell@4.1.0(typanion@3.14.0)': + '@yarnpkg/shell@4.1.1(typanion@3.14.0)': dependencies: '@yarnpkg/fslib': 3.1.1 '@yarnpkg/parsers': 3.0.2 chalk: 3.0.0 clipanion: 4.0.0-rc.4(typanion@3.14.0) - cross-spawn: 7.0.3 + cross-spawn: 7.0.6 fast-glob: 3.3.2 micromatch: 4.0.8 tslib: 2.8.1 @@ -9543,12 +9539,6 @@ snapshots: cronstrue@2.51.0: {} - cross-spawn@7.0.3: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 From a9291dc77cc71902c064478af771a69d79a25857 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:28:12 +0100 Subject: [PATCH 05/29] build(deps): update dependency cacache to v19 (#32739) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 60 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dc39459c4f2e1a..035ab1c5d1634b 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "aws4": "1.13.2", "azure-devops-node-api": "14.1.0", "bunyan": "1.8.15", - "cacache": "18.0.4", + "cacache": "19.0.1", "chalk": "4.1.2", "changelog-filename-regex": "2.0.1", "clean-git-ref": "2.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1b5c84cdffb3c6..b14e4db8f19999 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -114,8 +114,8 @@ importers: specifier: 1.8.15 version: 1.8.15 cacache: - specifier: 18.0.4 - version: 18.0.4 + specifier: 19.0.1 + version: 19.0.1 chalk: specifier: 4.1.2 version: 4.1.2 @@ -1215,6 +1215,10 @@ packages: resolution: {integrity: sha512-q9CRWjpHCMIh5sVyefoD1cA7PkvILqCZsnSOEUUivORLjxCO/Irmue2DprETiNgEqktDBZaM1Bi+jrarx1XdCg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + '@npmcli/fs@4.0.0': + resolution: {integrity: sha512-/xGlezI6xfGO9NwuJlnwz/K14qD1kCSAGtacBHnGzeAIuJGazcp45KP5NuyARXoKb7cwulAGWVsbeSxdG/cb0Q==} + engines: {node: ^18.17.0 || >=20.5.0} + '@octokit/auth-token@4.0.0': resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} engines: {node: '>= 18'} @@ -2606,6 +2610,10 @@ packages: resolution: {integrity: sha512-B+L5iIa9mgcjLbliir2th36yEwPftrzteHYujzsx3dFP/31GCHcIeS8f5MGd80odLOjaOvSpU3EEAmRQptkxLQ==} engines: {node: ^16.14.0 || >=18.0.0} + cacache@19.0.1: + resolution: {integrity: sha512-hdsUxulXCi5STId78vRVYEtDAjq99ICAUktLTeTYsLoTE6Z8dS0c8pWNCxwdrk9YfJeobDZc2Y186hD/5ZQgFQ==} + engines: {node: ^18.17.0 || >=20.5.0} + cacheable-lookup@5.0.4: resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} engines: {node: '>=10.6.0'} @@ -5587,6 +5595,10 @@ packages: resolution: {integrity: sha512-MGrFH9Z4NP9Iyhqn16sDtBpRRNJ0Y2hNa6D65h736fVSaPCHr4DM4sWUNvVaSuC+0OBGhwsrydQwmgfg5LncqQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + ssri@12.0.0: + resolution: {integrity: sha512-S7iGNosepx9RadX82oimUkvr0Ct7IjJbEbs4mJcTxst8um95J3sDYU1RBEOvdu6oL1Wek2ODI5i4MAw+dZ6cAQ==} + engines: {node: ^18.17.0 || >=20.5.0} + stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} @@ -5999,10 +6011,18 @@ packages: resolution: {integrity: sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + unique-filename@4.0.0: + resolution: {integrity: sha512-XSnEewXmQ+veP7xX2dS5Q4yZAvO40cBN2MWkJ7D/6sW4Dg6wYBNwM1Vrnz1FhH5AdeLIlUXRI9e28z1YZi71NQ==} + engines: {node: ^18.17.0 || >=20.5.0} + unique-slug@4.0.0: resolution: {integrity: sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + unique-slug@5.0.0: + resolution: {integrity: sha512-9OdaqO5kwqR+1kVgHAhsp5vPNU0hnxRa26rBFNfNgM7M6pNtgzeBn3s/xbyCQL3dcjzOatcef6UUHpB/6MaETg==} + engines: {node: ^18.17.0 || >=20.5.0} + unique-string@3.0.0: resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} engines: {node: '>=12'} @@ -7572,6 +7592,11 @@ snapshots: '@npmcli/fs@3.1.1': dependencies: semver: 7.6.3 + optional: true + + '@npmcli/fs@4.0.0': + dependencies: + semver: 7.6.3 '@octokit/auth-token@4.0.0': {} @@ -9298,6 +9323,22 @@ snapshots: ssri: 10.0.6 tar: 6.2.1 unique-filename: 3.0.0 + optional: true + + cacache@19.0.1: + dependencies: + '@npmcli/fs': 4.0.0 + fs-minipass: 3.0.3 + glob: 10.4.5 + lru-cache: 10.4.3 + minipass: 7.1.2 + minipass-collect: 2.0.1 + minipass-flush: 1.0.5 + minipass-pipeline: 1.2.4 + p-map: 7.0.2 + ssri: 12.0.0 + tar: 7.4.3 + unique-filename: 4.0.0 cacheable-lookup@5.0.4: {} @@ -12662,6 +12703,11 @@ snapshots: ssri@10.0.6: dependencies: minipass: 7.1.2 + optional: true + + ssri@12.0.0: + dependencies: + minipass: 7.1.2 stack-utils@2.0.6: dependencies: @@ -13079,10 +13125,20 @@ snapshots: unique-filename@3.0.0: dependencies: unique-slug: 4.0.0 + optional: true + + unique-filename@4.0.0: + dependencies: + unique-slug: 5.0.0 unique-slug@4.0.0: dependencies: imurmurhash: 0.1.4 + optional: true + + unique-slug@5.0.0: + dependencies: + imurmurhash: 0.1.4 unique-string@3.0.0: dependencies: From 30e8d399e9b0eeb7eb2325e964cc88f41436641d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:31:08 +0000 Subject: [PATCH 06/29] build(deps): update dependency git-url-parse to v16 (#32741) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 33 ++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 035ab1c5d1634b..5eef0debbae3fb 100644 --- a/package.json +++ b/package.json @@ -198,7 +198,7 @@ "find-packages": "10.0.4", "find-up": "5.0.0", "fs-extra": "11.2.0", - "git-url-parse": "15.0.0", + "git-url-parse": "16.0.0", "github-url-from-git": "1.5.0", "glob": "11.0.0", "global-agent": "3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b14e4db8f19999..33d0c320c2da04 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -177,8 +177,8 @@ importers: specifier: 11.2.0 version: 11.2.0 git-url-parse: - specifier: 15.0.0 - version: 15.0.0 + specifier: 16.0.0 + version: 16.0.0 github-url-from-git: specifier: 1.5.0 version: 1.5.0 @@ -2124,6 +2124,9 @@ packages: '@types/parse-link-header@2.0.3': resolution: {integrity: sha512-ffLAxD6Xqcf2gSbtEJehj8yJ5R/2OZqD4liodQvQQ+hhO4kg1mk9ToEZQPMtNTm/zIQj2GNleQbsjPp9+UQm4Q==} + '@types/parse-path@7.0.3': + resolution: {integrity: sha512-LriObC2+KYZD3FzCrgWGv/qufdUy4eXrxcLgQMfYXgPbLIecKIsVBaQgUPmxSSLcjmYbDTQbMgr6qr6l/eb7Bg==} + '@types/punycode@2.1.4': resolution: {integrity: sha512-trzh6NzBnq8yw5e35f8xe8VTYjqM3NE7bohBtvDVf/dtUer3zYTLK1Ka3DG3p7bdtoaOHZucma6FfVKlQ134pQ==} @@ -3543,11 +3546,11 @@ packages: engines: {node: '>=10'} hasBin: true - git-up@7.0.0: - resolution: {integrity: sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ==} + git-up@8.0.0: + resolution: {integrity: sha512-uBI8Zdt1OZlrYfGcSVroLJKgyNNXlgusYFzHk614lTasz35yg2PVpL1RMy0LOO2dcvF9msYW3pRfUSmafZNrjg==} - git-url-parse@15.0.0: - resolution: {integrity: sha512-5reeBufLi+i4QD3ZFftcJs9jC26aULFLBU23FeKM/b1rI0K6ofIeAblmDVO7Ht22zTDE9+CkJ3ZVb0CgJmz3UQ==} + git-url-parse@16.0.0: + resolution: {integrity: sha512-Y8iAF0AmCaqXc6a5GYgPQW9ESbncNLOL+CeQAJRhmWUOmnPkKpBYeWYp4mFd3LA5j53CdGDdslzX12yEBVHQQg==} github-from-package@0.0.0: resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} @@ -5059,8 +5062,9 @@ packages: parse-path@7.0.0: resolution: {integrity: sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog==} - parse-url@8.1.0: - resolution: {integrity: sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w==} + parse-url@9.2.0: + resolution: {integrity: sha512-bCgsFI+GeGWPAvAiUv63ZorMeif3/U0zaXABGJbOWt5OH2KCaPHF6S+0ok4aqM9RuIPGyZdx9tR9l13PsW4AYQ==} + engines: {node: '>=14.13.0'} parse5-htmlparser2-tree-adapter@6.0.1: resolution: {integrity: sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==} @@ -8714,6 +8718,8 @@ snapshots: '@types/parse-link-header@2.0.3': {} + '@types/parse-path@7.0.3': {} + '@types/punycode@2.1.4': {} '@types/responselike@1.0.3': @@ -10381,14 +10387,14 @@ snapshots: split2: 3.2.2 through2: 4.0.2 - git-up@7.0.0: + git-up@8.0.0: dependencies: is-ssh: 1.4.0 - parse-url: 8.1.0 + parse-url: 9.2.0 - git-url-parse@15.0.0: + git-url-parse@16.0.0: dependencies: - git-up: 7.0.0 + git-up: 8.0.0 github-from-package@0.0.0: optional: true @@ -12091,8 +12097,9 @@ snapshots: dependencies: protocols: 2.0.1 - parse-url@8.1.0: + parse-url@9.2.0: dependencies: + '@types/parse-path': 7.0.3 parse-path: 7.0.0 parse5-htmlparser2-tree-adapter@6.0.1: From 5fd720a022df872de8e59c6df267d271da416442 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 09:32:04 +0000 Subject: [PATCH 07/29] build(deps): update dependency diff to v7 (#32740) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5eef0debbae3fb..00c690bdb0f2ed 100644 --- a/package.json +++ b/package.json @@ -188,7 +188,7 @@ "deepmerge": "4.3.1", "dequal": "2.0.3", "detect-indent": "6.1.0", - "diff": "5.2.0", + "diff": "7.0.0", "editorconfig": "2.0.0", "email-addresses": "5.0.0", "emoji-regex": "10.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 33d0c320c2da04..75468c3b38400e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -147,8 +147,8 @@ importers: specifier: 6.1.0 version: 6.1.0 diff: - specifier: 5.2.0 - version: 5.2.0 + specifier: 7.0.0 + version: 7.0.0 editorconfig: specifier: 2.0.0 version: 2.0.0 @@ -2995,6 +2995,10 @@ packages: resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} + diff@7.0.0: + resolution: {integrity: sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==} + engines: {node: '>=0.3.1'} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -9695,6 +9699,8 @@ snapshots: diff@5.2.0: {} + diff@7.0.0: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 From 9cbf83a798f32326c0c7c7c1bd7f5110928b05c2 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Tue, 26 Nov 2024 05:22:51 -0500 Subject: [PATCH 08/29] fix(bitbucket): release notes heading link (#32693) Signed-off-by: Adam Setch --- .../update/pr/changelog/release-notes.spec.ts | 71 +++++++++++++++++++ .../update/pr/changelog/release-notes.ts | 20 +++++- 2 files changed, 89 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index bb55d243a1b84e..7bb3bd2ebb0c77 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -35,6 +35,46 @@ const yargsChangelogMd = Fixtures.get('yargs.md'); const adapterutilsChangelogMd = Fixtures.get('adapter-utils.md'); const gitterWebappChangelogMd = Fixtures.get('gitter-webapp.md'); +const bitbucketTreeResponse = { + values: [ + { + type: 'commit_directory', + path: 'lib', + commit: { + hash: '1234', + }, + }, + { + type: 'commit_file', + path: 'CHANGELOG', + commit: { + hash: 'cdef', + }, + }, + { + type: 'commit_file', + path: 'CHANGELOG.json', + commit: { + hash: 'defg', + }, + }, + { + type: 'commit_file', + path: 'CHANGELOG.md', + commit: { + hash: 'abcd', + }, + }, + { + type: 'commit_file', + path: 'RELEASE_NOTES.md', + commit: { + hash: 'asdf', + }, + }, + ], +}; + const githubTreeResponse = { tree: [ { path: 'lib', type: 'tree' }, @@ -53,6 +93,12 @@ const gitlabTreeResponse = [ { path: 'README.md', name: 'README.md', type: 'blob' }, ]; +const bitbucketProject = partial({ + type: 'bitbucket', + apiBaseUrl: 'https://api.bitbucket.org/', + baseUrl: 'https://bitbucket.org/', +}); + const githubProject = partial({ type: 'github', apiBaseUrl: 'https://api.github.com/', @@ -1081,6 +1127,31 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { expect(res).toBeNull(); }); + it('handles bitbucket release notes link', async () => { + httpMock + .scope('https://api.bitbucket.org') + .get('/2.0/repositories/some-org/some-repo/src/HEAD?pagelen=100') + .reply(200, bitbucketTreeResponse) + .get('/2.0/repositories/some-org/some-repo/src/abcd/CHANGELOG.md') + .reply(200, angularJsChangelogMd); + + const res = await getReleaseNotesMd( + { + ...bitbucketProject, + repository: 'some-org/some-repo', + }, + partial({ + version: '1.6.9', + gitRef: '1.6.9', + }), + ); + expect(res).toMatchObject({ + notesSourceUrl: + 'https://bitbucket.org/some-org/some-repo/src/HEAD/CHANGELOG.md', + url: 'https://bitbucket.org/some-org/some-repo/src/HEAD/CHANGELOG.md#169-fiery-basilisk-2018-02-02', + }); + }); + it('parses angular.js', async () => { httpMock .scope('https://api.github.com') diff --git a/lib/workers/repository/update/pr/changelog/release-notes.ts b/lib/workers/repository/update/pr/changelog/release-notes.ts index 0fc00710fa3482..32aebe599c5a42 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.ts @@ -9,7 +9,7 @@ import { detectPlatform } from '../../../../../util/common'; import { linkify } from '../../../../../util/markdown'; import { newlineRegex, regEx } from '../../../../../util/regex'; import { coerceString } from '../../../../../util/string'; -import { isHttpUrl } from '../../../../../util/url'; +import { isHttpUrl, joinUrlParts } from '../../../../../util/url'; import type { BranchUpgradeConfig } from '../../../../types'; import * as bitbucket from './bitbucket'; import * as gitea from './gitea'; @@ -18,6 +18,7 @@ import * as gitlab from './gitlab'; import type { ChangeLogFile, ChangeLogNotes, + ChangeLogPlatform, ChangeLogProject, ChangeLogRelease, ChangeLogResult, @@ -359,7 +360,13 @@ export async function getReleaseNotesMd( if (word.includes(version) && !isHttpUrl(word)) { logger.trace({ body }, 'Found release notes for v' + version); // TODO: fix url - const notesSourceUrl = `${baseUrl}${repository}/blob/HEAD/${changelogFile}`; + const notesSourceUrl = joinUrlParts( + baseUrl, + repository, + getSourceRootPath(project.type), + 'HEAD', + changelogFile, + ); const mdHeadingLink = title .filter((word) => !isHttpUrl(word)) .join('-') @@ -479,3 +486,12 @@ export async function addReleaseNotes( export function shouldSkipChangelogMd(repository: string): boolean { return repositoriesToSkipMdFetching.includes(repository); } + +function getSourceRootPath(type: ChangeLogPlatform): string { + switch (type) { + case 'bitbucket': + return 'src'; + default: + return 'blob'; + } +} From b4f7b02e465452e0943d0ae0228d7777954c6a3c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 12:25:30 +0100 Subject: [PATCH 09/29] chore(deps): update dependency @types/diff to v6 (#32742) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 00c690bdb0f2ed..85be2556d88db1 100644 --- a/package.json +++ b/package.json @@ -281,7 +281,7 @@ "@types/clean-git-ref": "2.0.2", "@types/common-tags": "1.8.4", "@types/conventional-commits-detector": "1.0.2", - "@types/diff": "5.2.3", + "@types/diff": "6.0.0", "@types/eslint": "8.56.12", "@types/fs-extra": "11.0.4", "@types/git-url-parse": "9.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 75468c3b38400e..e68dd20220c21e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -416,8 +416,8 @@ importers: specifier: 1.0.2 version: 1.0.2 '@types/diff': - specifier: 5.2.3 - version: 5.2.3 + specifier: 6.0.0 + version: 6.0.0 '@types/eslint': specifier: 8.56.12 version: 8.56.12 @@ -2016,8 +2016,8 @@ packages: '@types/conventional-commits-detector@1.0.2': resolution: {integrity: sha512-Yzo8dW+b2vziyDD9WNY+IPq4rcZyguHNuyNZC3wv0igpVFRd7VWHufl+vRQaCzDR2ftPTB1VPwbvXxWVpzBo+g==} - '@types/diff@5.2.3': - resolution: {integrity: sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==} + '@types/diff@6.0.0': + resolution: {integrity: sha512-dhVCYGv3ZSbzmQaBSagrv1WJ6rXCdkyTcDyoNu1MD8JohI7pR7k8wdZEm+mvdxRKXyHVwckFzWU1vJc+Z29MlA==} '@types/emscripten@1.39.13': resolution: {integrity: sha512-cFq+fO/isvhvmuP/+Sl4K4jtU6E23DoivtbO4r50e3odaxAiVdbfSYRDdJ4gCdxx+3aRjhphS5ZMwIH4hFy/Cw==} @@ -8625,7 +8625,7 @@ snapshots: '@types/conventional-commits-detector@1.0.2': {} - '@types/diff@5.2.3': {} + '@types/diff@6.0.0': {} '@types/emscripten@1.39.13': {} From 88d1bdf7ee545dd1f6b9df3f03219052fa71a79b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:32:54 +0000 Subject: [PATCH 10/29] build(deps): update dependency yaml to v2.6.1 (#32744) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 85be2556d88db1..16b34ee0d8b43b 100644 --- a/package.json +++ b/package.json @@ -250,7 +250,7 @@ "validate-npm-package-name": "6.0.0", "vuln-vects": "1.1.0", "xmldoc": "1.3.0", - "yaml": "2.6.0", + "yaml": "2.6.1", "zod": "3.23.8" }, "optionalDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e68dd20220c21e..72b31b02076765 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -333,8 +333,8 @@ importers: specifier: 1.3.0 version: 1.3.0 yaml: - specifier: 2.6.0 - version: 2.6.0 + specifier: 2.6.1 + version: 2.6.1 zod: specifier: 3.23.8 version: 3.23.8 @@ -6217,8 +6217,8 @@ packages: resolution: {integrity: sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==} engines: {node: '>=18'} - yaml@2.6.0: - resolution: {integrity: sha512-a6ae//JvKDEra2kdi1qzCyrJW/WZCgFi8ydDV+eXExl95t+5R+ijnqHJbz9tmMh8FUjx3iv2fCQ4dclAQlO2UQ==} + yaml@2.6.1: + resolution: {integrity: sha512-7r0XPzioN/Q9kXBro/XPnA6kznR73DHq+GXh5ON7ZozRO6aMjbmiBuKste2wslTFkC5d1dw0GooOCepZXJ2SAg==} engines: {node: '>= 14'} hasBin: true @@ -13365,7 +13365,7 @@ snapshots: yallist@5.0.0: {} - yaml@2.6.0: {} + yaml@2.6.1: {} yargs-parser@18.1.3: dependencies: From f6abca50b89d14220f686ee47d51dec806d28acd Mon Sep 17 00:00:00 2001 From: peterhirn Date: Tue, 26 Nov 2024 04:57:22 -0800 Subject: [PATCH 11/29] fix(presets): Add F# to dotnet monorepo (#32706) --- lib/data/monorepo.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/data/monorepo.json b/lib/data/monorepo.json index 412f66469aacbf..a246f36cde6eb6 100644 --- a/lib/data/monorepo.json +++ b/lib/data/monorepo.json @@ -255,6 +255,7 @@ "https://github.com/dotnet/aspnetcore", "https://github.com/dotnet/efcore", "https://github.com/dotnet/extensions", + "https://github.com/dotnet/fsharp", "https://github.com/dotnet/maui", "https://github.com/dotnet/roslyn", "https://github.com/dotnet/runtime", From 1ad3f551bcfdeff7c512449d5f8cfe1f80153734 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Tue, 26 Nov 2024 19:06:04 +0100 Subject: [PATCH 12/29] ci: disable Windows tests (#32754) --- jest.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.ts b/jest.config.ts index 9aa56f29293e1b..b709c35129c896 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -385,7 +385,7 @@ if (process.env.SCHEDULE_TEST_SHARDS) { }; if (process.env.ALL_PLATFORMS === 'true') { - shardGrouping['windows-latest'] = scheduleItems(shardKeys, 8); + // shardGrouping['windows-latest'] = scheduleItems(shardKeys, 8); shardGrouping['macos-latest'] = scheduleItems(shardKeys, 4); } From 3001730465b877da88243790a0fbef25d4c2225a Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Tue, 26 Nov 2024 23:39:56 +0530 Subject: [PATCH 13/29] test(presets): validate schedule presets (#32755) --- lib/config/presets/internal/schedule.spec.ts | 149 +++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 lib/config/presets/internal/schedule.spec.ts diff --git a/lib/config/presets/internal/schedule.spec.ts b/lib/config/presets/internal/schedule.spec.ts new file mode 100644 index 00000000000000..39d31897390085 --- /dev/null +++ b/lib/config/presets/internal/schedule.spec.ts @@ -0,0 +1,149 @@ +import { isScheduledNow } from '../../../workers/repository/update/branch/schedule'; +import type { RenovateConfig } from '../../types'; +import { presets } from './schedule'; + +describe('config/presets/internal/schedule', () => { + let config: RenovateConfig; + + beforeAll(() => { + jest.useFakeTimers(); + }); + + beforeEach(() => { + jest.setSystemTime(new Date('2017-06-30T10:50:00.000')); // Locally 2017-06-30 10:50am + + config = {}; + }); + + describe('daily', () => { + it.each` + datetime | expected + ${'2017-06-30T00:50:00.000'} | ${true} + ${'2017-06-30T01:50:00.000'} | ${true} + ${'2017-06-30T02:50:00.000'} | ${true} + ${'2017-06-30T03:50:00.000'} | ${true} + ${'2017-06-30T04:50:00.000'} | ${false} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.daily.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('earlyMondays', () => { + it.each` + datetime | expected + ${'2017-06-26T00:50:00.000'} | ${true} + ${'2017-06-26T01:50:00.000'} | ${true} + ${'2017-06-26T02:50:00.000'} | ${true} + ${'2017-06-26T03:50:00.000'} | ${true} + ${'2017-06-26T04:50:00.000'} | ${false} + ${'2017-06-30T00:50:00.000'} | ${false} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.earlyMondays.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('monthly', () => { + it.each` + datetime | expected + ${'2017-06-01T00:50:00.000'} | ${true} + ${'2017-06-01T01:50:00.000'} | ${true} + ${'2017-06-01T02:50:00.000'} | ${true} + ${'2017-06-01T03:50:00.000'} | ${true} + ${'2017-06-01T04:50:00.000'} | ${false} + ${'2017-06-02T00:50:00.000'} | ${false} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.monthly.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('nonOfficeHours', () => { + it.each` + datetime | expected + ${'2017-06-01T00:50:00.000'} | ${true} + ${'2017-06-01T01:50:00.000'} | ${true} + ${'2017-06-01T02:50:00.000'} | ${true} + ${'2017-06-01T03:50:00.000'} | ${true} + ${'2017-06-01T04:50:00.000'} | ${true} + ${'2017-06-01T10:50:00.000'} | ${false} + ${'2017-06-01T11:50:00.000'} | ${false} + ${'2017-06-01T22:50:00.000'} | ${true} + ${'2017-06-01T23:50:00.000'} | ${true} + ${'2017-06-03T09:50:00.000'} | ${true} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.nonOfficeHours.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + // const weekdays = ['every weekday']; + // const weekends = ['every weekend']; + // const yearly = ['every 12 months on the first day of the month']; + describe('quarterly', () => { + it.each` + datetime | expected + ${'2017-01-01T00:50:00.000'} | ${true} + ${'2017-04-01T01:50:00.000'} | ${true} + ${'2017-07-01T02:50:00.000'} | ${true} + ${'2017-10-01T03:50:00.000'} | ${true} + ${'2017-02-01T04:50:00.000'} | ${false} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.quarterly.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('weekdays', () => { + it.each` + datetime | expected + ${'2017-06-01T00:50:00.000'} | ${true} + ${'2017-06-02T01:50:00.000'} | ${true} + ${'2017-06-03T02:50:00.000'} | ${false} + ${'2017-06-04T03:50:00.000'} | ${false} + ${'2017-06-05T04:50:00.000'} | ${true} + ${'2017-06-06T10:50:00.000'} | ${true} + ${'2017-06-07T11:50:00.000'} | ${true} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.weekdays.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('weekends', () => { + it.each` + datetime | expected + ${'2017-06-01T00:50:00.000'} | ${false} + ${'2017-06-02T01:50:00.000'} | ${false} + ${'2017-06-03T02:50:00.000'} | ${true} + ${'2017-06-04T03:50:00.000'} | ${true} + ${'2017-06-05T04:50:00.000'} | ${false} + ${'2017-06-06T10:50:00.000'} | ${false} + ${'2017-06-07T11:50:00.000'} | ${false} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.weekends.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); + + describe('yearly', () => { + it.each` + datetime | expected + ${'2017-01-01T00:50:00.000'} | ${true} + ${'2017-02-02T01:50:00.000'} | ${false} + ${'2018-01-01T02:50:00.000'} | ${true} + `('$datetime', ({ datetime, expected }) => { + config.schedule = presets.yearly.schedule; + jest.setSystemTime(new Date(datetime)); + expect(isScheduledNow(config)).toBe(expected); + }); + }); +}); From 02ad1ab9cfd9369ddbf53308f94ad420669d9844 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:21:02 +0000 Subject: [PATCH 14/29] chore(deps): update dependency @types/better-sqlite3 to v7.6.12 (#32756) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 16b34ee0d8b43b..b1ac3be2725374 100644 --- a/package.json +++ b/package.json @@ -272,7 +272,7 @@ "@swc/core": "1.9.2", "@types/auth-header": "1.0.6", "@types/aws4": "1.11.6", - "@types/better-sqlite3": "7.6.11", + "@types/better-sqlite3": "7.6.12", "@types/breejs__later": "4.1.5", "@types/bunyan": "1.8.11", "@types/cacache": "17.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 72b31b02076765..18f00a05d35566 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -389,8 +389,8 @@ importers: specifier: 1.11.6 version: 1.11.6 '@types/better-sqlite3': - specifier: 7.6.11 - version: 7.6.11 + specifier: 7.6.12 + version: 7.6.12 '@types/breejs__later': specifier: 4.1.5 version: 4.1.5 @@ -1983,8 +1983,8 @@ packages: '@types/babel__traverse@7.20.6': resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} - '@types/better-sqlite3@7.6.11': - resolution: {integrity: sha512-i8KcD3PgGtGBLl3+mMYA8PdKkButvPyARxA7IQAd6qeslht13qxb1zzO8dRCtE7U3IoJS782zDBAeoKiM695kg==} + '@types/better-sqlite3@7.6.12': + resolution: {integrity: sha512-fnQmj8lELIj7BSrZQAdBMHEHX8OZLYIHXqAKT1O7tDfLxaINzf00PMjw22r3N/xXh0w/sGHlO6SVaCQ2mj78lg==} '@types/breejs__later@4.1.5': resolution: {integrity: sha512-O7VIO7sktsIwmLUyEeUnLMJ+QD2pv0yBGI2EMbVmwC1GOOTWJAaneL82ZyIwRgpEjJ9ciUHP8LuuuU55uj5ZjA==} @@ -8590,7 +8590,7 @@ snapshots: dependencies: '@babel/types': 7.26.0 - '@types/better-sqlite3@7.6.11': + '@types/better-sqlite3@7.6.12': dependencies: '@types/node': 20.17.6 From bca7268da825b82babb9c9b309cf9641762dae81 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:26:33 +0000 Subject: [PATCH 15/29] chore(deps): update containerbase/internal-tools action to v3.5.2 (#32757) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f0f2f9990e5298..bea40c4a13ba02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -684,7 +684,7 @@ jobs: show-progress: false - name: docker-config - uses: containerbase/internal-tools@6a3ee2b64874b17e9ce3e4a6c84257abd2ece9cc # v3.5.1 + uses: containerbase/internal-tools@e386c8e7bd305d803e0874abccbe153ec1d33a6d # v3.5.2 with: command: docker-config From 97a10701d2102490ffec1ac0230bd2685d397ba9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 21:43:46 +0100 Subject: [PATCH 16/29] chore(deps): update davidanson/markdownlint-cli2-action action to v18 (#32684) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bea40c4a13ba02..3e955e652abb63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -304,7 +304,7 @@ jobs: os: ${{ runner.os }} - name: Lint markdown - uses: DavidAnson/markdownlint-cli2-action@db43aef879112c3119a410d69f66701e0d530809 # v17.0.0 + uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0 - name: Lint fenced code blocks run: pnpm doc-fence-check From bed57fb00f0fc13092b3cac2a838a1d0288add34 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 22:39:39 +0000 Subject: [PATCH 17/29] chore(deps): update ghcr.io/containerbase/devcontainer docker tag to v13.0.22 (#32759) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a5f27891c1540e..ab5360e49e39cd 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1 +1 @@ -FROM ghcr.io/containerbase/devcontainer:13.0.21 +FROM ghcr.io/containerbase/devcontainer:13.0.22 From b818b6bf61144a9948576b71b611be4ebc286773 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 01:24:08 +0000 Subject: [PATCH 18/29] fix(deps): update ghcr.io/containerbase/sidecar docker tag to v13.0.22 (#32761) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- lib/config/options/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 0575942785574a..712dc338a3b93f 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -515,7 +515,7 @@ const options: RenovateOptions[] = [ description: 'Change this value to override the default Renovate sidecar image.', type: 'string', - default: 'ghcr.io/containerbase/sidecar:13.0.21', + default: 'ghcr.io/containerbase/sidecar:13.0.22', globalOnly: true, }, { From c745186e2dde520f2b1a4ab0e2ffdc88fb90fd5e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 01:30:20 +0000 Subject: [PATCH 19/29] chore(deps): update pnpm to v9.14.1 (#32762) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b1ac3be2725374..f5305ab427edbd 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ }, "volta": { "node": "22.11.0", - "pnpm": "9.13.2" + "pnpm": "9.14.1" }, "dependencies": { "@aws-sdk/client-codecommit": "3.687.0", @@ -351,7 +351,7 @@ "typescript": "5.6.3", "unified": "9.2.2" }, - "packageManager": "pnpm@9.13.2", + "packageManager": "pnpm@9.14.1", "files": [ "dist", "renovate-schema.json" From 8041e7ea18cf536363e3ec410ba797678a433372 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 03:13:57 +0000 Subject: [PATCH 20/29] fix(deps): update ghcr.io/renovatebot/base-image docker tag to v9.11.2 (#32763) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- tools/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index a75f77f0555ec3..119be09c83dff2 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -5,19 +5,19 @@ ARG BASE_IMAGE_TYPE=slim # -------------------------------------- # slim image # -------------------------------------- -FROM ghcr.io/renovatebot/base-image:9.11.1@sha256:5915b4b235fd25e8b9175ff4869e559e9a2caa3154cb3d8e0c31426603c159e0 AS slim-base +FROM ghcr.io/renovatebot/base-image:9.11.2@sha256:89eacab8b8a325cab4999dda4546cd781659dd86d1573c4ef9142fa385c87927 AS slim-base # -------------------------------------- # full image # -------------------------------------- -FROM ghcr.io/renovatebot/base-image:9.11.1-full@sha256:39a1e3d5562ca026d2b7df1038e1d790b5f40c158f54f2ddff7ace68de5c86b1 AS full-base +FROM ghcr.io/renovatebot/base-image:9.11.2-full@sha256:675c100b2fca833c952cbfeb3c4d1621107615e38da679f0fd90dfc9e3be3179 AS full-base ENV RENOVATE_BINARY_SOURCE=global # -------------------------------------- # build image # -------------------------------------- -FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:9.11.1@sha256:5915b4b235fd25e8b9175ff4869e559e9a2caa3154cb3d8e0c31426603c159e0 AS build +FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:9.11.2@sha256:89eacab8b8a325cab4999dda4546cd781659dd86d1573c4ef9142fa385c87927 AS build # We want a specific node version here # renovate: datasource=node-version From 231ee54f0e8c2e781b1314354a786e583fe1828b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 03:28:19 +0000 Subject: [PATCH 21/29] chore(deps): update docker/dockerfile docker tag to v1.12.0 (#32764) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- tools/docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 119be09c83dff2..1ce71a4de6c7d7 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -1,4 +1,4 @@ -# syntax=docker/dockerfile:1.11.1@sha256:10c699f1b6c8bdc8f6b4ce8974855dd8542f1768c26eb240237b8f1c9c6c9976 +# syntax=docker/dockerfile:1.12.0@sha256:db1ff77fb637a5955317c7a3a62540196396d565f3dd5742e76dddbb6d75c4c5 ARG BASE_IMAGE_TYPE=slim From c4f4934701263d6b07536083a2cbff35bfb8d3c0 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Wed, 27 Nov 2024 03:54:58 -0500 Subject: [PATCH 22/29] fix(bitbucket): source link root path (#32689) Signed-off-by: Adam Setch --- .../repository/update/pr/body/index.spec.ts | 20 ++++++++++++++++++- .../repository/update/pr/body/index.ts | 18 +++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/lib/workers/repository/update/pr/body/index.spec.ts b/lib/workers/repository/update/pr/body/index.spec.ts index eb5149a2685a1f..0308e4d8c26562 100644 --- a/lib/workers/repository/update/pr/body/index.spec.ts +++ b/lib/workers/repository/update/pr/body/index.spec.ts @@ -89,12 +89,21 @@ describe('workers/repository/update/pr/body/index', () => { homepage: 'https://example.com', }; + const upgradeBitbucket = { + manager: 'some-manager', + branchName: 'some-branch', + sourceUrl: 'https://bitbucket.org/foo/bar', + sourceDirectory: '/baz', + changelogUrl: 'https://bitbucket.org/foo/bar/src/main/CHANGELOG.md', + homepage: 'https://example.com', + }; + getPrBody( { manager: 'some-manager', baseBranch: 'base', branchName: 'some-branch', - upgrades: [upgrade, upgrade1], + upgrades: [upgrade, upgrade1, upgradeBitbucket], }, { debugData: { @@ -128,6 +137,15 @@ describe('workers/repository/update/pr/body/index', () => { homepage: 'https://example.com', sourceUrl: 'https://github.com/foo/bar', }); + expect(upgradeBitbucket).toMatchObject({ + branchName: 'some-branch', + depNameLinked: + '[undefined](https://example.com) ([source](https://bitbucket.org/foo/bar/src/HEAD/baz), [changelog](https://bitbucket.org/foo/bar/src/main/CHANGELOG.md))', + references: + '[homepage](https://example.com), [source](https://bitbucket.org/foo/bar/src/HEAD/baz), [changelog](https://bitbucket.org/foo/bar/src/main/CHANGELOG.md)', + homepage: 'https://example.com', + sourceUrl: 'https://bitbucket.org/foo/bar', + }); }); it('uses dependencyUrl as primary link', () => { diff --git a/lib/workers/repository/update/pr/body/index.ts b/lib/workers/repository/update/pr/body/index.ts index 1c1e5d8d1f9e88..984a3ff83b9b48 100644 --- a/lib/workers/repository/update/pr/body/index.ts +++ b/lib/workers/repository/update/pr/body/index.ts @@ -1,6 +1,7 @@ import type { RenovateConfig } from '../../../../../config/types'; import type { PrDebugData } from '../../../../../modules/platform'; import { platform } from '../../../../../modules/platform'; +import { detectPlatform } from '../../../../../util/common'; import { regEx } from '../../../../../util/regex'; import { toBase64 } from '../../../../../util/string'; import * as template from '../../../../../util/template'; @@ -31,12 +32,20 @@ function massageUpdateMetadata(config: BranchConfig): void { depNameLinked = `[${depNameLinked}](${primaryLink})`; } + let sourceRootPath = 'tree'; + if (sourceUrl) { + const sourcePlatform = detectPlatform(sourceUrl); + if (sourcePlatform === 'bitbucket') { + sourceRootPath = 'src'; + } + } + const otherLinks = []; if (sourceUrl && (!!sourceDirectory || homepage)) { otherLinks.push( `[source](${ sourceDirectory - ? joinUrlParts(sourceUrl, 'tree/HEAD/', sourceDirectory) + ? joinUrlParts(sourceUrl, sourceRootPath, 'HEAD', sourceDirectory) : sourceUrl })`, ); @@ -55,7 +64,12 @@ function massageUpdateMetadata(config: BranchConfig): void { if (sourceUrl) { let fullUrl = sourceUrl; if (sourceDirectory) { - fullUrl = joinUrlParts(sourceUrl, 'tree/HEAD/', sourceDirectory); + fullUrl = joinUrlParts( + sourceUrl, + sourceRootPath, + 'HEAD', + sourceDirectory, + ); } references.push(`[source](${fullUrl})`); } From 56f79b972572a9e8586d51b7b7fc85754b693ade Mon Sep 17 00:00:00 2001 From: RahulGautamSingh Date: Wed, 27 Nov 2024 14:25:51 +0530 Subject: [PATCH 23/29] fix(npm): update npmrc before executing corepack cmd (#32733) --- lib/modules/manager/npm/artifacts.spec.ts | 16 ++++- lib/modules/manager/npm/artifacts.ts | 12 +++- lib/modules/manager/npm/post-update/index.ts | 63 +++----------------- lib/modules/manager/npm/utils.ts | 60 +++++++++++++++++++ 4 files changed, 92 insertions(+), 59 deletions(-) diff --git a/lib/modules/manager/npm/artifacts.spec.ts b/lib/modules/manager/npm/artifacts.spec.ts index 7cb52f4dbf3c11..c241b15189df82 100644 --- a/lib/modules/manager/npm/artifacts.spec.ts +++ b/lib/modules/manager/npm/artifacts.spec.ts @@ -9,6 +9,7 @@ import { GlobalConfig } from '../../../config/global'; import type { RepoGlobalConfig } from '../../../config/types'; import * as docker from '../../../util/exec/docker'; import type { UpdateArtifactsConfig, Upgrade } from '../types'; +import * as rules from './post-update/rules'; import { updateArtifacts } from '.'; jest.mock('../../../util/exec/env'); @@ -38,6 +39,8 @@ const validDepUpdate = { } satisfies Upgrade>; describe('modules/manager/npm/artifacts', () => { + const spyProcessHostRules = jest.spyOn(rules, 'processHostRules'); + beforeEach(() => { env.getChildProcessEnv.mockReturnValue({ ...envMock.basic, @@ -46,6 +49,10 @@ describe('modules/manager/npm/artifacts', () => { }); GlobalConfig.set(adminConfig); docker.resetPrefetchedImages(); + spyProcessHostRules.mockReturnValue({ + additionalNpmrcContent: [], + additionalYarnRcYml: undefined, + }); }); it('returns null if no packageManager updates present', async () => { @@ -98,6 +105,7 @@ describe('modules/manager/npm/artifacts', () => { it('returns updated package.json', async () => { fs.readLocalFile + .mockResolvedValueOnce('# dummy') // for npmrc .mockResolvedValueOnce('{}') // for node constraints .mockResolvedValue('some new content'); // for updated package.json const execSnapshots = mockExecAll(); @@ -124,7 +132,9 @@ describe('modules/manager/npm/artifacts', () => { it('supports docker mode', async () => { GlobalConfig.set(dockerAdminConfig); const execSnapshots = mockExecAll(); - fs.readLocalFile.mockResolvedValueOnce('some new content'); + fs.readLocalFile + .mockResolvedValueOnce('# dummy') // for npmrc + .mockResolvedValueOnce('some new content'); const res = await updateArtifacts({ packageFileName: 'package.json', @@ -171,7 +181,9 @@ describe('modules/manager/npm/artifacts', () => { it('supports install mode', async () => { GlobalConfig.set({ ...adminConfig, binarySource: 'install' }); const execSnapshots = mockExecAll(); - fs.readLocalFile.mockResolvedValueOnce('some new content'); + fs.readLocalFile + .mockResolvedValueOnce('# dummy') // for npmrc + .mockResolvedValueOnce('some new content'); const res = await updateArtifacts({ packageFileName: 'package.json', diff --git a/lib/modules/manager/npm/artifacts.ts b/lib/modules/manager/npm/artifacts.ts index 082dc4348821eb..408da129fcc3bb 100644 --- a/lib/modules/manager/npm/artifacts.ts +++ b/lib/modules/manager/npm/artifacts.ts @@ -6,7 +6,13 @@ import { readLocalFile, writeLocalFile } from '../../../util/fs'; import { regEx } from '../../../util/regex'; import type { UpdateArtifact, UpdateArtifactsResult } from '../types'; import { getNodeToolConstraint } from './post-update/node-version'; +import { processHostRules } from './post-update/rules'; import { lazyLoadPackageJson } from './post-update/utils'; +import { + getNpmrcContent, + resetNpmrcContent, + updateNpmrcContent, +} from './utils'; // eg. 8.15.5+sha256.4b4efa12490e5055d59b9b9fc9438b7d581a6b7af3b5675eb5c5f447cee1a589 const versionWithHashRegString = '^(?.*)\\+(?.*)'; @@ -43,6 +49,8 @@ export async function updateArtifacts({ // Asumming that corepack only needs to modify the package.json file in the root folder // As it should not be regular practice to have different package managers in different workspaces const pkgFileDir = upath.dirname(packageFileName); + const { additionalNpmrcContent } = processHostRules(); + const npmrcContent = await getNpmrcContent(pkgFileDir); const lazyPkgJson = lazyLoadPackageJson(pkgFileDir); const cmd = `corepack use ${depName}@${newVersion}`; @@ -66,9 +74,10 @@ export async function updateArtifacts({ userConfiguredEnv: config.env, }; + await updateNpmrcContent(pkgFileDir, npmrcContent, additionalNpmrcContent); try { await exec(cmd, execOptions); - + await resetNpmrcContent(pkgFileDir, npmrcContent); const newPackageFileContent = await readLocalFile(packageFileName, 'utf8'); if ( !newPackageFileContent || @@ -88,6 +97,7 @@ export async function updateArtifacts({ ]; } catch (err) { logger.warn({ err }, 'Error updating package.json'); + await resetNpmrcContent(pkgFileDir, npmrcContent); return [ { artifactError: { diff --git a/lib/modules/manager/npm/post-update/index.ts b/lib/modules/manager/npm/post-update/index.ts index c83a3971443eee..d7f559dc34bb57 100644 --- a/lib/modules/manager/npm/post-update/index.ts +++ b/lib/modules/manager/npm/post-update/index.ts @@ -6,7 +6,6 @@ import { logger } from '../../../../logger'; import { ExternalHostError } from '../../../../types/errors/external-host-error'; import { getChildProcessEnv } from '../../../../util/exec/env'; import { - deleteLocalFile, ensureCacheDir, getSiblingFileName, readLocalFile, @@ -23,7 +22,13 @@ import { scm } from '../../../platform/scm'; import type { PackageFile, PostUpdateConfig, Upgrade } from '../../types'; import { getZeroInstallPaths } from '../extract/yarn'; import type { NpmManagerData } from '../types'; -import { composeLockFile, parseLockFile } from '../utils'; +import { + composeLockFile, + getNpmrcContent, + parseLockFile, + resetNpmrcContent, + updateNpmrcContent, +} from '../utils'; import * as npm from './npm'; import * as pnpm from './pnpm'; import { processHostRules } from './rules'; @@ -245,60 +250,6 @@ export async function writeUpdatedPackageFiles( } } -async function getNpmrcContent(dir: string): Promise { - const npmrcFilePath = upath.join(dir, '.npmrc'); - let originalNpmrcContent: string | null = null; - try { - originalNpmrcContent = await readLocalFile(npmrcFilePath, 'utf8'); - } catch /* istanbul ignore next */ { - originalNpmrcContent = null; - } - if (originalNpmrcContent) { - logger.debug(`npmrc file ${npmrcFilePath} found in repository`); - } - return originalNpmrcContent; -} - -async function updateNpmrcContent( - dir: string, - originalContent: string | null, - additionalLines: string[], -): Promise { - const npmrcFilePath = upath.join(dir, '.npmrc'); - const newNpmrc = originalContent - ? [originalContent, ...additionalLines] - : additionalLines; - try { - const newContent = newNpmrc.join('\n'); - if (newContent !== originalContent) { - logger.debug(`Writing updated .npmrc file to ${npmrcFilePath}`); - await writeLocalFile(npmrcFilePath, `${newContent}\n`); - } - } catch /* istanbul ignore next */ { - logger.warn('Unable to write custom npmrc file'); - } -} - -async function resetNpmrcContent( - dir: string, - originalContent: string | null, -): Promise { - const npmrcFilePath = upath.join(dir, '.npmrc'); - if (originalContent) { - try { - await writeLocalFile(npmrcFilePath, originalContent); - } catch /* istanbul ignore next */ { - logger.warn('Unable to reset npmrc to original contents'); - } - } else { - try { - await deleteLocalFile(npmrcFilePath); - } catch /* istanbul ignore next */ { - logger.warn('Unable to delete custom npmrc'); - } - } -} - // istanbul ignore next async function updateYarnOffline( lockFileDir: string, diff --git a/lib/modules/manager/npm/utils.ts b/lib/modules/manager/npm/utils.ts index 55d757d475bc88..ed58e4b202c10f 100644 --- a/lib/modules/manager/npm/utils.ts +++ b/lib/modules/manager/npm/utils.ts @@ -1,5 +1,11 @@ import detectIndent from 'detect-indent'; +import upath from 'upath'; import { logger } from '../../../logger'; +import { + deleteLocalFile, + readLocalFile, + writeLocalFile, +} from '../../../util/fs'; import type { LockFile, ParseLockFileResult } from './types'; export function parseLockFile(lockFile: string): ParseLockFileResult { @@ -18,3 +24,57 @@ export function parseLockFile(lockFile: string): ParseLockFileResult { export function composeLockFile(lockFile: LockFile, indent: string): string { return JSON.stringify(lockFile, null, indent) + '\n'; } + +export async function getNpmrcContent(dir: string): Promise { + const npmrcFilePath = upath.join(dir, '.npmrc'); + let originalNpmrcContent: string | null = null; + try { + originalNpmrcContent = await readLocalFile(npmrcFilePath, 'utf8'); + } catch /* istanbul ignore next */ { + originalNpmrcContent = null; + } + if (originalNpmrcContent) { + logger.debug(`npmrc file ${npmrcFilePath} found in repository`); + } + return originalNpmrcContent; +} + +export async function updateNpmrcContent( + dir: string, + originalContent: string | null, + additionalLines: string[], +): Promise { + const npmrcFilePath = upath.join(dir, '.npmrc'); + const newNpmrc = originalContent + ? [originalContent, ...additionalLines] + : additionalLines; + try { + const newContent = newNpmrc.join('\n'); + if (newContent !== originalContent) { + logger.debug(`Writing updated .npmrc file to ${npmrcFilePath}`); + await writeLocalFile(npmrcFilePath, `${newContent}\n`); + } + } catch /* istanbul ignore next */ { + logger.warn('Unable to write custom npmrc file'); + } +} + +export async function resetNpmrcContent( + dir: string, + originalContent: string | null, +): Promise { + const npmrcFilePath = upath.join(dir, '.npmrc'); + if (originalContent) { + try { + await writeLocalFile(npmrcFilePath, originalContent); + } catch /* istanbul ignore next */ { + logger.warn('Unable to reset npmrc to original contents'); + } + } else { + try { + await deleteLocalFile(npmrcFilePath); + } catch /* istanbul ignore next */ { + logger.warn('Unable to delete custom npmrc'); + } + } +} From c868ed0634df1005a330884070cd54cf3f934e3e Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 27 Nov 2024 09:57:59 +0100 Subject: [PATCH 24/29] feat(datasource/pypi): always fallback to try simple endpoints (#32024) --- .../pypi/__snapshots__/index.spec.ts.snap | 42 ---------------- lib/modules/datasource/pypi/index.spec.ts | 50 ++++++++++++------- lib/modules/datasource/pypi/index.ts | 6 +-- lib/modules/datasource/pypi/readme.md | 6 +++ 4 files changed, 38 insertions(+), 66 deletions(-) create mode 100644 lib/modules/datasource/pypi/readme.md diff --git a/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap index 1af50f1d6d055b..1704b163844bff 100644 --- a/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/pypi/__snapshots__/index.spec.ts.snap @@ -1,47 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`modules/datasource/pypi/index getReleases fall back from json and process data from simple endpoint 1`] = ` -{ - "registryUrl": "https://custom.pypi.net/foo", - "releases": [ - { - "version": "0.1.2", - }, - { - "version": "0.1.3", - }, - { - "version": "0.1.4", - }, - { - "version": "0.2.0", - }, - { - "version": "0.2.1", - }, - { - "version": "0.2.2", - }, - { - "version": "0.3.0", - }, - { - "version": "0.4.0", - }, - { - "version": "0.4.1", - }, - { - "version": "0.4.2", - }, - { - "isDeprecated": true, - "version": "0.5.0", - }, - ], -} -`; - exports[`modules/datasource/pypi/index getReleases parses data-requires-python and respects constraints from simple endpoint 1`] = ` { "registryUrl": "https://some.registry.org/simple", diff --git a/lib/modules/datasource/pypi/index.spec.ts b/lib/modules/datasource/pypi/index.spec.ts index 678101cfa03c30..295a78c241b4ae 100644 --- a/lib/modules/datasource/pypi/index.spec.ts +++ b/lib/modules/datasource/pypi/index.spec.ts @@ -160,6 +160,10 @@ describe('modules/datasource/pypi/index', () => { .scope('https://custom.pypi.net/foo') .get('/azure-cli-monitor/json') .replyWithError('error'); + httpMock + .scope('https://custom.pypi.net/foo') + .get('/azure-cli-monitor/') + .replyWithError('error'); httpMock .scope('https://second-index/foo') .get('/azure-cli-monitor/json') @@ -308,6 +312,11 @@ describe('modules/datasource/pypi/index', () => { .get('/not-normalized-package/json') .reply(200, htmlResponse); + httpMock + .scope(baseUrl) + .get('/not-normalized-package/') + .reply(200, htmlResponse); + await getPkgReleases({ datasource, registryUrls: [baseUrl], @@ -716,25 +725,28 @@ describe('modules/datasource/pypi/index', () => { ).toBeNull(); }); - it('fall back from json and process data from simple endpoint', async () => { - httpMock - .scope('https://custom.pypi.net/foo') - .get('/dj-database-url/json') - .reply(404); - httpMock - .scope('https://custom.pypi.net/foo') - .get('/dj-database-url/') - .reply(200, htmlResponse); - const config = { - registryUrls: ['https://custom.pypi.net/foo'], - }; - const result = await getPkgReleases({ - datasource, - ...config, - packageName: 'dj-database-url', - }); - expect(result).toMatchSnapshot(); - }); + it.each([404, 403])( + 'fall back from json and process data from simple endpoint', + async (code: number) => { + httpMock + .scope('https://custom.pypi.net/foo') + .get('/dj-database-url/json') + .reply(code); + httpMock + .scope('https://custom.pypi.net/foo') + .get('/dj-database-url/') + .reply(200, htmlResponse); + const config = { + registryUrls: ['https://custom.pypi.net/foo'], + }; + const result = await getPkgReleases({ + datasource, + ...config, + packageName: 'dj-database-url', + }); + expect(result).not.toBeNull(); + }, + ); it('parses data-requires-python and respects constraints from simple endpoint', async () => { httpMock diff --git a/lib/modules/datasource/pypi/index.ts b/lib/modules/datasource/pypi/index.ts index dc8a5437dc259e..3e8812116e0555 100644 --- a/lib/modules/datasource/pypi/index.ts +++ b/lib/modules/datasource/pypi/index.ts @@ -66,13 +66,9 @@ export class PypiDatasource extends Datasource { // we need to resolve early here so we can catch any 404s and fallback to a simple lookup dependency = await this.getDependency(normalizedLookupName, hostUrl); } catch (err) { - if (err.statusCode !== 404) { - throw err; - } - // error contacting json-style api -- attempt to fallback to a simple-style api logger.trace( - { packageName, hostUrl }, + { packageName, hostUrl, err }, 'Looking up pypi simple dependency via fallback', ); dependency = await this.getSimpleDependency( diff --git a/lib/modules/datasource/pypi/readme.md b/lib/modules/datasource/pypi/readme.md new file mode 100644 index 00000000000000..ae32c3ca683ef4 --- /dev/null +++ b/lib/modules/datasource/pypi/readme.md @@ -0,0 +1,6 @@ +This datasource uses the following logic to determine lookup URLs: + +- If the normalized registryUrl ends in `/simple/` or `/+simple/` then only the simple API will be tried +- Otherwise, the JSON API will be tried first +- If the JSON API returns a result, it will be used +- If the JSON API throws an error (e.g. 403, 404) then the simple API will be tried From 456765aeacff82756d624fc908b637268b5a5cc2 Mon Sep 17 00:00:00 2001 From: Bas Schoenmaeckers <7943856+bschoenmaeckers@users.noreply.github.com> Date: Wed, 27 Nov 2024 11:44:20 +0100 Subject: [PATCH 25/29] feat(manager/dockerfile): add support for Dockerfile `RUN --mount=from` (#32743) Co-authored-by: Michael Kriese --- .../manager/dockerfile/extract.spec.ts | 34 ++++++++++++++++++ lib/modules/manager/dockerfile/extract.ts | 35 +++++++++++++++++++ lib/modules/manager/dockerfile/readme.md | 11 ++++++ 3 files changed, 80 insertions(+) diff --git a/lib/modules/manager/dockerfile/extract.spec.ts b/lib/modules/manager/dockerfile/extract.spec.ts index a16b0bb40c0008..a2bcdab3feca0e 100644 --- a/lib/modules/manager/dockerfile/extract.spec.ts +++ b/lib/modules/manager/dockerfile/extract.spec.ts @@ -32,6 +32,40 @@ describe('modules/manager/dockerfile/extract', () => { ]); }); + it('handles run --mount=from', () => { + const res = extractPackageFile( + 'FROM scratch as build\n' + + 'FROM scratch as final\n' + + 'RUN --mount=from=ghcr.io/astral-sh/uv,source=/uv,target=/bin/uv uv pip install numpy\n' + + 'RUN --mount=type=cache,from=example.com/cache/image,target=/root/.cache pip install numpy\n' + + 'RUN --mount=type=bind,from=build,source=/project/dist/lib.whl,target=/dist/lib.whl pip install /dist/lib.whl\n', + '', + {}, + )?.deps; + expect(res).toEqual([ + { + autoReplaceStringTemplate: + '{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: undefined, + datasource: 'docker', + depName: 'ghcr.io/astral-sh/uv', + depType: 'stage', + replaceString: 'ghcr.io/astral-sh/uv', + }, + { + autoReplaceStringTemplate: + '{{depName}}{{#if newValue}}:{{newValue}}{{/if}}{{#if newDigest}}@{{newDigest}}{{/if}}', + currentDigest: undefined, + currentValue: undefined, + datasource: 'docker', + depName: 'example.com/cache/image', + depType: 'final', + replaceString: 'example.com/cache/image', + }, + ]); + }); + it('is case insensitive', () => { const res = extractPackageFile('From node\n', '', {})?.deps; expect(res).toEqual([ diff --git a/lib/modules/manager/dockerfile/extract.ts b/lib/modules/manager/dockerfile/extract.ts index 1395dbcc1e57cb..019e7ee86a1653 100644 --- a/lib/modules/manager/dockerfile/extract.ts +++ b/lib/modules/manager/dockerfile/extract.ts @@ -422,6 +422,41 @@ export function extractPackageFile( } } + const runMountFromRegex = regEx( + '^[ \\t]*RUN(?:' + + escapeChar + + '[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n|--[a-z]+(?:=[a-zA-Z0-9_.:-]+?)?)+--mount=(?:\\S*=\\S*,)*from=(?[^, ]+)', + 'im', + ); + const runMountFromMatch = instruction.match(runMountFromRegex); + if (runMountFromMatch?.groups?.image) { + if (stageNames.includes(runMountFromMatch.groups.image)) { + logger.debug( + { image: runMountFromMatch.groups.image }, + 'Skipping alias RUN --mount=from', + ); + } else { + const dep = getDep( + runMountFromMatch.groups.image, + true, + config.registryAliases, + ); + const lineNumberRanges: number[][] = [ + [lineNumberInstrStart, lineNumber], + ]; + processDepForAutoReplace(dep, lineNumberRanges, lines, lineFeed); + logger.debug( + { + depName: dep.depName, + currentValue: dep.currentValue, + currentDigest: dep.currentDigest, + }, + 'Dockerfile RUN --mount=from', + ); + deps.push(dep); + } + } + lineNumber += 1; } diff --git a/lib/modules/manager/dockerfile/readme.md b/lib/modules/manager/dockerfile/readme.md index 8e0a82be56336e..2c1717735242b8 100644 --- a/lib/modules/manager/dockerfile/readme.md +++ b/lib/modules/manager/dockerfile/readme.md @@ -4,6 +4,7 @@ This manager extracts image references in a `Dockerfile` and/or `Containerfile` - [`FROM`](https://docs.docker.com/reference/dockerfile/#from) images - [`COPY --from`](https://docs.docker.com/reference/dockerfile/#copy---from) images +- [`RUN --mount`](https://docs.docker.com/reference/dockerfile/#run---mount) images - [`syntax`](https://docs.docker.com/reference/dockerfile/#syntax) images #### `FROM` support @@ -37,6 +38,16 @@ FROM node:20.9.0 COPY --from alpine:3.19.4 /bin/sh /usr/local/sh ``` +#### `RUN --mount` support + +Images referenced in `RUN --mount` directives are also supported. + +```dockerfile +FROM python:3.12 +RUN --mount=from=ghcr.io/astral-sh/uv:0.5,source=/uv,target=/bin/uv \ + uv venv +``` + #### `syntax` support Renovate can update `syntax` references. From 2adc6756b1aaf8ed7719409eaaa4cbd100eae69a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 13:17:19 +0000 Subject: [PATCH 26/29] chore(deps): update pnpm to v9.14.2 (#32769) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index f5305ab427edbd..1f040f788ca772 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ }, "volta": { "node": "22.11.0", - "pnpm": "9.14.1" + "pnpm": "9.14.2" }, "dependencies": { "@aws-sdk/client-codecommit": "3.687.0", @@ -351,7 +351,7 @@ "typescript": "5.6.3", "unified": "9.2.2" }, - "packageManager": "pnpm@9.14.1", + "packageManager": "pnpm@9.14.2", "files": [ "dist", "renovate-schema.json" From 6729208c44921e6eac8392a72d65018462688d0a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:08:41 +0000 Subject: [PATCH 27/29] fix(deps): update ghcr.io/renovatebot/base-image docker tag to v9.11.3 (#32774) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- tools/docker/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile index 1ce71a4de6c7d7..31edd552097973 100644 --- a/tools/docker/Dockerfile +++ b/tools/docker/Dockerfile @@ -5,19 +5,19 @@ ARG BASE_IMAGE_TYPE=slim # -------------------------------------- # slim image # -------------------------------------- -FROM ghcr.io/renovatebot/base-image:9.11.2@sha256:89eacab8b8a325cab4999dda4546cd781659dd86d1573c4ef9142fa385c87927 AS slim-base +FROM ghcr.io/renovatebot/base-image:9.11.3@sha256:ab2d4b9fccf67319a396dc4de146d8bc2e57e5e152946663ab8160f83125b077 AS slim-base # -------------------------------------- # full image # -------------------------------------- -FROM ghcr.io/renovatebot/base-image:9.11.2-full@sha256:675c100b2fca833c952cbfeb3c4d1621107615e38da679f0fd90dfc9e3be3179 AS full-base +FROM ghcr.io/renovatebot/base-image:9.11.3-full@sha256:2b2dff67edfded6909bcd201d3f561cdd9275c1fe50e844f14b34bc69cbc16af AS full-base ENV RENOVATE_BINARY_SOURCE=global # -------------------------------------- # build image # -------------------------------------- -FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:9.11.2@sha256:89eacab8b8a325cab4999dda4546cd781659dd86d1573c4ef9142fa385c87927 AS build +FROM --platform=$BUILDPLATFORM ghcr.io/renovatebot/base-image:9.11.3@sha256:ab2d4b9fccf67319a396dc4de146d8bc2e57e5e152946663ab8160f83125b077 AS build # We want a specific node version here # renovate: datasource=node-version From 0c03f4180d20e606183a1d49a1d33ac064b6b87f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 22:10:41 +0000 Subject: [PATCH 28/29] build(deps): update dependency @opentelemetry/semantic-conventions to v1.28.0 (#32775) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- package.json | 2 +- pnpm-lock.yaml | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1f040f788ca772..7bbd03a9df8899 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "@opentelemetry/resources": "1.28.0", "@opentelemetry/sdk-trace-base": "1.28.0", "@opentelemetry/sdk-trace-node": "1.28.0", - "@opentelemetry/semantic-conventions": "1.27.0", + "@opentelemetry/semantic-conventions": "1.28.0", "@qnighy/marshal": "0.1.3", "@renovatebot/detect-tools": "1.1.0", "@renovatebot/kbpgp": "4.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 18f00a05d35566..311495b8a7355c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,8 +63,8 @@ importers: specifier: 1.28.0 version: 1.28.0(@opentelemetry/api@1.9.0) '@opentelemetry/semantic-conventions': - specifier: 1.27.0 - version: 1.27.0 + specifier: 1.28.0 + version: 1.28.0 '@qnighy/marshal': specifier: 0.1.3 version: 0.1.3 @@ -1427,6 +1427,10 @@ packages: resolution: {integrity: sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg==} engines: {node: '>=14'} + '@opentelemetry/semantic-conventions@1.28.0': + resolution: {integrity: sha512-lp4qAiMTD4sNWW4DbKLBkfiMZ4jbAboJIGOQr5DvciMRI494OapieI9qiODpOt0XBr1LjIDy1xAGAnVs5supTA==} + engines: {node: '>=14'} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -7848,6 +7852,8 @@ snapshots: '@opentelemetry/semantic-conventions@1.27.0': {} + '@opentelemetry/semantic-conventions@1.28.0': {} + '@pkgjs/parseargs@0.11.0': optional: true From bde18494a45751f0a4c86e7123a79b06e4aaf920 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 04:56:57 +0000 Subject: [PATCH 29/29] chore(deps): update pdm-project/setup-pdm action to v4.2 (#32776) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e955e652abb63..d89c9b97e90038 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -592,7 +592,7 @@ jobs: os: ${{ runner.os }} - name: Setup PDM - uses: pdm-project/setup-pdm@568ddd69406b30de1774ec0044b73ae06e716aa4 # v4.1 + uses: pdm-project/setup-pdm@b2472ca4258a9ea3aee813980a0100a2261a42fc # v4.2 with: python-version-file: .python-version version: ${{ env.PDM_VERSION }}