From 080ab8ed9482b0f488614c73aa1e53290baecbf8 Mon Sep 17 00:00:00 2001 From: MaronHatoum <98313426+MaronHatoum@users.noreply.github.com> Date: Thu, 31 Mar 2022 13:43:47 +0300 Subject: [PATCH] fix: PR body comment for pinning is wrong/outdated (#14870) --- .../repository/update/pr/__snapshots__/index.spec.ts.snap | 2 +- lib/workers/repository/update/pr/body/notes.ts | 2 +- lib/workers/repository/update/pr/index.spec.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/workers/repository/update/pr/__snapshots__/index.spec.ts.snap b/lib/workers/repository/update/pr/__snapshots__/index.spec.ts.snap index 38e323cae1..8453638980 100644 --- a/lib/workers/repository/update/pr/__snapshots__/index.spec.ts.snap +++ b/lib/workers/repository/update/pr/__snapshots__/index.spec.ts.snap @@ -64,7 +64,7 @@ Array [ "gitLabIgnoreApprovals": false, "usePlatformAutomerge": false, }, - "prBody": "This PR contains the following updates:\\n\\n| Package | Type | Update | Change |\\n|---|---|---|---|\\n| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | pin | \`1.0.0\` -> \`1.1.0\` |\\n\\n📌 **Important**: Renovate will wait until you have merged this Pin PR before creating any *upgrade* PRs for the affected packages. Add the preset \`:preserveSemverRanges\` to your config if you instead don't wish to pin dependencies.\\n\\n---\\n\\n### Release Notes\\n\\n<details>\\n<summary>renovateapp/dummy</summary>\\n\\n### [\`v1.1.0\`](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n[Compare Source](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n</details>\\n\\n---\\n\\n### Configuration\\n\\n📅 **Schedule**: \\"before 5am\\" in timezone some timezone.\\n\\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\\n\\n♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.\\n\\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\\n\\n---\\n\\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.\\n\\n---\\n\\nThis PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).", + "prBody": "This PR contains the following updates:\\n\\n| Package | Type | Update | Change |\\n|---|---|---|---|\\n| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | pin | \`1.0.0\` -> \`1.1.0\` |\\n\\nAdd the preset \`:preserveSemverRanges\` to your config if you don't want to pin your dependencies.\\n\\n---\\n\\n### Release Notes\\n\\n<details>\\n<summary>renovateapp/dummy</summary>\\n\\n### [\`v1.1.0\`](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n[Compare Source](https://github.com/renovateapp/dummy/compare/v1.0.0...v1.1.0)\\n\\n</details>\\n\\n---\\n\\n### Configuration\\n\\n📅 **Schedule**: \\"before 5am\\" in timezone some timezone.\\n\\n🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.\\n\\n♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.\\n\\n🔕 **Ignore**: Close this PR and you won't be reminded about this update again.\\n\\n---\\n\\n - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.\\n\\n---\\n\\nThis PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).", "prTitle": "Update dependency dummy to v1.1.0", "sourceBranch": "renovate/dummy-1.x", "targetBranch": undefined, diff --git a/lib/workers/repository/update/pr/body/notes.ts b/lib/workers/repository/update/pr/body/notes.ts index c6ea1da919..13be403bd5 100644 --- a/lib/workers/repository/update/pr/body/notes.ts +++ b/lib/workers/repository/update/pr/body/notes.ts @@ -40,7 +40,7 @@ export function getPrExtraNotes(config: BranchConfig): string { if (config.isPin) { res += emojify( - `:pushpin: **Important**: Renovate will wait until you have merged this Pin PR before creating any *upgrade* PRs for the affected packages. Add the preset \`:preserveSemverRanges\` to your config if you instead don't wish to pin dependencies.\n\n` + `Add the preset \`:preserveSemverRanges\` to your config if you don't want to pin your dependencies.\n\n` ); } diff --git a/lib/workers/repository/update/pr/index.spec.ts b/lib/workers/repository/update/pr/index.spec.ts index 1feb542168..5af672a84e 100644 --- a/lib/workers/repository/update/pr/index.spec.ts +++ b/lib/workers/repository/update/pr/index.spec.ts @@ -474,9 +474,10 @@ describe('workers/repository/update/pr/index', () => { }, ]); expect(platform.createPr.mock.calls[0][0].prBody).toContain( - 'this Pin PR' + "you don't want to pin your dependencies" ); }); + it('should return null if creating PR fails', async () => { platform.getBranchStatus.mockResolvedValueOnce(BranchStatus.green); platform.createPr.mockImplementationOnce(() => { -- GitLab