From 7c17c666f41c8ee1d3559b95d3d6924abf0992e4 Mon Sep 17 00:00:00 2001 From: Rhys Arkins <rhys@keylocation.sg> Date: Wed, 11 Oct 2017 10:31:08 +0200 Subject: [PATCH] fix: better pin description in oboarding --- lib/workers/package/docker.js | 1 + lib/workers/repository/onboarding.js | 6 +++++- .../repository/__snapshots__/onboarding.spec.js.snap | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/workers/package/docker.js b/lib/workers/package/docker.js index fb1e070a85..d8f71989e2 100644 --- a/lib/workers/package/docker.js +++ b/lib/workers/package/docker.js @@ -16,6 +16,7 @@ async function renovateDockerImage(config) { const upgrade = {}; upgrade.newTag = config.currentTag; upgrade.newDigest = newDigest; + upgrade.newVersion = newDigest; upgrade.newFrom = config.depName; if (upgrade.newTag) { upgrade.newFrom += `:${upgrade.newTag}`; diff --git a/lib/workers/repository/onboarding.js b/lib/workers/repository/onboarding.js index 1f6fe79b88..b1e4eb6096 100644 --- a/lib/workers/repository/onboarding.js +++ b/lib/workers/repository/onboarding.js @@ -178,7 +178,11 @@ With your current configuration, renovate will initially create the following Pu } else { prDesc += upgrade.depName.replace(prTitleRe, '@​$1'); } - prDesc += ` in \`${upgrade.depType}\` from \`${upgrade.currentVersion}\` to \`${upgrade.newVersion}\``; + prDesc += ` in \`${upgrade.depType}\` `; + if (!upgrade.isPin) { + prDesc += `from \`${upgrade.currentVersion}\` `; + } + prDesc += `to \`${upgrade.newVersion}\``; prDesc += '</li>'; } }); diff --git a/test/workers/repository/__snapshots__/onboarding.spec.js.snap b/test/workers/repository/__snapshots__/onboarding.spec.js.snap index 828928076a..7abacae5ae 100644 --- a/test/workers/repository/__snapshots__/onboarding.spec.js.snap +++ b/test/workers/repository/__snapshots__/onboarding.spec.js.snap @@ -18,7 +18,7 @@ With your current configuration, renovate will initially create the following Pu | Pull Requests (2) | | ------ | -| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` from \`^1.0.0\` to \`1.1.0\`</li></ul> | +| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` to \`1.1.0\`</li></ul> | | **Upgrade b**<ul><li>Schedule: \\"on monday\\"</li><li>Branch name: \`branch-b\`</li><li>Upgrades b in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | @@ -202,7 +202,7 @@ With your current configuration, renovate will initially create the following Pu | Pull Requests (2) | | ------ | -| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` from \`^1.0.0\` to \`1.1.0\`</li></ul> | +| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` to \`1.1.0\`</li></ul> | | **Upgrade b**<ul><li>Branch name: \`branch-b\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | @@ -243,7 +243,7 @@ With your current configuration, renovate will initially create the following Pu | Pull Requests (1) | | ------ | -| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` from \`^1.0.0\` to \`1.1.0\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | +| **Pin a**<ul><li>Branch name: \`branch-a\`</li><li>Pins [a](https://a) in \`undefined\` to \`1.1.0\`</li><li>Upgrades [b](https://b) in \`undefined\` from \`1.0.0\` to \`2.0.0\`</li></ul> | Sometimes you may see multiple options for the same dependency (e.g. pinning in one branch and upgrading in another). This is expected and allows you the flexibility to choose which to merge first. Once you merge any PR, others will be updated or removed the next time Renovate runs. -- GitLab