From 4b8001404c99f672dfd327a625440973d06d9a91 Mon Sep 17 00:00:00 2001 From: Elena Lepilkina Date: Mon, 8 Apr 2019 17:36:28 +0300 Subject: [PATCH] Always send to slack comparasion report with master + fix for higligted field --- .../buildSrc/src/main/kotlin/RegressionsReporter.kt | 8 +------- tools/performance-server/ui/src/main/kotlin/main.kt | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt b/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt index 911ca82fcf9..b2e19084dff 100644 --- a/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt +++ b/performance/buildSrc/src/main/kotlin/RegressionsReporter.kt @@ -116,7 +116,6 @@ open class RegressionsReporter : DefaultTask() { // Get previous build on branch. val builds = getBuild(previousBuildLocator(buildTypeId,branch), user, password) - val previousBuildsExist = (JsonTreeParser.parse(builds) as JsonObject).getPrimitive("count").int != 0 // Get changes description. val changesList = getCommits("id:$buildId", user, password) @@ -126,16 +125,11 @@ open class RegressionsReporter : DefaultTask() { } } - println("defaul Branch: $defaultBranch") - - // If branch differs from default and it's first build compare to master, otherwise compare to previous build on branch. - val compareToBranch = if (previousBuildsExist) branch else defaultBranch - // File name on bintray is the same as current. val bintrayFileName = currentBenchmarksReportFile.substringAfterLast("/") // Get compare to build. - val compareToBuild = getBuild(previousBuildLocator(buildTypeId, compareToBranch), user, password) + val compareToBuild = getBuild(previousBuildLocator(buildTypeId, defaultBranch), user, password) val compareToBuildLink = getBuildProperty(compareToBuild,"webUrl") val compareToBuildNumber = getBuildProperty(compareToBuild,"number") val target = System.getProperty("os.name").replace("\\s".toRegex(), "") diff --git a/tools/performance-server/ui/src/main/kotlin/main.kt b/tools/performance-server/ui/src/main/kotlin/main.kt index 26a924bf984..c4cf3f29c77 100644 --- a/tools/performance-server/ui/src/main/kotlin/main.kt +++ b/tools/performance-server/ui/src/main/kotlin/main.kt @@ -277,12 +277,13 @@ fun main(args: Array) { autocompleteParameters["onSelect"] = { suggestion -> if (suggestion.value != parameters["build"]) { val newLink = "http://${window.location.host}/?target=${parameters["target"]}&type=${parameters["type"]}" + - "${if (suggestion.value.isEmpty()) "" else "&build=${suggestion.value}"}" + "${if ((suggestion.value as String).isEmpty()) "" else "&build=${suggestion.value}"}" window.location.href = newLink } } js("$( \"#highligted_build\" )").autocomplete(autocompleteParameters) - js("$('#highligted_build')").change({ + js("$('#highligted_build')").change({ value -> + println(value) val newValue = js("$(this).val()").toString() if (newValue.isEmpty() || newValue in builds.map {it.buildNumber}) { val newLink = "http://${window.location.host}/?target=${parameters["target"]}&type=${parameters["type"]}" +