ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpav...@apache.org
Subject [ignite-teamcity-bot] branch ignite-11853 updated: IGNITE-11853: Links fixed for tests failures, trusted suites development, filtering old issues, filtering disabled issues, possible blockers refactored for suites and made server side.
Date Thu, 16 May 2019 18:01:19 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/ignite-11853 by this push:
     new 13b6b20  IGNITE-11853: Links fixed for tests failures, trusted suites development,
filtering old issues, filtering disabled issues, possible blockers refactored for suites and
made server side.
13b6b20 is described below

commit 13b6b20982d7d81c20b8650d88f70eeb570c3e18
Author: Dmitriy Pavlov <dpavlov@apache.org>
AuthorDate: Thu May 16 21:01:13 2019 +0300

    IGNITE-11853: Links fixed for tests failures, trusted suites development, filtering old
issues, filtering disabled issues, possible blockers refactored for suites and made server
side.
---
 .../ignite/ci/analysis/IMultTestOccurrence.java    |  3 +
 .../ignite/ci/analysis/TestCompactedMult.java      | 18 ++++
 .../ignite/ci/tcbot/chain/PrChainsProcessor.java   | 42 ++++++----
 .../ignite/ci/tcbot/visa/CurrentVisaStatus.java    |  1 +
 .../tcbot/visa/TcBotTriggerAndSignOffService.java  | 50 ++++++-----
 .../model/current/ChainAtServerCurrentStatus.java  |  9 +-
 .../ci/web/model/current/SuiteCurrentStatus.java   | 96 +++++++++++++---------
 .../ignite/ci/web/model/current/TestFailure.java   | 29 +++++--
 ignite-tc-helper-web/src/main/webapp/all.html      |  4 +-
 .../src/main/webapp/build-comparator.html          |  4 +-
 ignite-tc-helper-web/src/main/webapp/build.html    |  4 +-
 ignite-tc-helper-web/src/main/webapp/current.html  |  4 +-
 .../js/{testfails-2.1.js => testfails-2.2.js}      | 96 +++-------------------
 .../src/main/webapp/monitoring.html                |  2 +-
 ignite-tc-helper-web/src/main/webapp/pr.html       |  4 +-
 ignite-tc-helper-web/src/main/webapp/prs.html      |  2 +-
 16 files changed, 185 insertions(+), 183 deletions(-)

diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/IMultTestOccurrence.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/IMultTestOccurrence.java
index 4ae72ac..0a16487 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/IMultTestOccurrence.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/IMultTestOccurrence.java
@@ -18,6 +18,7 @@
 package org.apache.ignite.ci.analysis;
 
 import org.apache.ignite.ci.tcmodel.result.tests.TestOccurrenceFull;
+import org.apache.ignite.ci.teamcity.ignited.IRunHistory;
 
 /**
  * Multiple test occurrence. For single build context - max 1 failure
@@ -32,4 +33,6 @@ public interface IMultTestOccurrence {
     public long getAvgDurationMs();
 
     Iterable<TestOccurrenceFull> getOccurrences();
+
+    String getPossibleBlockerComment(IRunHistory baseBranchStat);
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/TestCompactedMult.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/TestCompactedMult.java
index 98a3604..409d948 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/TestCompactedMult.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/TestCompactedMult.java
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
 import org.apache.ignite.ci.tcmodel.result.tests.TestOccurrenceFull;
+import org.apache.ignite.ci.teamcity.ignited.IRunHistory;
 import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
 import org.apache.ignite.ci.teamcity.ignited.fatbuild.TestCompacted;
 
@@ -77,6 +78,23 @@ public class TestCompactedMult implements IMultTestOccurrence {
             .collect(Collectors.toList());
     }
 
+    @Override public String getPossibleBlockerComment(IRunHistory baseBranchStat) {
+        if (baseBranchStat == null)
+            return "History for base branch is absent.";
+
+        String flakyComments = baseBranchStat.getFlakyComments();
+
+        boolean lowFailureRate = baseBranchStat.getFailRate() * 100.0f < 4.;
+
+        if (lowFailureRate && flakyComments == null) {
+            return "Test has low fail rate in base branch "
+                + baseBranchStat.getFailPercentPrintable()
+                + "% and is not flaky";
+        }
+
+        return null;
+    }
+
     public void add(TestCompacted next) {
         occurrences.add(next);
     }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java
index fc0a829..9b5290c 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java
@@ -27,6 +27,7 @@ import org.apache.ignite.ci.IAnalyticsEnabledTeamcity;
 import org.apache.ignite.ci.ITeamcity;
 import org.apache.ignite.ci.analysis.FullChainRunCtx;
 import org.apache.ignite.ci.analysis.SuiteInBranch;
+import org.apache.ignite.ci.analysis.TestInBranch;
 import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
 import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
 import org.apache.ignite.ci.di.AutoProfiling;
@@ -189,7 +190,7 @@ public class PrChainsProcessor {
 
     @Nullable
     public List<SuiteCurrentStatus> getBlockersSuitesStatuses(String buildTypeId, String
branchForTc, String srvId,
-        ICredentialsProv prov, SyncMode queued) {
+        ICredentialsProv prov, SyncMode syncMode) {
         //using here non persistent TC allows to skip update statistic
         IAnalyticsEnabledTeamcity teamcity = tcSrvProvider.server(srvId, prov);
         ITeamcityIgnited tcIgnited = tcIgnitedProvider.server(srvId, prov);
@@ -205,7 +206,7 @@ public class PrChainsProcessor {
             ProcessLogsMode.SUITE_NOT_COMPLETE,
             true,
             baseBranch,
-            queued);
+            syncMode);
 
         if (ctx.isFakeStub())
             return null;
@@ -219,6 +220,7 @@ public class PrChainsProcessor {
      * @param tcIgnited
      * @param baseBranch
      */
+    //todo may avoid creation of UI model for simple comment.
     private List<SuiteCurrentStatus> findBlockerFailures(FullChainRunCtx fullChainRunCtx,
ITeamcityIgnited tcIgnited,
         String baseBranch) {
         return fullChainRunCtx
@@ -228,33 +230,39 @@ public class PrChainsProcessor {
                 String normalizedBaseBranch = RunHistSync.normalizeBranch(baseBranch);
                 IRunHistory statInBaseBranch = tcIgnited.getSuiteRunHist(new SuiteInBranch(ctx.suiteId(),
normalizedBaseBranch));
 
-                String comment = ctx.getPossibleBlockerComment(tcIgnited, compactor, statInBaseBranch);
+                String suiteComment = ctx.getPossibleBlockerComment(tcIgnited, compactor,
statInBaseBranch);
+
+                // blocker found by suite results:
+                if (!Strings.isNullOrEmpty(suiteComment)) {
+                    return new SuiteCurrentStatus()
+                        .initFromContext(tcIgnited, ctx, baseBranch, compactor, false);
+                }
+
+                List<TestFailure> failures = new ArrayList<>();
 
-                //todo may avoid creation of UI model for simple comment.
                 SuiteCurrentStatus suiteUi = new SuiteCurrentStatus();
 
-                suiteUi.initFromContext(tcIgnited, ctx, baseBranch, compactor);
+                ctx.getFailedTests().forEach(occurrence -> {
+                    IRunHistory stat = tcIgnited.getTestRunHist(new TestInBranch(occurrence.getName(),
normalizedBaseBranch));
 
-                if (!Strings.isNullOrEmpty(comment))
-                    return suiteUi; // blocker found;
+                    String testBlockerComment = occurrence.getPossibleBlockerComment(stat);
 
-                String failType = null;
+                    if (!Strings.isNullOrEmpty(testBlockerComment)) {
+                        final TestFailure failure = new TestFailure();
 
-                List<TestFailure> failures = new ArrayList<>();
+                        failure.initFromOccurrence(occurrence, tcIgnited, ctx.projectId(),
ctx.branchName(), baseBranch);
 
-                for (TestFailure testFailure : suiteUi.testFailures) {
-                    if (testFailure.isNewFailedTest())
-                        failures.add(testFailure);
-                }
+                        suiteUi.testFailures.add(failure);
+                    }
+                });
 
-                if (!failures.isEmpty()) {
+                if (!suiteUi.testFailures.isEmpty()) {
                     suiteUi.testFailures = failures;
 
-                    failType = "failed tests";
-                }
+                    suiteUi.initFromContext(tcIgnited, ctx, baseBranch, compactor, false);
 
-                if (failType != null)
                     return suiteUi;
+                }
 
                 return null;
             })
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/CurrentVisaStatus.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/CurrentVisaStatus.java
index 89da1ce..9ed249e 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/CurrentVisaStatus.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/CurrentVisaStatus.java
@@ -17,5 +17,6 @@
 package org.apache.ignite.ci.tcbot.visa;
 
 public class CurrentVisaStatus {
+    /** Total Blockers count. */
     public Integer blockers;
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
index 00299bc..279fdce 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
@@ -21,6 +21,22 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Strings;
 import com.google.inject.Provider;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.annotation.Nonnull;
+import javax.inject.Inject;
+import javax.ws.rs.QueryParam;
 import org.apache.ignite.ci.ITeamcity;
 import org.apache.ignite.ci.github.GitHubBranch;
 import org.apache.ignite.ci.github.GitHubUser;
@@ -40,12 +56,20 @@ import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
 import org.apache.ignite.ci.tcbot.conf.ITcServerConfig;
 import org.apache.ignite.ci.tcmodel.mute.MuteInfo;
 import org.apache.ignite.ci.tcmodel.result.Build;
-import org.apache.ignite.ci.teamcity.ignited.*;
+import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
+import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
+import org.apache.ignite.ci.teamcity.ignited.ITeamcityIgnited;
+import org.apache.ignite.ci.teamcity.ignited.ITeamcityIgnitedProvider;
+import org.apache.ignite.ci.teamcity.ignited.SyncMode;
 import org.apache.ignite.ci.teamcity.ignited.buildtype.BuildTypeCompacted;
 import org.apache.ignite.ci.teamcity.ignited.buildtype.BuildTypeRefCompacted;
 import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
 import org.apache.ignite.ci.user.ICredentialsProv;
-import org.apache.ignite.ci.web.model.*;
+import org.apache.ignite.ci.web.model.ContributionKey;
+import org.apache.ignite.ci.web.model.JiraCommentResponse;
+import org.apache.ignite.ci.web.model.SimpleResult;
+import org.apache.ignite.ci.web.model.Visa;
+import org.apache.ignite.ci.web.model.VisaRequest;
 import org.apache.ignite.ci.web.model.current.SuiteCurrentStatus;
 import org.apache.ignite.ci.web.model.current.TestFailure;
 import org.apache.ignite.ci.web.model.hist.FailureSummary;
@@ -56,16 +80,9 @@ import org.jetbrains.annotations.Nullable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.annotation.Nonnull;
-import javax.inject.Inject;
-import javax.ws.rs.QueryParam;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.apache.ignite.ci.observer.BuildsInfo.*;
+import static org.apache.ignite.ci.observer.BuildsInfo.CANCELLED_STATUS;
+import static org.apache.ignite.ci.observer.BuildsInfo.FINISHED_STATUS;
+import static org.apache.ignite.ci.observer.BuildsInfo.RUNNING_STATUS;
 import static org.apache.ignite.ci.util.XmlUtil.xmlEscapeText;
 
 /**
@@ -711,14 +728,7 @@ public class TcBotTriggerAndSignOffService {
         if (suitesStatuses == null)
             return status;
 
-        status.blockers = suitesStatuses.stream()
-            .mapToInt(suite -> {
-                if (suite.testFailures.isEmpty())
-                    return 1;
-
-                return suite.testFailures.size();
-            })
-            .sum();
+        status.blockers = suitesStatuses.stream().mapToInt(SuiteCurrentStatus::totalBlockers).sum();
 
         return status;
     }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/ChainAtServerCurrentStatus.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/ChainAtServerCurrentStatus.java
index c04c575..b617177 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/ChainAtServerCurrentStatus.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/ChainAtServerCurrentStatus.java
@@ -114,6 +114,9 @@ public class ChainAtServerCurrentStatus {
 
     @Nullable public String baseBranchForTc;
 
+    /** Total blockers count. */
+    public int totalBlockers;
+
     public ChainAtServerCurrentStatus(String srvId, String branchTc) {
         this.serverId = srvId;
         this.branchName = branchTc;
@@ -184,15 +187,17 @@ public class ChainAtServerCurrentStatus {
             suite -> {
                 final SuiteCurrentStatus suiteCurStatus = new SuiteCurrentStatus();
 
-                suiteCurStatus.initFromContext(tcIgnited, suite, baseBranchTc, compactor);
+                suiteCurStatus.initFromContext(tcIgnited, suite, baseBranchTc, compactor,
true);
 
                 failedTests += suiteCurStatus.failedTests;
                 if (suite.hasAnyBuildProblemExceptTestOrSnapshot() || suite.onlyCancelledBuilds())
                     failedToFinish++;
 
-                this.suites.add(suiteCurStatus);
+                suites.add(suiteCurStatus);
             }
         );
+
+        totalBlockers = suites.stream().mapToInt(SuiteCurrentStatus::totalBlockers).sum();
         durationPrintable = ctx.getDurationPrintable();
         testsDurationPrintable = ctx.getTestsDurationPrintable();
         durationNetTimePrintable = ctx.durationNetTimePrintable();
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/SuiteCurrentStatus.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/SuiteCurrentStatus.java
index 5177945..0a6c126 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/SuiteCurrentStatus.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/SuiteCurrentStatus.java
@@ -134,10 +134,11 @@ import static org.apache.ignite.ci.util.UrlUtil.escape;
      */
     @Nullable public String blockerComment;
 
-    public void initFromContext(ITeamcityIgnited tcIgnited,
+    public SuiteCurrentStatus initFromContext(ITeamcityIgnited tcIgnited,
         @Nonnull final MultBuildRunCtx suite,
         @Nullable final String baseBranch,
-        @Nonnull IStringCompactor compactor) {
+        @Nonnull IStringCompactor compactor,
+        boolean includeTests) {
 
         name = suite.suiteName();
 
@@ -164,54 +165,55 @@ import static org.apache.ignite.ci.util.UrlUtil.escape;
         webToHistBaseBranch = buildWebLink(tcIgnited, suite, baseBranch);
         webToBuild = buildWebLinkToBuild(tcIgnited, suite);
 
-        List<IMultTestOccurrence> tests = suite.getFailedTests();
-        Function<IMultTestOccurrence, Float> function = foccur -> {
-            TestInBranch testInBranch = new TestInBranch(foccur.getName(), failRateNormalizedBranch);
+        if (includeTests) {
+            List<IMultTestOccurrence> tests = suite.getFailedTests();
+            Function<IMultTestOccurrence, Float> function = foccur -> {
+                TestInBranch testInBranch = new TestInBranch(foccur.getName(), failRateNormalizedBranch);
 
-            IRunHistory apply = tcIgnited.getTestRunHist(testInBranch);
+                IRunHistory apply = tcIgnited.getTestRunHist(testInBranch);
 
-            return apply == null ? 0f : apply.getFailRate();
-        };
+                return apply == null ? 0f : apply.getFailRate();
+            };
 
-        tests.sort(Comparator.comparing(function).reversed());
+            tests.sort(Comparator.comparing(function).reversed());
 
-        tests.forEach(occurrence -> {
-            final TestFailure failure = new TestFailure();
-            failure.initFromOccurrence(occurrence, tcIgnited, suite.projectId(), suite.branchName(),
baseBranch);
-            failure.initStat(tcIgnited, failRateNormalizedBranch, curBranchNormalized);
-
-            testFailures.add(failure);
-        });
-
-        suite.getTopLongRunning().forEach(occurrence -> {
-            final TestFailure failure = createOrrucForLongRun(tcIgnited, suite,
-                occurrence, baseBranch);
-
-            topLongRunning.add(failure);
-        });
-
-        suite.getCriticalFailLastStartedTest().forEach(
-            lastTest -> {
+            tests.forEach(occurrence -> {
                 final TestFailure failure = new TestFailure();
-                failure.name = lastTest + " (last started)";
+                failure.initFromOccurrence(occurrence, tcIgnited, suite.projectId(), suite.branchName(),
baseBranch);
+                failure.initStat(tcIgnited, failRateNormalizedBranch, curBranchNormalized);
+
                 testFailures.add(failure);
-            }
-        );
+            });
 
-        suite.getLogsCheckResults().forEach(map -> {
-                map.forEach(
-                    (testName, logCheckResult) -> {
-                        if (logCheckResult.hasWarns())
-                            this.findFailureAndAddWarning(testName, logCheckResult);
+            suite.getTopLongRunning().forEach(occurrence -> {
+                final TestFailure failure = createOrrucForLongRun(tcIgnited, suite, occurrence,
baseBranch);
 
-                    }
-                );
-            }
-        );
+                topLongRunning.add(failure);
+            });
 
-        suite.getTopLogConsumers().forEach(
-            (entry) -> logConsumers.add(createOccurForLogConsumer(entry))
-        );
+            suite.getCriticalFailLastStartedTest().forEach(
+                lastTest -> {
+                    final TestFailure failure = new TestFailure();
+                    failure.name = lastTest + " (last started)";
+                    testFailures.add(failure);
+                }
+            );
+
+            suite.getLogsCheckResults().forEach(map -> {
+                    map.forEach(
+                        (testName, logCheckResult) -> {
+                            if (logCheckResult.hasWarns())
+                                this.findFailureAndAddWarning(testName, logCheckResult);
+
+                        }
+                    );
+                }
+            );
+
+            suite.getTopLogConsumers().forEach(
+                (entry) -> logConsumers.add(createOccurForLogConsumer(entry))
+            );
+        }
 
         suite.getBuildsWithThreadDump().forEach(buildId -> {
             webUrlThreadDump = "/rest/" + GetBuildLog.GET_BUILD_LOG + "/" + GetBuildLog.THREAD_DUMP
@@ -229,6 +231,8 @@ import static org.apache.ignite.ci.util.UrlUtil.escape;
         tags = suite.tags();
 
         blockerComment = suite.getPossibleBlockerComment(tcIgnited, compactor, baseBranchHist);
+
+        return this;
     }
 
     private IRunHistory initSuiteStat(ITeamcityIgnited tcIgnited,
@@ -407,4 +411,14 @@ import static org.apache.ignite.ci.util.UrlUtil.escape;
     public String branchName() {
         return branchName;
     }
+
+    public int totalBlockers() {
+        int res = 0;
+        if (!Strings.isNullOrEmpty(blockerComment))
+            res++;
+
+        res += (int)testFailures.stream().filter(TestFailure::isPossibleBlocker).count();
+
+        return res;
+    }
 }
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
index db10f55..90bf9bb 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/TestFailure.java
@@ -36,9 +36,9 @@ import org.apache.ignite.ci.web.model.hist.FailureSummary;
 import org.apache.ignite.ci.web.model.hist.TestHistory;
 import org.jetbrains.annotations.NotNull;
 
+import static org.apache.ignite.ci.teamcity.ignited.runhist.RunHistSync.normalizeBranch;
 import static org.apache.ignite.ci.util.TimeUtil.millisToDurationPrintable;
 import static org.apache.ignite.ci.util.UrlUtil.escape;
-import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchForLink;
 
 /**
  * UI model for test failure, probably merged with its history
@@ -88,6 +88,9 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
     /** Link to test history for current branch. */
     @Nullable public String webUrlBaseBranch;
 
+    /** Blocker comment: indicates test seems to be introduced failure. */
+    @Nullable public String blockerComment;
+
     /**
      * @param failure test ocurrence (probably multiple)
      * @param tcIgn Teamcity.
@@ -142,6 +145,9 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
                     webUrlBaseBranch = buildWebLink(tcIgn, full.test.id, projectId, baseBranchName);
         });
 
+        final IRunHistory stat = tcIgn.getTestRunHist(new TestInBranch(name, normalizeBranch(baseBranchName)));
+
+        blockerComment = failure.getPossibleBlockerComment(stat);
     }
 
     /**
@@ -176,7 +182,7 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
         if (projectId == null)
             return null;
 
-        final String branch = branchForLink(branchName);
+        final String branch = normalizeBranch(branchName);
 
         return tcIgn.host() + "project.html"
             + "?projectId=" + projectId
@@ -194,9 +200,7 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
         String failRateNormalizedBranch,
         String curBranchNormalized) {
 
-        TestInBranch testInBranch = new TestInBranch(name, failRateNormalizedBranch);
-
-        final IRunHistory stat = tcIgnited.getTestRunHist(testInBranch);
+        final IRunHistory stat = tcIgnited.getTestRunHist(new TestInBranch(name, failRateNormalizedBranch));
 
         histBaseBranch.init(stat);
 
@@ -266,17 +270,26 @@ import static org.apache.ignite.ci.web.model.current.SuiteCurrentStatus.branchFo
             Objects.equals(problemRef, failure.problemRef) &&
             Objects.equals(histCurBranch, failure.histCurBranch) &&
             Objects.equals(histBaseBranch, failure.histBaseBranch) &&
-            Objects.equals(webUrlBaseBranch, failure.webUrlBaseBranch);
+            Objects.equals(webUrlBaseBranch, failure.webUrlBaseBranch) &&
+            Objects.equals(blockerComment, failure.blockerComment);
     }
 
     /** {@inheritDoc} */
     @Override public int hashCode() {
-        return Objects.hash(name, suiteName, testName, curFailures, webUrl, webIssueUrl,
webIssueText, investigated,
-            durationPrintable, warnings, problemRef, histCurBranch, histBaseBranch, webUrlBaseBranch);
+        return Objects.hash(name, suiteName, testName, curFailures, webUrl, webIssueUrl,
webIssueText,
+            investigated, durationPrintable, warnings, problemRef, histCurBranch, histBaseBranch,
+            webUrlBaseBranch, blockerComment);
     }
 
     /** {@inheritDoc} */
     @Override public String toString() {
         return "\t" + name + "\n";
     }
+
+    /**
+     *
+     */
+    public boolean isPossibleBlocker() {
+        return !Strings.isNullOrEmpty(blockerComment);
+    }
 }
diff --git a/ignite-tc-helper-web/src/main/webapp/all.html b/ignite-tc-helper-web/src/main/webapp/all.html
index 3799112..e6dd691 100644
--- a/ignite-tc-helper-web/src/main/webapp/all.html
+++ b/ignite-tc-helper-web/src/main/webapp/all.html
@@ -11,14 +11,14 @@
     <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
     var g_shownDataHashCodeHex = "";
 
     $(document).ready(function () {
-        $.getScript("js/testfails-2.1.js", function (data, textStatus, jqxhr) {
+        $.getScript("js/testfails-2.2.js", function (data, textStatus, jqxhr) {
         });
 
         $(document).tooltip();
diff --git a/ignite-tc-helper-web/src/main/webapp/build-comparator.html b/ignite-tc-helper-web/src/main/webapp/build-comparator.html
index 4a45bfe..e8d5da9 100644
--- a/ignite-tc-helper-web/src/main/webapp/build-comparator.html
+++ b/ignite-tc-helper-web/src/main/webapp/build-comparator.html
@@ -9,14 +9,14 @@
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
     var g_shownDataHashCodeHex = "";
 
     $(document).ready(function() {
-        $.getScript("js/testfails-2.1.js", function(data, textStatus, jqxhr){ });
+        $.getScript("js/testfails-2.2.js", function(data, textStatus, jqxhr){ });
 
         $( document ).tooltip();
         loadData();
diff --git a/ignite-tc-helper-web/src/main/webapp/build.html b/ignite-tc-helper-web/src/main/webapp/build.html
index 50bcadd..c3acdbd 100644
--- a/ignite-tc-helper-web/src/main/webapp/build.html
+++ b/ignite-tc-helper-web/src/main/webapp/build.html
@@ -11,14 +11,14 @@
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
 var g_shownDataHashCodeHex = "";
 
 $(document).ready(function() {
-    $.getScript("js/testfails-2.1.js", function(data, textStatus, jqxhr){ });
+    $.getScript("js/testfails-2.2.js", function(data, textStatus, jqxhr){ });
     
     $( document ).tooltip();
     loadData();
diff --git a/ignite-tc-helper-web/src/main/webapp/current.html b/ignite-tc-helper-web/src/main/webapp/current.html
index 55caea8..053fb6a 100644
--- a/ignite-tc-helper-web/src/main/webapp/current.html
+++ b/ignite-tc-helper-web/src/main/webapp/current.html
@@ -11,14 +11,14 @@
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
 var g_shownDataHashCodeHex = "";
 
 $(document).ready(function() {
-    $.getScript("js/testfails-2.1.js", function(data, textStatus, jqxhr){ });
+    $.getScript("js/testfails-2.2.js", function(data, textStatus, jqxhr){ });
     
     $( document ).tooltip();
     loadData();
diff --git a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
similarity index 93%
rename from ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
rename to ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
index ded9ead..72222a0 100644
--- a/ignite-tc-helper-web/src/main/webapp/js/testfails-2.1.js
+++ b/ignite-tc-helper-web/src/main/webapp/js/testfails-2.2.js
@@ -317,9 +317,14 @@ function addBlockersData(server, settings) {
             "<th class='table-title'>Base Branch</th></tr>";
     }
     else {
-        blockers = "<tr bgcolor='#F5F5FF'><th colspan='3' class='table-title'><b>Possible
Blockers</b></th>" +
-            "<th class='table-title'>Base Branch</th></tr>" +
-            blockers
+        let blockersHeader = "<tr bgcolor='#F5F5FF'><th colspan='3' class='table-title'><b>Possible
Blockers";
+
+        if (isDefinedAndFilled(server.totalBlockers))
+            blockersHeader += " (" + server.totalBlockers + ")";
+
+        blockersHeader += "</b></th>" +  "<th class='table-title'>Base
Branch</th></tr>";
+
+        blockers = blockersHeader + blockers;
     }
 
     blockers += "<tr bgcolor='#F5F5FF'><th colspan='3' class='table-title'><b>All
Failures</b></th>" +
@@ -344,7 +349,7 @@ function filterPossibleBlocker(suite) {
     while (j < suite0.testFailures.length) {
         var testFailure = suite0.testFailures[j];
 
-        if (isNewFailedTest(testFailure) || testFailure.name.includes("(last started)"))
+        if (isDefinedAndFilled(testFailure.blockerComment) && testFailure.blockerComment
!== "")
             j++;
         else
             suite0.testFailures.splice(j, 1);
@@ -359,59 +364,6 @@ function filterPossibleBlocker(suite) {
     return null;
 }
 
-/**
- * Send POST request to change PR status.
- *
- * @returns {string}
- */
-function notifyGit() {
-    var server = g_srv_to_notify_git;
-    var suites = 0;
-    var tests = 0;
-
-    for (let suite of server.suites) {
-        if (suite.result != "") {
-            suites++;
-
-            continue;
-        }
-
-        for (let testFailure of suite.testFailures) {
-            if (isNewFailedTest(testFailure))
-                tests++;
-        }
-    }
-
-    var state;
-    var desc;
-
-    if (suites === 0 && tests === 0) {
-        state = "success";
-        desc = "No blockers found.";
-    }
-    else {
-        state = "failure";
-        desc = suites + " critical suites, " + tests + " failed tests.";
-    }
-
-    var msg = {
-        state: state,
-        target_url: server.webToHist,
-        description: desc,
-        context: "TeamCity"
-    };
-
-    var notifyGitUrl = "rest/pr/notifyGit"  + parmsForRest();
-
-    $.ajax({
-        url: notifyGitUrl,
-        type: 'POST',
-        data: {notifyMsg: JSON.stringify(msg)},
-        success: function(result) {$("#loadStatus").html(result);},
-        error: showErrInLoadStatus
-    });
-}
-
 function triggerBuilds(serverId, parentSuiteId, suiteIdList, branchName, top, observe, ticketId,
prNum) {
     var queueAtTop = isDefinedAndFilled(top) && top;
     var observeJira = isDefinedAndFilled(observe) && observe;
@@ -762,32 +714,6 @@ function showSuiteData(suite, settings, prNum) {
     return res;
 }
 
-/**
- * Check that given test is new.
- *
- * @param testFail - see TestFailure Java class.
- * @returns {boolean} True - if test is new. False - otherwise.
- */
-function isNewFailedTest(testFail) {
-    if (isDefinedAndFilled(testFail.webIssueUrl))
-        return false;
-
-    if (!isDefinedAndFilled(testFail.histBaseBranch) || !isDefinedAndFilled(testFail.histBaseBranch.latestRuns))
-        return true;
-
-    var hist = testFail.histBaseBranch;
-
-    if (!isDefinedAndFilled(hist.recent))
-        return true;
-
-    var flakyCommentsInBase =
-        isDefinedAndFilled(testFail.histBaseBranch.flakyComments)
-            ? testFail.histBaseBranch.flakyComments
-            : null;
-
-    return Number.parseFloat(hist.recent.failureRate) < 4.0 && flakyCommentsInBase
== null;
-}
-
 function failureRateToColor(failureRate) {
     var redSaturation = 255;
     var greenSaturation = 0;
@@ -878,6 +804,10 @@ function showTestFailData(testFail, isFailureShown, settings) {
         res += baseBranchMarks;
     }
 
+    if (isDefinedAndFilled(testFail.blockerComment) && testFail.blockerComment !==
"") {
+        res += "<span title='" + testFail.blockerComment + "'> &#x1f6ab;</span>
"
+    }
+
     var bold = false;
     if(isFailureShown && isDefinedAndFilled(testFail.problemRef)) {
         res += "<span title='"+testFail.problemRef.name +"'>&#128030;</span>";
diff --git a/ignite-tc-helper-web/src/main/webapp/monitoring.html b/ignite-tc-helper-web/src/main/webapp/monitoring.html
index 8e708a7..3a45436 100644
--- a/ignite-tc-helper-web/src/main/webapp/monitoring.html
+++ b/ignite-tc-helper-web/src/main/webapp/monitoring.html
@@ -12,7 +12,7 @@
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
 
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
diff --git a/ignite-tc-helper-web/src/main/webapp/pr.html b/ignite-tc-helper-web/src/main/webapp/pr.html
index 8b61c57..01d644b 100644
--- a/ignite-tc-helper-web/src/main/webapp/pr.html
+++ b/ignite-tc-helper-web/src/main/webapp/pr.html
@@ -9,14 +9,14 @@
     <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
     <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
 </head>
 <body>
 <script>
     var g_shownDataHashCodeHex = "";
 
 $(document).ready(function() {
-    $.getScript("js/testfails-2.1.js", function(data, textStatus, jqxhr){ });
+    $.getScript("js/testfails-2.2.js", function(data, textStatus, jqxhr){ });
 
     $( document ).tooltip();
     loadData();
diff --git a/ignite-tc-helper-web/src/main/webapp/prs.html b/ignite-tc-helper-web/src/main/webapp/prs.html
index cd736b4..9d168e3 100644
--- a/ignite-tc-helper-web/src/main/webapp/prs.html
+++ b/ignite-tc-helper-web/src/main/webapp/prs.html
@@ -18,7 +18,7 @@
           integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns"
crossorigin="anonymous">
 
     <script src="js/common-1.6.js"></script>
-    <script src="js/testfails-2.1.js"></script>
+    <script src="js/testfails-2.2.js"></script>
     <script src="js/prs-1.1.js"></script>
 
     <style>


Mime
View raw message