diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js index b1c8b98ab4b40927ee41f0dfaea9bc2040b8ca7a..bae3b1d9a4d32682dab2d1f250359c6841dacc47 100644 --- a/lib/workers/branch/index.js +++ b/lib/workers/branch/index.js @@ -199,7 +199,7 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) { return 'pending'; } // istanbul ignore if - if (masterIssueCheck === 'rebase') { + if (masterIssueCheck === 'rebase' || config.masterIssueRebaseAllOpen) { logger.info('Manual rebase requested via master issue'); delete config.parentBranch; } else { diff --git a/lib/workers/repository/master-issue.js b/lib/workers/repository/master-issue.js index e887b8a846cacacadb3080e1275e17b268f52cb1..39b04c70efdc833ffef2b78322ad43870851174b 100644 --- a/lib/workers/repository/master-issue.js +++ b/lib/workers/repository/master-issue.js @@ -121,6 +121,13 @@ async function ensureMasterIssue(config, branches) { const pr = await platform.getBranchPr(branch.branchName); issueBody += getListItem(branch, 'rebase', pr); } + if (inProgress.length > 2) { + issueBody += ' - [ ] '; + issueBody += '<!-- rebase-all-open-prs -->'; + issueBody += + '**Check this option to rebase all the above open PRs at once**'; + issueBody += '\n'; + } issueBody += '\n'; } const alreadyExisted = branches.filter( @@ -140,5 +147,6 @@ async function ensureMasterIssue(config, branches) { } issueBody += '\n'; } + await platform.ensureIssue(config.masterIssueTitle, issueBody); } diff --git a/lib/workers/repository/process/index.js b/lib/workers/repository/process/index.js index 06caf933ca6a50d26e2681c5f943f69434d8fc46..5e8f38a8a9f98e5a0383d37e8a921182afdc5a30 100644 --- a/lib/workers/repository/process/index.js +++ b/lib/workers/repository/process/index.js @@ -23,6 +23,11 @@ async function processRepo(config) { const [, type, branchName] = check.match(new RegExp(checkMatch)); config.masterIssueChecks[branchName] = type; }); + } + const checkAllMatch = ' - \\[x\\] <!-- rebase-all-open-prs -->'; + const checkedRebaseAll = issue.body.match(new RegExp(checkAllMatch)); + if (checkedRebaseAll) { + config.masterIssueRebaseAllOpen = true; /* eslint-enable no-param-reassign */ } }