From 03e2c3bf347382352dc0e9db866170756a65a8f8 Mon Sep 17 00:00:00 2001 From: "Dmitriy.Panov" Date: Tue, 20 Nov 2018 14:55:33 +0300 Subject: [PATCH] IJI-9: TODO: always filter out commits already in review --- .../intellij/build/images/sync/reportUtils.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/sync/reportUtils.kt b/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/sync/reportUtils.kt index 580846f55704..730120bc0d96 100644 --- a/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/sync/reportUtils.kt +++ b/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/sync/reportUtils.kt @@ -154,14 +154,15 @@ private fun assignInvestigation(devRepoRoot: File, context: Context): Investigat } private fun findInvestigator(devRepoRoot: File, context: Context): Investigator { - val changes = context.addedByDev.asSequence() + - context.removedByDev.asSequence() + - context.modifiedByDev.asSequence() - val commits = findCommits(devRepoRoot, changes).keys - val commitsToInvestigate = if (context.devCommitsToSync.isNotEmpty()) - context.devCommitsToSync - else commits.groupBy(CommitInfo::repo) - return commits.maxBy(CommitInfo::timestamp)?.let { + // TODO: always filter out commits already in review + val commitsToInvestigate = if (context.devCommitsToSync.isEmpty()) { + val changes = context.addedByDev.asSequence() + + context.removedByDev.asSequence() + + context.modifiedByDev.asSequence() + findCommits(devRepoRoot, changes).keys.groupBy(CommitInfo::repo) + } + else context.devCommitsToSync + return commitsToInvestigate.flatMap { it.value }.maxBy(CommitInfo::timestamp)?.let { Investigator(it.committerEmail, commitsToInvestigate) } ?: Investigator() }