ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [ignite-teamcity-bot] 01/02: IGNITE-10095: Support Build Parameters specifying: bugfixing
Date Wed, 08 May 2019 18:39:01 GMT
This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git

commit 6f332cd083320af5f550277966481d0d0d5fe40a
Author: Dmitriy Pavlov <dpavlov@apache.org>
AuthorDate: Wed May 8 21:31:18 2019 +0300

    IGNITE-10095: Support Build Parameters specifying: bugfixing
---
 .../teamcity/ignited/fatbuild/FatBuildCompacted.java | 20 ++++++++++++++++++--
 .../ci/teamcity/ignited/fatbuild/TestCompacted.java  |  7 ++++++-
 .../ci/teamcity/ignited/runhist/RunHistSync.java     |  6 ++++--
 .../java/org/apache/ignite/ci/web/model/Version.java |  2 +-
 4 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
index 7bfa146..2edfc4d 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/FatBuildCompacted.java
@@ -25,7 +25,9 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.List;
 import java.util.Objects;
+import java.util.TreeMap;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.function.BiPredicate;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 import org.apache.ignite.ci.ITeamcity;
@@ -619,7 +621,8 @@ public class FatBuildCompacted extends BuildRefCompacted implements IVersionedEn
             .toString();
     }
 
-    public Invocation toInvocation(IStringCompactor compactor) {
+    public Invocation toInvocation(IStringCompactor compactor,
+        BiPredicate<Integer, Integer> paramsFilter) {
         boolean success = isSuccess(compactor);
 
         final int failCode ;
@@ -639,10 +642,23 @@ public class FatBuildCompacted extends BuildRefCompacted implements
IVersionedEn
 
         }
 
-        return new Invocation(getId())
+        Invocation invocation = new Invocation(getId())
             .withStatus(failCode)
             .withStartDate(getStartDateTs())
             .withChanges(changes());
+
+        java.util.Map<Integer, Integer> importantParms = new TreeMap<>();
+
+        ParametersCompacted parameters = this.parameters();
+        if (parameters == null)
+            return invocation;
+
+        parameters.forEach((k, v) -> {
+            if (paramsFilter.test(k, v))
+                importantParms.put(k, v);
+        });
+
+        return invocation;
     }
 
     public void setVersion(short ver) {
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/TestCompacted.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/TestCompacted.java
index 11a2502..cf5fca5 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/TestCompacted.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/fatbuild/TestCompacted.java
@@ -33,6 +33,7 @@ import org.apache.ignite.ci.tcmodel.result.tests.TestOccurrence;
 import org.apache.ignite.ci.tcmodel.result.tests.TestOccurrenceFull;
 import org.apache.ignite.ci.tcmodel.result.tests.TestRef;
 import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
+import org.apache.ignite.ci.teamcity.ignited.buildtype.ParametersCompacted;
 import org.apache.ignite.ci.teamcity.ignited.runhist.Invocation;
 import org.apache.ignite.ci.teamcity.ignited.runhist.InvocationData;
 import org.jetbrains.annotations.Nullable;
@@ -390,7 +391,11 @@ public class TestCompacted {
 
         java.util.Map<Integer, Integer> importantParms = new TreeMap<>();
 
-        build.parameters().forEach((k, v) -> {
+        ParametersCompacted parameters = build.parameters();
+        if (parameters == null)
+            return invocation;
+
+        parameters.forEach((k, v) -> {
             if (paramsFilter.test(k, v))
                 importantParms.put(k, v);
         });
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java
index d5f804d..bc18ed8 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/runhist/RunHistSync.java
@@ -29,6 +29,7 @@ import java.util.Set;
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.BiPredicate;
 import java.util.stream.Collectors;
 import javax.annotation.concurrent.GuardedBy;
 import javax.inject.Inject;
@@ -109,6 +110,7 @@ public class RunHistSync {
 
         Set<Integer> allTriggeringBuildParameters = getFilteringParameters(srvCode);
 
+        BiPredicate<Integer, Integer> parmFilter = (k, v) -> allTriggeringBuildParameters.contains(k);
         boolean saveNow = false;
 
         int branchNameNormalized = compactor.getStringId(normalizeBranch(build.branchName(compactor)));
@@ -118,13 +120,13 @@ public class RunHistSync {
         build.getAllTests().forEach(t -> {
             RunHistKey histKey = new RunHistKey(srvId, t.testName(), branchNameNormalized);
             List<Invocation> list = testInvMap.computeIfAbsent(histKey, k -> new
ArrayList<>());
-            list.add(t.toInvocation(compactor, build, (k, v) -> allTriggeringBuildParameters.contains(k)));
+            list.add(t.toInvocation(compactor, build, parmFilter));
 
             cntTests.incrementAndGet();
         });
 
         RunHistKey buildInvKey = new RunHistKey(srvId, build.buildTypeId(), branchNameNormalized);
-        Invocation buildInv = build.toInvocation(compactor);
+        Invocation buildInv = build.toInvocation(compactor, parmFilter);
 
         int cnt = cntTests.get();
 
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
index 618bb7c..5c62d93 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Version.java
@@ -28,7 +28,7 @@ package org.apache.ignite.ci.web.model;
     public static final String GITHUB_REF = "https://github.com/apache/ignite-teamcity-bot";
 
     /** TC Bot Version. */
-    public static final String VERSION = "20190507";
+    public static final String VERSION = "20190508";
 
     /** Java version, where Web App is running. */
     public String javaVer;


Mime
View raw message