Skip to content
Snippets Groups Projects
Commit 8fc005b1 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix: group based on commitMessageExtra

parent c26e1226
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,11 @@ function generateBranchConfig(branchUpgrades) {
if (!depNames.includes(upg.depName)) {
depNames.push(upg.depName);
}
if (!newVersion.includes(upg.newVersion || upg.newFrom)) {
newVersion.push(upg.newVersion || upg.newFrom);
if (upg.commitMessageExtra) {
const extra = handlebars.compile(upg.commitMessageExtra)(upg);
if (!newVersion.includes(extra)) {
newVersion.push(extra);
}
}
});
const groupEligible =
......@@ -46,6 +49,7 @@ function generateBranchConfig(branchUpgrades) {
branchUpgrades[0].depName.endsWith(branchUpgrades[1].depName)) ||
(branchUpgrades[1].depName.startsWith('@types/') &&
branchUpgrades[1].depName.endsWith(branchUpgrades[0].depName)));
// istanbul ignore else
if (newVersion.length > 1 && !isTypesGroup) {
logger.debug({ newVersion });
delete upgrade.commitMessageExtra;
......
......@@ -82,6 +82,8 @@ describe('workers/repository/updates/generate', () => {
groupName: 'some-group',
branchName: 'some-branch',
prTitle: 'some-title',
commitMessageExtra:
'to {{#if isMajor}}v{{newVersionMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newVersion}}{{/if}}',
lazyGrouping: true,
foo: 1,
newVersion: '5.1.2',
......@@ -94,6 +96,8 @@ describe('workers/repository/updates/generate', () => {
groupName: 'some-group',
branchName: 'some-branch',
prTitle: 'some-title',
commitMessageExtra:
'to {{#if isMajor}}v{{newVersionMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newVersion}}{{/if}}',
lazyGrouping: true,
foo: 1,
newVersion: '5.1.2',
......@@ -113,6 +117,8 @@ describe('workers/repository/updates/generate', () => {
groupName: 'some-group',
branchName: 'some-branch',
prTitle: 'some-title',
commitMessageExtra:
'to {{#if isMajor}}v{{newVersionMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newVersion}}{{/if}}',
lazyGrouping: true,
foo: 1,
newVersion: '5.1.2',
......@@ -125,6 +131,8 @@ describe('workers/repository/updates/generate', () => {
groupName: 'some-group',
branchName: 'some-branch',
prTitle: 'some-title',
commitMessageExtra:
'to {{#if isMajor}}v{{newVersionMajor}}{{else}}{{#unless isRange}}v{{/unless}}{{newVersion}}{{/if}}',
lazyGrouping: true,
foo: 1,
newVersion: '1.1.0',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment