mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
feat(pr): better default PR body columns
Drops References column and embeds links in Package column. Closes #3855
This commit is contained in:
parent
e30e03e263
commit
8fd03d7ae8
4 changed files with 42 additions and 26 deletions
|
@ -1759,7 +1759,7 @@ const options = [
|
||||||
freeChoice: true,
|
freeChoice: true,
|
||||||
mergeable: true,
|
mergeable: true,
|
||||||
default: {
|
default: {
|
||||||
Package: '{{{depName}}}',
|
Package: '{{{depNameLinked}}}',
|
||||||
Type: '{{{depType}}}',
|
Type: '{{{depType}}}',
|
||||||
Update: '{{{updateType}}}',
|
Update: '{{{updateType}}}',
|
||||||
'Current value': '{{{currentValue}}}',
|
'Current value': '{{{currentValue}}}',
|
||||||
|
@ -1773,7 +1773,7 @@ const options = [
|
||||||
name: 'prBodyColumns',
|
name: 'prBodyColumns',
|
||||||
description: 'List of columns to use in PR bodies',
|
description: 'List of columns to use in PR bodies',
|
||||||
type: 'array',
|
type: 'array',
|
||||||
default: ['Package', 'Type', 'Update', 'Change', 'References'],
|
default: ['Package', 'Type', 'Update', 'Change'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'prBodyNotes',
|
name: 'prBodyNotes',
|
||||||
|
|
|
@ -41,6 +41,22 @@ async function getPrBody(config) {
|
||||||
config.upgrades.forEach(upgrade => {
|
config.upgrades.forEach(upgrade => {
|
||||||
/* eslint-disable no-param-reassign */
|
/* eslint-disable no-param-reassign */
|
||||||
const { homepage, sourceUrl, sourceDirectory, changelogUrl } = upgrade;
|
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 = [];
|
const references = [];
|
||||||
if (homepage) {
|
if (homepage) {
|
||||||
references.push(`[homepage](${homepage})`);
|
references.push(`[homepage](${homepage})`);
|
||||||
|
|
|
@ -1206,7 +1206,7 @@
|
||||||
"description": "Table column definitions for use in PR tables",
|
"description": "Table column definitions for use in PR tables",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"default": {
|
"default": {
|
||||||
"Package": "{{{depName}}}",
|
"Package": "{{{depNameLinked}}}",
|
||||||
"Type": "{{{depType}}}",
|
"Type": "{{{depType}}}",
|
||||||
"Update": "{{{updateType}}}",
|
"Update": "{{{updateType}}}",
|
||||||
"Current value": "{{{currentValue}}}",
|
"Current value": "{{{currentValue}}}",
|
||||||
|
@ -1219,7 +1219,7 @@
|
||||||
"prBodyColumns": {
|
"prBodyColumns": {
|
||||||
"description": "List of columns to use in PR bodies",
|
"description": "List of columns to use in PR bodies",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"default": ["Package", "Type", "Update", "Change", "References"]
|
"default": ["Package", "Type", "Update", "Change"]
|
||||||
},
|
},
|
||||||
"prBodyNotes": {
|
"prBodyNotes": {
|
||||||
"description": "List of additional notes/templates to be included in the Pull Request bodies.",
|
"description": "List of additional notes/templates to be included in the Pull Request bodies.",
|
||||||
|
|
|
@ -30,9 +30,9 @@ Array [
|
||||||
"Update dependency dummy to v1.1.0",
|
"Update dependency dummy to v1.1.0",
|
||||||
"This PR contains the following updates:
|
"This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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.
|
: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",
|
"Update dependency dummy to v1.1.0",
|
||||||
"This PR contains the following updates:
|
"This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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",
|
"Update dependency dummy to v1.1.0",
|
||||||
"This PR contains the following updates:
|
"This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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\` | |
|
| a | | | \`zzzzzz\` -> \`aaaaaaa\` |
|
||||||
| b | | pin | \`some_old_value\` -> \`some_new_value\` | |
|
| b | | pin | \`some_old_value\` -> \`some_new_value\` |
|
||||||
| c | | | \`\` -> \`\` | |
|
| c | | | \`\` -> \`\` |
|
||||||
| d | | lockFileMaintenance | \`\` -> \`\` | |
|
| d | | lockFileMaintenance | \`\` -> \`\` |
|
||||||
|
|
||||||
note 1
|
note 1
|
||||||
|
|
||||||
|
@ -190,9 +190,9 @@ Array [
|
||||||
"Update dependency dummy to v1.1.0",
|
"Update dependency dummy to v1.1.0",
|
||||||
"This PR contains the following updates:
|
"This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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 {
|
Object {
|
||||||
"body": "This PR contains the following updates:
|
"body": "This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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 {
|
Object {
|
||||||
"body": "This PR contains the following updates:
|
"body": "This PR contains the following updates:
|
||||||
|
|
||||||
| Package | Type | Update | Change | References |
|
| Package | Type | Update | Change |
|
||||||
|---|---|---|---|---|
|
|---|---|---|---|
|
||||||
| 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) |
|
| [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\` |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue