diff --git a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt index 5bcb226c2e0c916a901be9a025750daf8a6db058..f9c831dee89680362696b50cdbdc97cc5510cab8 100644 --- a/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt +++ b/lib/workers/repository/__fixtures__/master-issue_with_8_PR.txt @@ -27,3 +27,9 @@ These updates encountered an error and will be retried. Click a checkbox below t - [ ] <!-- retry-branch=branchName7 -->pr7 - [ ] <!-- retry-branch=branchName8 -->pr8 +## Pending Branch Automerge + +These updates await pending status checks before automerging. + + - [ ] <!-- approvePr-branch=branchName9 -->pr9 + diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index a92c3e32c28db78c4c6d243c6475757f3f3e4341..08b611995b2a667819603d098c85bd8c6e3ae3b5 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -213,6 +213,14 @@ describe(getName(), () => { result: BranchResult.Error, branchName: 'branchName8', }, + { + ...mock<BranchConfig>(), + prTitle: 'pr9', + upgrades: [{ ...mock<PrUpgrade>(), depName: 'dep9' }], + result: BranchResult.Done, + prBlockedBy: 'BranchAutomerge', + branchName: 'branchName9', + }, ]; config.dependencyDashboard = true; await dependencyDashboard.ensureDependencyDashboard(config, branches); diff --git a/lib/workers/repository/dependency-dashboard.ts b/lib/workers/repository/dependency-dashboard.ts index f4ddb1435f44d1d37f23e4c7315751c010d540b2..9232176a66d0cc7407000e1d14b873915d415e4c 100644 --- a/lib/workers/repository/dependency-dashboard.ts +++ b/lib/workers/repository/dependency-dashboard.ts @@ -180,6 +180,17 @@ export async function ensureDependencyDashboard( } issueBody += '\n'; } + const prPendingBranchAutomerge = branches.filter( + (branch) => branch.prBlockedBy === 'BranchAutomerge' + ); + if (prPendingBranchAutomerge.length) { + issueBody += '## Pending Branch Automerge\n\n'; + issueBody += `These updates await pending status checks before automerging.\n\n`; + for (const branch of prPendingBranchAutomerge) { + issueBody += getListItem(branch, 'approvePr'); + } + issueBody += '\n'; + } const otherRes = [ BranchResult.Pending, BranchResult.NeedsApproval, @@ -194,7 +205,9 @@ export async function ensureDependencyDashboard( BranchResult.PrEdited, ]; let inProgress = branches.filter( - (branch) => !otherRes.includes(branch.result) + (branch) => + !otherRes.includes(branch.result) && + branch.prBlockedBy !== 'BranchAutomerge' ); const otherBranches = inProgress.filter( (branch) => branch.prBlockedBy || !branch.prNo