diff --git a/docs/configuration.md b/docs/configuration.md index a0cd0c6ada79276f476bfcbf39b02d0ad8e9a6a8..3b88e4f0096df7a69fe49985d5b6e6c28c6635b2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -176,7 +176,7 @@ Obviously, you can't set repository or package file location with this method. | `groupBranchName` | Branch name template for the group | string | `"renovate/{{groupSlug}}"` | `RENOVATE_GROUP_BRANCH_NAME` | | | `groupCommitMessage` | Group commit message | string | `"Renovate {{groupName}} packages"` | `RENOVATE_GROUP_COMMIT_MESSAGE` | | | `groupPrTitle` | Pull Request title template for the group | string | `"Renovate {{groupName}} packages"` | `RENOVATE_GROUP_PR_TITLE` | | -| `groupPrBody` | Pull Request body template for the group | string | `"This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package group \"{{groupName}}\".\n\n{{#each upgrades as |upgrade|}}\n- [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}`\n{{/each}}\n\n### Commits\n\n{{#each upgrades as |upgrade|}}\n{{#if upgrade.releases.length}}\n<details>\n<summary>{{upgrade.githubName}}</summary>\n{{#each upgrade.releases as |release|}}\n\n#### {{release.version}}\n{{#each release.commits as |commit|}}\n- [`{{commit.shortSha}}`]({{commit.url}}){{commit.message}}\n{{/each}}\n{{/each}}\n\n</details>\n{{/if}}\n{{/each}}\n\n<br />\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate)."` | `RENOVATE_GROUP_PR_BODY` | | +| `groupPrBody` | Pull Request body template for the group | string | `"This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package group \"{{groupName}}\".\n\n{{#each upgrades as |upgrade|}}\n- [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}`\n{{/each}}\n\n{{#unless isPin}}\n### Commits\n\n{{#each upgrades as |upgrade|}}\n{{#if upgrade.releases.length}}\n<details>\n<summary>{{upgrade.githubName}}</summary>\n{{#each upgrade.releases as |release|}}\n\n#### {{release.version}}\n{{#each release.commits as |commit|}}\n- [`{{commit.shortSha}}`]({{commit.url}}){{commit.message}}\n{{/each}}\n{{/each}}\n\n</details>\n{{/if}}\n{{/each}}\n{{/unless}}\n<br />\n\nThis {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate)."` | `RENOVATE_GROUP_PR_BODY` | | | `labels` | Labels to add to Pull Request | list | `[]` | `RENOVATE_LABELS` | `--labels` | | `assignees` | Assignees for Pull Request | list | `[]` | `RENOVATE_ASSIGNEES` | `--assignees` | | `reviewers` | Requested reviewers for Pull Requests (GitHub only) | list | `[]` | `RENOVATE_REVIEWERS` | `--reviewers` | diff --git a/lib/config/templates/group-pr-body.hbs b/lib/config/templates/group-pr-body.hbs index a8896cb3c47eb8560c9cd75f22d45f0816c6f3fb..5097c99c400048b86e3b0029d0852f609d9049f7 100644 --- a/lib/config/templates/group-pr-body.hbs +++ b/lib/config/templates/group-pr-body.hbs @@ -4,6 +4,7 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package grou - [{{upgrade.depName}}]({{upgrade.repositoryUrl}}): from `{{upgrade.currentVersion}}` to `{{upgrade.newVersion}}` {{/each}} +{{#unless isPin}} ### Commits {{#each upgrades as |upgrade|}} @@ -21,7 +22,7 @@ This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request renovates the package grou </details> {{/if}} {{/each}} - +{{/unless}} <br /> This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](https://keylocation.sg/our-tech/renovate). diff --git a/lib/workers/package/versions.js b/lib/workers/package/versions.js index f6f226a562890a2c59342c80f0b771c6a14e80e9..ff3199801129cd98c0509217d53e0e9308358a6f 100644 --- a/lib/workers/package/versions.js +++ b/lib/workers/package/versions.js @@ -36,6 +36,8 @@ function determineUpgrades(npmDep, config) { automergeEnabled: true, newVersion: maxSatisfying, newVersionMajor: semver.major(maxSatisfying), + groupName: 'Pin Dependencies', + groupPrTitle: '{{groupName}}', }; changeLogFromVersion = maxSatisfying; } @@ -100,10 +102,6 @@ function determineUpgrades(npmDep, config) { } } }); - if (allUpgrades.pin && Object.keys(allUpgrades).length > 1) { - // Remove the pin if we found upgrades - delete allUpgrades.pin; - } // Return only the values - we don't need the keys anymore const upgrades = Object.keys(allUpgrades).map(key => allUpgrades[key]); diff --git a/test/workers/package/__snapshots__/versions.spec.js.snap b/test/workers/package/__snapshots__/versions.spec.js.snap index c69f30ba91042222678cf2d57aec5645ccd04853..f77af0aa6448142e45e5fdb2adcc47f061ca4e24 100644 --- a/test/workers/package/__snapshots__/versions.spec.js.snap +++ b/test/workers/package/__snapshots__/versions.spec.js.snap @@ -2,6 +2,15 @@ exports[`workers/package/versions .determineUpgrades(npmDep, config) disables major release separation (major) 1`] = ` Array [ + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, Object { "automergeEnabled": false, "changeLogFromVersion": "0.4.4", @@ -39,6 +48,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "major", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.9.7", + "newVersionMajor": 0, + "upgradeType": "pin", + }, ] `; @@ -46,6 +64,8 @@ exports[`workers/package/versions .determineUpgrades(npmDep, config) pins minor Array [ Object { "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", "isPin": true, "newVersion": "1.4.1", "newVersionMajor": 1, @@ -74,11 +94,29 @@ Array [ "newVersionMajor": 1, "upgradeType": "major", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, ] `; exports[`workers/package/versions .determineUpgrades(npmDep, config) returns only one update if automerging any 1`] = ` Array [ + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, Object { "automergeEnabled": true, "changeLogFromVersion": "0.4.4", @@ -93,6 +131,15 @@ Array [ exports[`workers/package/versions .determineUpgrades(npmDep, config) returns only one update if grouping 1`] = ` Array [ + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, Object { "automergeEnabled": false, "changeLogFromVersion": "0.4.4", @@ -152,6 +199,8 @@ exports[`workers/package/versions .determineUpgrades(npmDep, config) supports fu Array [ Object { "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", "isPin": true, "newVersion": "2.0.3", "newVersionMajor": 2, @@ -194,6 +243,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "major", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, ] `; @@ -217,6 +275,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "major", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "0.4.4", + "newVersionMajor": 0, + "upgradeType": "pin", + }, ] `; @@ -246,6 +313,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "minor", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "1.3.0", + "newVersionMajor": 1, + "upgradeType": "pin", + }, ] `; @@ -300,6 +376,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "minor", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "1.0.1", + "newVersionMajor": 1, + "upgradeType": "pin", + }, ] `; @@ -394,6 +479,15 @@ Array [ "newVersionMajor": 1, "upgradeType": "minor", }, + Object { + "automergeEnabled": true, + "groupName": "Pin Dependencies", + "groupPrTitle": "{{groupName}}", + "isPin": true, + "newVersion": "1.3.0", + "newVersionMajor": 1, + "upgradeType": "pin", + }, ] `;