From 953341b927b5b5e3ac244960a6a09f2c0038141f Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:38:11 +0800 Subject: [PATCH 01/26] update docs --- docs/usage/configuration-options.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 754a53e2b98191..6500c7e3071fd3 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3528,6 +3528,12 @@ Configure this to `true` if you wish to get one PR for every separate major vers e.g. if you are on webpack@v1 currently then default behavior is a PR for upgrading to webpack@v3 and not for webpack@v2. If this setting is true then you would get one PR for webpack@v2 and one for webpack@v3. +## separateMultipleMinor + +Configure this to `true` if you wish to get one PR for every separate minor version upgrade of a dependency. +e.g. if you are on webpack@v3.0.0 currently then default behavior is a PR for upgrading to webpack@v3.4.0 and not for webpack@v3.3.0, webpack@v3.2.0 and webpack@v3.1.0 +If this setting is true then you would get one PR for webpack@v3.4.0, webpack@v3.3.0, webpack@v3.2.0 and webpack@v3.1.0 + ## stopUpdatingLabel This feature only works on supported platforms, check the table above. From c15c836f359a1b6d6a8f0c84d82017067bb1241a Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:41:11 +0800 Subject: [PATCH 02/26] support multiple minor pull requests --- lib/config/options/index.ts | 10 +++++++++- lib/config/presets/internal/default.ts | 6 ++++++ lib/config/validation.ts | 1 + lib/util/template/index.ts | 2 ++ .../repository/process/lookup/bucket.ts | 11 +++++++---- .../repository/process/lookup/index.spec.ts | 13 +++++++++++++ .../repository/process/lookup/types.ts | 1 + .../repository/process/lookup/update-type.ts | 1 + .../repository/updates/branch-name.spec.ts | 19 +++++++++++++++++++ 9 files changed, 59 insertions(+), 5 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 42a9d739652297..1d3933237f98bb 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1442,6 +1442,14 @@ const options: RenovateOptions[] = [ type: 'boolean', default: false, }, + { + name: 'separateMultipleMinor', + description: + 'If set to `true`, PRs will be raised separately for each available `minor` upgrade version.', + stage: 'package', + type: 'boolean', + default: false, + }, { name: 'separateMinorPatch', description: @@ -1882,7 +1890,7 @@ const options: RenovateOptions[] = [ description: 'Branch topic.', type: 'string', default: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', cli: false, }, { diff --git a/lib/config/presets/internal/default.ts b/lib/config/presets/internal/default.ts index 26895015eaf6ee..fb158a6343247c 100644 --- a/lib/config/presets/internal/default.ts +++ b/lib/config/presets/internal/default.ts @@ -586,6 +586,12 @@ export const presets: Record = { separateMajorMinor: true, separateMultipleMajor: true, }, + separateMultipleMinorReleases: { + description: + 'Separate each `minor` version of dependencies into individual branches/PRs.', + separateMinorPatch: true, + separateMultipleMinor: true, + }, separatePatchReleases: { description: 'Separate `patch` and `minor` releases of dependencies into separate PRs.', diff --git a/lib/config/validation.ts b/lib/config/validation.ts index d63a47aaaa2cbf..74de7ee6531976 100644 --- a/lib/config/validation.ts +++ b/lib/config/validation.ts @@ -382,6 +382,7 @@ export async function validateConfig( 'separateMajorMinor', 'separateMinorPatch', 'separateMultipleMajor', + 'separateMultipleMinor', 'versioning', ]; if (is.nonEmptyArray(resolvedRule.matchUpdateTypes)) { diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 6af4fbaf6d9315..81c922dd621c52 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -67,6 +67,7 @@ export const exposedConfigOptions = [ 'semanticCommitType', 'separateMajorMinor', 'separateMinorPatch', + 'separateMultipleMinor', ]; export const allowedFields = { @@ -93,6 +94,7 @@ export const allowedFields = { isGroup: 'true if the upgrade is part of a group', isLockfileUpdate: 'true if the branch is a lock file update', isMajor: 'true if the upgrade is major', + isMinor: 'true if the upgrade is minor', isPatch: 'true if the upgrade is a patch upgrade', isPin: 'true if the upgrade is pinning dependencies', isPinDigest: 'true if the upgrade is pinning digests', diff --git a/lib/workers/repository/process/lookup/bucket.ts b/lib/workers/repository/process/lookup/bucket.ts index ba12098d001249..f5fcb125614b19 100644 --- a/lib/workers/repository/process/lookup/bucket.ts +++ b/lib/workers/repository/process/lookup/bucket.ts @@ -3,6 +3,7 @@ import type { VersioningApi } from '../../../../modules/versioning/types'; export interface BucketConfig { separateMajorMinor?: boolean; separateMultipleMajor?: boolean; + separateMultipleMinor?: boolean; separateMinorPatch?: boolean; } @@ -12,8 +13,12 @@ export function getBucket( newVersion: string, versioning: VersioningApi ): string | null { - const { separateMajorMinor, separateMultipleMajor, separateMinorPatch } = - config; + const { + separateMajorMinor, + separateMultipleMajor, + separateMultipleMinor, + separateMinorPatch, + } = config; if (!separateMajorMinor) { return 'latest'; } @@ -46,11 +51,9 @@ export function getBucket( // Check the minor update type first if (fromMinor !== toMinor) { - /* future option if (separateMultipleMinor) { return `v${toMajor}.${toMinor}`; } - */ if (separateMinorPatch) { return 'minor'; diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index a79a33241a0c23..ff65d55473f73d 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -1384,6 +1384,19 @@ describe('workers/repository/process/lookup/index', () => { expect(res.updates).toHaveLength(3); }); + it('should upgrade to 16 minors', async () => { + config.currentValue = '1.0.0'; + config.separateMultipleMinor = true; + config.packageName = 'webpack'; + config.datasource = NpmDatasource.id; + httpMock + .scope('https://registry.npmjs.org') + .get('/webpack') + .reply(200, webpackJson); + const res = await lookup.lookupUpdates(config); + expect(res.updates).toHaveLength(16); + }); + it('does not jump major unstable', async () => { config.currentValue = '^4.4.0-canary.3'; config.rangeStrategy = 'replace'; diff --git a/lib/workers/repository/process/lookup/types.ts b/lib/workers/repository/process/lookup/types.ts index 3b5551f7e2a198..91834ff9a76e82 100644 --- a/lib/workers/repository/process/lookup/types.ts +++ b/lib/workers/repository/process/lookup/types.ts @@ -41,6 +41,7 @@ export interface LookupUpdateConfig isVulnerabilityAlert?: boolean; separateMajorMinor?: boolean; separateMultipleMajor?: boolean; + separateMultipleMinor?: boolean; datasource: string; packageName: string; minimumConfidence?: MergeConfidence | undefined; diff --git a/lib/workers/repository/process/lookup/update-type.ts b/lib/workers/repository/process/lookup/update-type.ts index 4da91f3e338ffa..9f4fad54b8e9ed 100644 --- a/lib/workers/repository/process/lookup/update-type.ts +++ b/lib/workers/repository/process/lookup/update-type.ts @@ -4,6 +4,7 @@ import type * as allVersioning from '../../../../modules/versioning'; export interface UpdateTypeConfig { separateMajorMinor?: boolean; separateMultipleMajor?: boolean; + separateMultipleMinor?: boolean; separateMinorPatch?: boolean; } diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index 07c368946e8afc..2baff0a3e0d74d 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -44,6 +44,25 @@ describe('workers/repository/updates/branch-name', () => { generateBranchName(upgrade); expect(upgrade.branchName).toBe('major-2-some-group-slug-grouptopic'); }); + it('separates minor when separateMultipleMinor=true', () => { + const upgrade: RenovateConfig = { + branchName: + '{{{branchPrefix}}}{{{additionalBranchPrefix}}}{{{branchTopic}}}', + branchPrefix: 'renovate/', + additionalBranchPrefix: '', + depNameSanitized: 'lodash', + newMajor: 4, + separateMinorPatch: true, + isPatch: true, + newMinor: 17, + branchTopic: + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', + depName: 'dep', + group: {}, + }; + generateBranchName(upgrade); + expect(upgrade.branchName).toBe('renovate/lodash-4.17.x'); + }); it('uses single major with groups', () => { const upgrade: RenovateConfig = { From b152f12ed152a5aa473e1848fcc1bf0e71466f4c Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:41:21 +0800 Subject: [PATCH 03/26] support group --- .../repository/updates/branch-name.spec.ts | 21 +++++++++++++++++-- lib/workers/repository/updates/branch-name.ts | 4 ++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index 2baff0a3e0d74d..d7ad0b77a2d77c 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -44,6 +44,23 @@ describe('workers/repository/updates/branch-name', () => { generateBranchName(upgrade); expect(upgrade.branchName).toBe('major-2-some-group-slug-grouptopic'); }); + + it('separates minor with groups', () => { + const upgrade: RenovateConfig = { + groupName: 'some group name', + groupSlug: 'some group slug', + updateType: 'minor', + separateMultipleMinor: true, + newMinor: 2.1, + group: { + branchName: '{{groupSlug}}-{{branchTopic}}', + branchTopic: 'grouptopic', + }, + }; + generateBranchName(upgrade); + expect(upgrade.branchName).toBe('minor-2.1-some-group-slug-grouptopic'); + }); + it('separates minor when separateMultipleMinor=true', () => { const upgrade: RenovateConfig = { branchName: @@ -122,7 +139,7 @@ describe('workers/repository/updates/branch-name', () => { isPatch: true, newMinor: 17, branchTopic: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', depName: 'dep', group: {}, }; @@ -142,7 +159,7 @@ describe('workers/repository/updates/branch-name', () => { isPatch: true, newMinor: 17, branchTopic: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', depName: 'dep', group: {}, }; diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index a41e1051aa7d65..75e78dab47427d 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -64,6 +64,10 @@ export function generateBranchName(update: RenovateConfig): void { update.groupSlug = `major-${update.groupSlug}`; } } + if (update.updateType === 'minor' && update.separateMultipleMinor) { + const newMinor = String(update.newMinor); + update.groupSlug = `minor-${newMinor}-${update.groupSlug}`; + } if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; } From 323a247c0cc5015bb8b94140a21182cd3de0e3dc Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:23:26 +0800 Subject: [PATCH 04/26] update the branch name via replace on .x instead --- lib/config/options/index.ts | 2 +- lib/util/template/index.ts | 2 -- lib/workers/repository/updates/branch-name.ts | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 1d3933237f98bb..44545f1c39ec55 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1890,7 +1890,7 @@ const options: RenovateOptions[] = [ description: 'Branch topic.', type: 'string', default: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', cli: false, }, { diff --git a/lib/util/template/index.ts b/lib/util/template/index.ts index 81c922dd621c52..6af4fbaf6d9315 100644 --- a/lib/util/template/index.ts +++ b/lib/util/template/index.ts @@ -67,7 +67,6 @@ export const exposedConfigOptions = [ 'semanticCommitType', 'separateMajorMinor', 'separateMinorPatch', - 'separateMultipleMinor', ]; export const allowedFields = { @@ -94,7 +93,6 @@ export const allowedFields = { isGroup: 'true if the upgrade is part of a group', isLockfileUpdate: 'true if the branch is a lock file update', isMajor: 'true if the upgrade is major', - isMinor: 'true if the upgrade is minor', isPatch: 'true if the upgrade is a patch upgrade', isPin: 'true if the upgrade is pinning dependencies', isPinDigest: 'true if the upgrade is pinning digests', diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index 75e78dab47427d..dcec16ff22e588 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -114,7 +114,11 @@ export function generateBranchName(update: RenovateConfig): void { update.branchName = template.compile(update.branchName, update); update.branchName = template.compile(update.branchName, update); } - + if (update.updateType === 'minor' && update.separateMultipleMinor) { + const newMinor = String(update.newMinor); + update.branchName = update.branchName.replace('.x', `.${newMinor}.x`); + logger.info(update.branchName); + } update.branchName = cleanBranchName( update.branchName, update.branchNameStrict From f672f8f03a2b69a1097b681ceebf0f5bb71d7869 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 27 Sep 2023 10:08:08 +0200 Subject: [PATCH 05/26] Update lib/config/options/index.ts --- lib/config/options/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 44545f1c39ec55..5665e710614015 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1449,6 +1449,7 @@ const options: RenovateOptions[] = [ stage: 'package', type: 'boolean', default: false, + experimental: true, }, { name: 'separateMinorPatch', From ed3d00c4fa7276c0445053daa1f2b9dc3c6792e6 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 27 Sep 2023 12:41:13 +0200 Subject: [PATCH 06/26] Update lib/workers/repository/updates/branch-name.ts --- lib/workers/repository/updates/branch-name.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index dcec16ff22e588..3059e7475388b5 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -117,7 +117,6 @@ export function generateBranchName(update: RenovateConfig): void { if (update.updateType === 'minor' && update.separateMultipleMinor) { const newMinor = String(update.newMinor); update.branchName = update.branchName.replace('.x', `.${newMinor}.x`); - logger.info(update.branchName); } update.branchName = cleanBranchName( update.branchName, From bf4c026143e33976cdc916474ca1d7df5e769d68 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Thu, 28 Sep 2023 13:42:42 +0200 Subject: [PATCH 07/26] Update docs/usage/configuration-options.md --- docs/usage/configuration-options.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 06aef3a3a38637..186ae9ab54d9cd 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3541,9 +3541,10 @@ If this setting is true then you would get one PR for webpack@v2 and one for web ## separateMultipleMinor -Configure this to `true` if you wish to get one PR for every separate minor version upgrade of a dependency. -e.g. if you are on webpack@v3.0.0 currently then default behavior is a PR for upgrading to webpack@v3.4.0 and not for webpack@v3.3.0, webpack@v3.2.0 and webpack@v3.1.0 -If this setting is true then you would get one PR for webpack@v3.4.0, webpack@v3.3.0, webpack@v3.2.0 and webpack@v3.1.0 +Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). + +e.g. if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to python@v3.11.0 and not for python@v3.10.0. +If this setting is true then you would get separate PRs for python@3.9.x, python@v3.10.x, python@v3.11.x ## stopUpdatingLabel From cc4c600ac98f0c2e01afdb01373e79de6bc10cc0 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Thu, 28 Sep 2023 13:45:14 +0200 Subject: [PATCH 08/26] Apply suggestions from code review --- docs/usage/configuration-options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 186ae9ab54d9cd..045fb529cc66bf 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3543,8 +3543,8 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). -e.g. if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to python@v3.11.0 and not for python@v3.10.0. -If this setting is true then you would get separate PRs for python@3.9.x, python@v3.10.x, python@v3.11.x +e.g. if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to `python@v3.11.x` and not for `python@v3.10.x`. +If this setting is true then you would get separate PRs for `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`. ## stopUpdatingLabel From 66a3fb69750f5d7ec79c5bd932cdb66a1301ec84 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:24:02 +0800 Subject: [PATCH 09/26] Update lib/workers/repository/updates/branch-name.spec.ts --- lib/workers/repository/updates/branch-name.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index d7ad0b77a2d77c..129d2d0a980c89 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -139,7 +139,7 @@ describe('workers/repository/updates/branch-name', () => { isPatch: true, newMinor: 17, branchTopic: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', depName: 'dep', group: {}, }; From b2c0217c2cd20ee8ebf41a81e9e7421415d1d976 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:24:09 +0800 Subject: [PATCH 10/26] Update lib/workers/repository/updates/branch-name.spec.ts --- lib/workers/repository/updates/branch-name.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index 129d2d0a980c89..d7bd070be008e8 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -159,7 +159,7 @@ describe('workers/repository/updates/branch-name', () => { isPatch: true, newMinor: 17, branchTopic: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', depName: 'dep', group: {}, }; From 43c12d2a3feed1afeb4b449ae1f593624bf305d9 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:24:18 +0800 Subject: [PATCH 11/26] Update lib/workers/repository/updates/branch-name.spec.ts --- lib/workers/repository/updates/branch-name.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index d7bd070be008e8..3bf86219f43841 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -73,7 +73,7 @@ describe('workers/repository/updates/branch-name', () => { isPatch: true, newMinor: 17, branchTopic: - '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMultipleMinor}}{{#if isMinor}}.{{{newMinor}}}{{/if}}{{else}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}{{/if}}', + '{{{depNameSanitized}}}-{{{newMajor}}}{{#if separateMinorPatch}}{{#if isPatch}}.{{{newMinor}}}{{/if}}{{/if}}.x{{#if isLockfileUpdate}}-lockfile{{/if}}', depName: 'dep', group: {}, }; From b9e79d59fcdfa6e4fab6f73405e9bba3596cdd11 Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Thu, 5 Oct 2023 17:34:54 +0800 Subject: [PATCH 12/26] lint --- docs/usage/configuration-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index b6afbaa4a1280f..a469b22990b8a1 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3553,7 +3553,7 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). e.g. if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to `python@v3.11.x` and not for `python@v3.10.x`. -If this setting is true then you would get separate PRs for `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`. +If this setting is true then you would get separate PRs for `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`. ## stopUpdatingLabel From f5c78da886a309c5e85a6ef2bfbf10f4aab57181 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 6 Oct 2023 10:06:06 +0800 Subject: [PATCH 13/26] Update lib/config/presets/internal/default.ts --- lib/config/presets/internal/default.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/config/presets/internal/default.ts b/lib/config/presets/internal/default.ts index fb158a6343247c..577d977c0eae2d 100644 --- a/lib/config/presets/internal/default.ts +++ b/lib/config/presets/internal/default.ts @@ -589,7 +589,6 @@ export const presets: Record = { separateMultipleMinorReleases: { description: 'Separate each `minor` version of dependencies into individual branches/PRs.', - separateMinorPatch: true, separateMultipleMinor: true, }, separatePatchReleases: { From 45aba590c221a20ccf31ec566310826066df74d2 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:49:57 +0800 Subject: [PATCH 14/26] Update docs/usage/configuration-options.md Co-authored-by: Rhys Arkins --- docs/usage/configuration-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 34b41a11b24e16..e273d137a418ed 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3562,7 +3562,7 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). -e.g. if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to `python@v3.11.x` and not for `python@v3.10.x`. +For example, if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to the latest version such as `python@v3.12.x` and not for `python@v3.10.x`. If this setting is true then you would get separate PRs for `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`. ## stopUpdatingLabel From 0aadc2c30f838f8a18f2597672a51685a247fe0a Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:50:14 +0800 Subject: [PATCH 15/26] Update docs/usage/configuration-options.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Philipp Gölz <32487587+jpgoelz@users.noreply.github.com> --- docs/usage/configuration-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index e273d137a418ed..823909b877831c 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3563,7 +3563,7 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). For example, if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to the latest version such as `python@v3.12.x` and not for `python@v3.10.x`. -If this setting is true then you would get separate PRs for `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`. +If this setting is true then you would get separate PRs for each minor stream, such as `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`, etc. ## stopUpdatingLabel From b5b40f07e73e67ae2d80b134799de3fad5070075 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:50:30 +0800 Subject: [PATCH 16/26] Update lib/config/options/index.ts Co-authored-by: Rhys Arkins --- 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 f7bd5548d02eb4..7ea17970561bd2 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1455,7 +1455,7 @@ const options: RenovateOptions[] = [ { name: 'separateMultipleMinor', description: - 'If set to `true`, PRs will be raised separately for each available `minor` upgrade version.', + 'If set to `true`, PRs will be raised separately for each available `minor` stream.', stage: 'package', type: 'boolean', default: false, From ac0ce96956e0691755b5843208985eb7f38053f6 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:50:54 +0800 Subject: [PATCH 17/26] Update lib/workers/repository/updates/branch-name.ts Co-authored-by: Rhys Arkins --- lib/workers/repository/updates/branch-name.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index 3059e7475388b5..f81308da274105 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -65,8 +65,9 @@ export function generateBranchName(update: RenovateConfig): void { } } if (update.updateType === 'minor' && update.separateMultipleMinor) { + const newMajor = String(update.newMajor); const newMinor = String(update.newMinor); - update.groupSlug = `minor-${newMinor}-${update.groupSlug}`; + update.groupSlug = `minor-${newMajor}.${newMinor}-${update.groupSlug}`; } if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; From a0463f7a1ab0405fdce9d2e73a63f4d2db661252 Mon Sep 17 00:00:00 2001 From: Jack <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 08:51:04 +0800 Subject: [PATCH 18/26] Update docs/usage/configuration-options.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jan Philipp Gölz <32487587+jpgoelz@users.noreply.github.com> --- docs/usage/configuration-options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 823909b877831c..783da132bd4eed 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3560,7 +3560,7 @@ If this setting is true then you would get one PR for webpack@v2 and one for web ## separateMultipleMinor -Enable this for dependencies when it's important to split updates into separate PRs per minor release stream (e.g. `python`). +Enable this for dependencies when it is important to split updates into separate PRs per minor release stream (e.g. `python`). For example, if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to the latest version such as `python@v3.12.x` and not for `python@v3.10.x`. If this setting is true then you would get separate PRs for each minor stream, such as `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`, etc. From af29f338a3a722f69dbe761ab181e08cda7944e4 Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Fri, 27 Oct 2023 16:07:26 +0800 Subject: [PATCH 19/26] fix test --- lib/workers/repository/updates/branch-name.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/workers/repository/updates/branch-name.spec.ts b/lib/workers/repository/updates/branch-name.spec.ts index 3bf86219f43841..23ebcf8691df50 100644 --- a/lib/workers/repository/updates/branch-name.spec.ts +++ b/lib/workers/repository/updates/branch-name.spec.ts @@ -51,7 +51,8 @@ describe('workers/repository/updates/branch-name', () => { groupSlug: 'some group slug', updateType: 'minor', separateMultipleMinor: true, - newMinor: 2.1, + newMinor: 1, + newMajor: 2, group: { branchName: '{{groupSlug}}-{{branchTopic}}', branchTopic: 'grouptopic', From 44bb5718f11cbe9926336d0682a9ce906c427d41 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 10 Nov 2023 22:11:52 +0100 Subject: [PATCH 20/26] Apply suggestions from code review Co-authored-by: Michael Kriese --- lib/workers/repository/updates/branch-name.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index f81308da274105..3d068e3d32296c 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -65,9 +65,7 @@ export function generateBranchName(update: RenovateConfig): void { } } if (update.updateType === 'minor' && update.separateMultipleMinor) { - const newMajor = String(update.newMajor); - const newMinor = String(update.newMinor); - update.groupSlug = `minor-${newMajor}.${newMinor}-${update.groupSlug}`; + update.groupSlug = `minor-${update.newMajor}.${update.newMinor}-${update.groupSlug}`; } if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; @@ -116,8 +114,7 @@ export function generateBranchName(update: RenovateConfig): void { update.branchName = template.compile(update.branchName, update); } if (update.updateType === 'minor' && update.separateMultipleMinor) { - const newMinor = String(update.newMinor); - update.branchName = update.branchName.replace('.x', `.${newMinor}.x`); + update.branchName = update.branchName.replace('.x', `.${update.newMinor}.x`); } update.branchName = cleanBranchName( update.branchName, From e941623753f8f23243e75045b39ec023dba3ea55 Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:27:36 +0800 Subject: [PATCH 21/26] eslint --- lib/workers/repository/updates/branch-name.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index 0f9491a45ff6c8..ddf8992509bc98 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -47,6 +47,8 @@ function cleanBranchName( export function generateBranchName(update: RenovateConfig): void { // Check whether to use a group name + const newMajor = String(update.newMajor); + const newMinor = String(update.newMinor); if (update.groupName) { update.groupName = template.compile(update.groupName, update); logger.trace('Using group branchName template'); @@ -59,14 +61,13 @@ export function generateBranchName(update: RenovateConfig): void { }); if (update.updateType === 'major' && update.separateMajorMinor) { if (update.separateMultipleMajor) { - const newMajor = String(update.newMajor); update.groupSlug = `major-${newMajor}-${update.groupSlug}`; } else { update.groupSlug = `major-${update.groupSlug}`; } } if (update.updateType === 'minor' && update.separateMultipleMinor) { - update.groupSlug = `minor-${update.newMajor}.${update.newMinor}-${update.groupSlug}`; + update.groupSlug = `minor-${newMajor}.${newMinor}-${update.groupSlug}`; } if (update.updateType === 'patch' && update.separateMinorPatch) { update.groupSlug = `patch-${update.groupSlug}`; @@ -115,7 +116,7 @@ export function generateBranchName(update: RenovateConfig): void { update.branchName = template.compile(update.branchName, update); } if (update.updateType === 'minor' && update.separateMultipleMinor) { - update.branchName = update.branchName.replace('.x', `.${update.newMinor}.x`); + update.branchName = update.branchName.replace('.x', `.${newMinor}.x`); } update.branchName = cleanBranchName( update.branchName, From 85695895177e34982937046a22239642599b78c7 Mon Sep 17 00:00:00 2001 From: phyzical <5182053+phyzical@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:28:33 +0800 Subject: [PATCH 22/26] md lint --- docs/usage/configuration-options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index 38621c04f0a65e..ae4d464984f46c 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3652,8 +3652,8 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it is important to split updates into separate PRs per minor release stream (e.g. `python`). For example, if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to the latest version such as `python@v3.12.x` and not for `python@v3.10.x`. -If this setting is true then you would get separate PRs for each minor stream, such as `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`, etc. -======= +If this setting is true then you would get separate PRs for each minor stream, such as `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`, etc + ## statusCheckNames You can customize the name/context of status checks that Renovate adds to commits/branches/PRs. From e11953a8b13bfd9c0ce93334e29170d7c4a9d68d Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 19 Feb 2024 17:16:23 +0100 Subject: [PATCH 23/26] fix test --- lib/workers/repository/process/lookup/index.spec.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 5b12440146a8f0..1704b730097cbf 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -2247,8 +2247,10 @@ describe('workers/repository/process/lookup/index', () => { .scope('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); - const res = await lookup.lookupUpdates(config); - expect(res.updates).toHaveLength(16); + const { updates } = await Result.wrap( + lookup.lookupUpdates(config), + ).unwrapOrThrow(); + expect(updates).toHaveLength(16); }); it('does not jump major unstable', async () => { From b9f17dd61c816e6ba5b1df1371d987b9cb736cbc Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 4 Mar 2024 10:24:38 +0100 Subject: [PATCH 24/26] Apply suggestions from code review Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com> --- docs/usage/configuration-options.md | 6 ++++-- lib/config/options/index.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md index d6b32f9eda59a6..dd77315480db9e 100644 --- a/docs/usage/configuration-options.md +++ b/docs/usage/configuration-options.md @@ -3688,8 +3688,10 @@ If this setting is true then you would get one PR for webpack@v2 and one for web Enable this for dependencies when it is important to split updates into separate PRs per minor release stream (e.g. `python`). -For example, if you are on python@v3.9.0 currently then default behavior is a PR for upgrading to the latest version such as `python@v3.12.x` and not for `python@v3.10.x`. -If this setting is true then you would get separate PRs for each minor stream, such as `python@3.9.x`, `python@v3.10.x`, `python@v3.11.x`, etc +For example, if you are on `python@v3.9.0` currently, then by default Renovate creates a PR to upgrade you to the latest version such as `python@v3.12.x`. +By default, Renovate skips versions in between, like `python@v3.10.x`. + +But if you set `separateMultipleMinor=true` then you get separate PRs for each minor stream, like `python@3.9.x`, `python@v3.10.x` and `python@v3.11.x`, etc. ## statusCheckNames diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts index 6e32b47891a7d3..e44adbc74a800c 100644 --- a/lib/config/options/index.ts +++ b/lib/config/options/index.ts @@ -1516,7 +1516,7 @@ const options: RenovateOptions[] = [ { name: 'separateMultipleMinor', description: - 'If set to `true`, PRs will be raised separately for each available `minor` stream.', + 'If set to `true`, Renovate creates separate PRs for each `minor` stream.', stage: 'package', type: 'boolean', default: false, From 27e9e9faf3a5424d1dfedc242047cd242f2b37ed Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Sat, 16 Mar 2024 10:49:51 +0100 Subject: [PATCH 25/26] Update lib/workers/repository/updates/branch-name.ts --- lib/workers/repository/updates/branch-name.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index ddf8992509bc98..2ba008dcd8423c 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -47,8 +47,8 @@ function cleanBranchName( export function generateBranchName(update: RenovateConfig): void { // Check whether to use a group name - const newMajor = String(update.newMajor); - const newMinor = String(update.newMinor); + const newMajor = `${update.newMajor}`; + const newMinor = `${update.newMinor}`; if (update.groupName) { update.groupName = template.compile(update.groupName, update); logger.trace('Using group branchName template'); From cd315d86eea0a507cc8ea6a6159bb14449127e4c Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Mon, 18 Mar 2024 22:54:26 +0100 Subject: [PATCH 26/26] String --- lib/workers/repository/updates/branch-name.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/updates/branch-name.ts b/lib/workers/repository/updates/branch-name.ts index ac581837cc05b1..bc42966fd0ded7 100644 --- a/lib/workers/repository/updates/branch-name.ts +++ b/lib/workers/repository/updates/branch-name.ts @@ -47,8 +47,8 @@ function cleanBranchName( export function generateBranchName(update: RenovateConfig): void { // Check whether to use a group name - const newMajor = `${update.newMajor}`; - const newMinor = `${update.newMinor}`; + const newMajor = String(update.newMajor); + const newMinor = String(update.newMinor); if (update.groupName) { update.groupName = template.compile(update.groupName, update); logger.trace('Using group branchName template');