mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 14:36:25 +00:00
fix(pr): intelligently merge prBodyColumns (#14198)
This commit is contained in:
parent
766d92144f
commit
c6b1cda575
3 changed files with 27 additions and 0 deletions
|
@ -21,6 +21,7 @@ Object {
|
||||||
"b",
|
"b",
|
||||||
],
|
],
|
||||||
"newValue": "0.6.0",
|
"newValue": "0.6.0",
|
||||||
|
"prBodyColumns": Array [],
|
||||||
"prTitle": "some-title",
|
"prTitle": "some-title",
|
||||||
"prettyDepType": "dependency",
|
"prettyDepType": "dependency",
|
||||||
"releaseTimestamp": undefined,
|
"releaseTimestamp": undefined,
|
||||||
|
@ -95,6 +96,7 @@ Object {
|
||||||
"isRange": false,
|
"isRange": false,
|
||||||
"labels": Array [],
|
"labels": Array [],
|
||||||
"newValue": "0.6.0",
|
"newValue": "0.6.0",
|
||||||
|
"prBodyColumns": Array [],
|
||||||
"prTitle": "some-title",
|
"prTitle": "some-title",
|
||||||
"prettyDepType": "dependency",
|
"prettyDepType": "dependency",
|
||||||
"recreateClosed": false,
|
"recreateClosed": false,
|
||||||
|
@ -165,6 +167,7 @@ Object {
|
||||||
"displayTo": "",
|
"displayTo": "",
|
||||||
"isLockFileMaintenance": true,
|
"isLockFileMaintenance": true,
|
||||||
"labels": Array [],
|
"labels": Array [],
|
||||||
|
"prBodyColumns": Array [],
|
||||||
"prTitle": "some-title",
|
"prTitle": "some-title",
|
||||||
"prettyDepType": "dependency",
|
"prettyDepType": "dependency",
|
||||||
"releaseTimestamp": undefined,
|
"releaseTimestamp": undefined,
|
||||||
|
@ -204,6 +207,7 @@ Object {
|
||||||
"lockedVersion": "1.0.0",
|
"lockedVersion": "1.0.0",
|
||||||
"newValue": "^1.0.0",
|
"newValue": "^1.0.0",
|
||||||
"newVersion": "1.0.1",
|
"newVersion": "1.0.1",
|
||||||
|
"prBodyColumns": Array [],
|
||||||
"prTitle": "some-title",
|
"prTitle": "some-title",
|
||||||
"prettyDepType": "dependency",
|
"prettyDepType": "dependency",
|
||||||
"releaseTimestamp": undefined,
|
"releaseTimestamp": undefined,
|
||||||
|
|
|
@ -660,6 +660,20 @@ describe('workers/repository/updates/generate', () => {
|
||||||
const res = generateBranchConfig(branch);
|
const res = generateBranchConfig(branch);
|
||||||
expect(res.prTitle).toMatchSnapshot('some-title (patch)');
|
expect(res.prTitle).toMatchSnapshot('some-title (patch)');
|
||||||
});
|
});
|
||||||
|
it('combines prBodyColumns', () => {
|
||||||
|
const branch: BranchUpgradeConfig[] = [
|
||||||
|
{
|
||||||
|
branchName: 'some-branch',
|
||||||
|
prBodyColumns: ['column-a', 'column-b'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
branchName: 'some-branch',
|
||||||
|
prBodyColumns: ['column-c', 'column-b', 'column-a'],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const res = generateBranchConfig(branch);
|
||||||
|
expect(res.prBodyColumns).toEqual(['column-a', 'column-b', 'column-c']);
|
||||||
|
});
|
||||||
it('sorts upgrades, without position first', () => {
|
it('sorts upgrades, without position first', () => {
|
||||||
const branch: BranchUpgradeConfig[] = [
|
const branch: BranchUpgradeConfig[] = [
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import is from '@sindresorhus/is';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
import mdTable from 'markdown-table';
|
import mdTable from 'markdown-table';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
@ -305,6 +306,14 @@ export function generateBranchConfig(
|
||||||
config.dependencyDashboardPrApproval = config.upgrades.some(
|
config.dependencyDashboardPrApproval = config.upgrades.some(
|
||||||
(upgrade) => upgrade.prCreation === 'approval'
|
(upgrade) => upgrade.prCreation === 'approval'
|
||||||
);
|
);
|
||||||
|
config.prBodyColumns = [
|
||||||
|
...new Set(
|
||||||
|
config.upgrades.reduce(
|
||||||
|
(existing, upgrade) => existing.concat(upgrade.prBodyColumns),
|
||||||
|
[]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
].filter(is.nonEmptyString);
|
||||||
config.automerge = config.upgrades.every((upgrade) => upgrade.automerge);
|
config.automerge = config.upgrades.every((upgrade) => upgrade.automerge);
|
||||||
// combine all labels
|
// combine all labels
|
||||||
config.labels = [
|
config.labels = [
|
||||||
|
|
Loading…
Reference in a new issue