From a25bbcc5c240f6266a89a34a222d1cdefbca21e2 Mon Sep 17 00:00:00 2001 From: Oleg Sigida Date: Wed, 8 Dec 2021 14:15:34 +0100 Subject: [PATCH 1/2] feat: improve logging for branch reuse decision flow #13004 --- lib/util/git/index.ts | 1 + lib/workers/branch/reuse.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/util/git/index.ts b/lib/util/git/index.ts index 58f5450373eef1..7ebc1b746dfdde 100644 --- a/lib/util/git/index.ts +++ b/lib/util/git/index.ts @@ -520,6 +520,7 @@ export async function isBranchModified(branchName: string): Promise { config.ignoredAuthors.some((ignoredAuthor) => lastAuthor === ignoredAuthor) ) { // author matches - branch has not been modified + logger.debug({ branchName }, 'Branch has not been modified'); config.branchIsModified[branchName] = false; return false; } diff --git a/lib/workers/branch/reuse.ts b/lib/workers/branch/reuse.ts index a114fd864fa7d7..093bebac874ce5 100644 --- a/lib/workers/branch/reuse.ts +++ b/lib/workers/branch/reuse.ts @@ -60,6 +60,7 @@ export async function shouldReuseExistingBranch( logger.debug('Cannot rebase branch as it has been modified'); return { reuseExistingBranch: true, isModified: true }; } + logger.debug('Branch has no changes, but we will not use it'); return { reuseExistingBranch: false }; } logger.debug('Branch is up-to-date'); From e28d94a2d9a24e7209a7ba636c649dec89c61fa5 Mon Sep 17 00:00:00 2001 From: Oleg Sigida <6461608+osigida@users.noreply.github.com> Date: Wed, 8 Dec 2021 15:18:25 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Rhys Arkins --- lib/workers/branch/reuse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/workers/branch/reuse.ts b/lib/workers/branch/reuse.ts index 093bebac874ce5..00a9a062be7ca2 100644 --- a/lib/workers/branch/reuse.ts +++ b/lib/workers/branch/reuse.ts @@ -60,7 +60,7 @@ export async function shouldReuseExistingBranch( logger.debug('Cannot rebase branch as it has been modified'); return { reuseExistingBranch: true, isModified: true }; } - logger.debug('Branch has no changes, but we will not use it'); + logger.debug('Branch is unmodified, so can be rebased'); return { reuseExistingBranch: false }; } logger.debug('Branch is up-to-date');