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",
|
||||
],
|
||||
"newValue": "0.6.0",
|
||||
"prBodyColumns": Array [],
|
||||
"prTitle": "some-title",
|
||||
"prettyDepType": "dependency",
|
||||
"releaseTimestamp": undefined,
|
||||
|
@ -95,6 +96,7 @@ Object {
|
|||
"isRange": false,
|
||||
"labels": Array [],
|
||||
"newValue": "0.6.0",
|
||||
"prBodyColumns": Array [],
|
||||
"prTitle": "some-title",
|
||||
"prettyDepType": "dependency",
|
||||
"recreateClosed": false,
|
||||
|
@ -165,6 +167,7 @@ Object {
|
|||
"displayTo": "",
|
||||
"isLockFileMaintenance": true,
|
||||
"labels": Array [],
|
||||
"prBodyColumns": Array [],
|
||||
"prTitle": "some-title",
|
||||
"prettyDepType": "dependency",
|
||||
"releaseTimestamp": undefined,
|
||||
|
@ -204,6 +207,7 @@ Object {
|
|||
"lockedVersion": "1.0.0",
|
||||
"newValue": "^1.0.0",
|
||||
"newVersion": "1.0.1",
|
||||
"prBodyColumns": Array [],
|
||||
"prTitle": "some-title",
|
||||
"prettyDepType": "dependency",
|
||||
"releaseTimestamp": undefined,
|
||||
|
|
|
@ -660,6 +660,20 @@ describe('workers/repository/updates/generate', () => {
|
|||
const res = generateBranchConfig(branch);
|
||||
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', () => {
|
||||
const branch: BranchUpgradeConfig[] = [
|
||||
{
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import is from '@sindresorhus/is';
|
||||
import { DateTime } from 'luxon';
|
||||
import mdTable from 'markdown-table';
|
||||
import semver from 'semver';
|
||||
|
@ -305,6 +306,14 @@ export function generateBranchConfig(
|
|||
config.dependencyDashboardPrApproval = config.upgrades.some(
|
||||
(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);
|
||||
// combine all labels
|
||||
config.labels = [
|
||||
|
|
Loading…
Reference in a new issue