diff --git a/lib/config/definitions.js b/lib/config/definitions.js index 6c6822b0f0..ea9ce4641c 100644 --- a/lib/config/definitions.js +++ b/lib/config/definitions.js @@ -1759,7 +1759,7 @@ const options = [ freeChoice: true, mergeable: true, default: { - Package: '{{{depName}}}', + Package: '{{{depNameLinked}}}', Type: '{{{depType}}}', Update: '{{{updateType}}}', 'Current value': '{{{currentValue}}}', @@ -1773,7 +1773,7 @@ const options = [ name: 'prBodyColumns', description: 'List of columns to use in PR bodies', type: 'array', - default: ['Package', 'Type', 'Update', 'Change', 'References'], + default: ['Package', 'Type', 'Update', 'Change'], }, { name: 'prBodyNotes', diff --git a/lib/workers/pr/pr-body.js b/lib/workers/pr/pr-body.js index 0d06b35d6c..179b0e904f 100644 --- a/lib/workers/pr/pr-body.js +++ b/lib/workers/pr/pr-body.js @@ -41,6 +41,22 @@ async function getPrBody(config) { config.upgrades.forEach(upgrade => { /* eslint-disable no-param-reassign */ const { homepage, sourceUrl, sourceDirectory, changelogUrl } = upgrade; + let depNameLinked = upgrade.depName; + const primaryLink = homepage || sourceUrl; + if (primaryLink) { + depNameLinked = `[${depNameLinked}](${primaryLink})`; + } + const otherLinks = []; + if (homepage && sourceUrl) { + otherLinks.push(`[source](${sourceUrl})`); + } + if (changelogUrl) { + otherLinks.push(`[changelog](${changelogUrl})`); + } + if (otherLinks.length) { + depNameLinked += ` (${otherLinks.join(', ')})`; + } + upgrade.depNameLinked = depNameLinked; const references = []; if (homepage) { references.push(`[homepage](${homepage})`); diff --git a/renovate-schema.json b/renovate-schema.json index 831dfa296f..ab064ca59b 100644 --- a/renovate-schema.json +++ b/renovate-schema.json @@ -1206,7 +1206,7 @@ "description": "Table column definitions for use in PR tables", "type": "object", "default": { - "Package": "{{{depName}}}", + "Package": "{{{depNameLinked}}}", "Type": "{{{depType}}}", "Update": "{{{updateType}}}", "Current value": "{{{currentValue}}}", @@ -1219,7 +1219,7 @@ "prBodyColumns": { "description": "List of columns to use in PR bodies", "type": "array", - "default": ["Package", "Type", "Update", "Change", "References"] + "default": ["Package", "Type", "Update", "Change"] }, "prBodyNotes": { "description": "List of additional notes/templates to be included in the Pull Request bodies.", diff --git a/test/workers/pr/__snapshots__/index.spec.js.snap b/test/workers/pr/__snapshots__/index.spec.js.snap index cc8bcc269a..05de881dd5 100644 --- a/test/workers/pr/__snapshots__/index.spec.js.snap +++ b/test/workers/pr/__snapshots__/index.spec.js.snap @@ -30,9 +30,9 @@ Array [ "Update dependency dummy to v1.1.0", "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | pin | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | +| Package | Type | Update | Change | +|---|---|---|---| +| [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\` | :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\` your config if you instead don't wish to pin dependencies. @@ -79,9 +79,9 @@ Array [ "Update dependency dummy to v1.1.0", "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | +| Package | Type | Update | Change | +|---|---|---|---| +| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | --- @@ -126,13 +126,13 @@ Array [ "Update dependency dummy to v1.1.0", "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | lockFileMaintenance | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | -| a | | | \`zzzzzz\` -> \`aaaaaaa\` | | -| b | | pin | \`some_old_value\` -> \`some_new_value\` | | -| c | | | \`\` -> \`\` | | -| d | | lockFileMaintenance | \`\` -> \`\` | | +| Package | Type | Update | Change | +|---|---|---|---| +| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | lockFileMaintenance | \`1.0.0\` -> \`1.1.0\` | +| a | | | \`zzzzzz\` -> \`aaaaaaa\` | +| b | | pin | \`some_old_value\` -> \`some_new_value\` | +| c | | | \`\` -> \`\` | +| d | | lockFileMaintenance | \`\` -> \`\` | note 1 @@ -190,9 +190,9 @@ Array [ "Update dependency dummy to v1.1.0", "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | +| Package | Type | Update | Change | +|---|---|---|---| +| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | --- @@ -235,9 +235,9 @@ exports[`workers/pr ensurePr should return modified existing PR 1`] = ` Object { "body": "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | +| Package | Type | Update | Change | +|---|---|---|---| +| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | --- @@ -277,9 +277,9 @@ exports[`workers/pr ensurePr should return modified existing PR title 1`] = ` Object { "body": "This PR contains the following updates: -| Package | Type | Update | Change | References | -|---|---|---|---|---| -| dummy | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | [homepage](https://dummy.com), [source](https://github.com/renovateapp/dummy/tree/HEAD/packages/a), [changelog](https://github.com/renovateapp/dummy/changelog.md) | +| Package | Type | Update | Change | +|---|---|---|---| +| [dummy](https://dummy.com) ([source](https://github.com/renovateapp/dummy), [changelog](https://github.com/renovateapp/dummy/changelog.md)) | devDependencies | minor | \`1.0.0\` -> \`1.1.0\` | ---