You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/05/16 13:16:14 UTC
[ignite-teamcity-bot] branch ignite-11853 updated: IGNITE-11853:
Links fixed for tests failures, trusted suites development,
filtering old issues, filtering disabled issues
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 d85cb59 IGNITE-11853: Links fixed for tests failures, trusted suites development, filtering old issues, filtering disabled issues
d85cb59 is described below
commit d85cb59748876605c6f97f76b36c5e755d8494f7
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Thu May 16 16:16:10 2019 +0300
IGNITE-11853: Links fixed for tests failures, trusted suites development, filtering old issues, filtering disabled issues
---
conf/branches.json | 4 +++-
.../src/main/java/org/apache/ignite/ci/issue/Issue.java | 6 +++++-
.../org/apache/ignite/ci/tcbot/conf/BranchTracked.java | 16 ++++++++++++++++
.../org/apache/ignite/ci/tcbot/conf/TcServerConfig.java | 8 ++++----
.../org/apache/ignite/ci/tcbot/issue/IssueDetector.java | 16 ++++++++++++++++
5 files changed, 44 insertions(+), 6 deletions(-)
diff --git a/conf/branches.json b/conf/branches.json
index 5be6ae2..07d955e 100644
--- a/conf/branches.json
+++ b/conf/branches.json
@@ -30,7 +30,9 @@
{"value":"%env.JDK_OPEN_11%", "label":"JDK11"}
]
}
- ]
+ ],
+ /** Build type IDs, which should trigger notifications about any non build problem, and should be blocker in this case. **/
+ "trustedSuites": []
}
],
/* Set of JIRA servers/projects configured */
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/issue/Issue.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/issue/Issue.java
index dfed18d..edddad8 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/issue/Issue.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/issue/Issue.java
@@ -33,7 +33,7 @@ import org.jetbrains.annotations.Nullable;
@SuppressWarnings("WeakerAccess")
@Persisted
public class Issue {
- /** Type. Null of older versions of issue */
+ /** Type code. Null of older versions of issue */
@Nullable
private String type;
@@ -212,4 +212,8 @@ public class Issue {
return sb.toString();
}
+
+ public String type() {
+ return type;
+ }
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BranchTracked.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BranchTracked.java
index b7cecd3..455f3b4 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BranchTracked.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/BranchTracked.java
@@ -21,6 +21,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Stream;
+import javax.validation.constraints.NotNull;
+import org.jetbrains.annotations.Nullable;
/**
* One tracked branch, probably on several servers
@@ -32,6 +34,10 @@ public class BranchTracked {
/** */
public List<ChainAtServerTracked> chains = new ArrayList<>();
+ /** Disable notifications for the following issue types. */
+ @Nullable private List<String> disableIssueTypes = new ArrayList<>();
+
+
/**
* @return internal identifier of the branch.
*/
@@ -48,4 +54,14 @@ public class BranchTracked {
public Stream<ChainAtServerTracked> getChainsStream() {
return getChains().stream();
}
+
+ /**
+ * @
+ */
+ @NotNull public List<String> disableIssueTypes() {
+ return disableIssueTypes == null || disableIssueTypes.isEmpty()
+ ? Collections.emptyList()
+ : Collections.unmodifiableList(disableIssueTypes);
+ }
+
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/TcServerConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/TcServerConfig.java
index 0b2b8d8..60b9821 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/TcServerConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/TcServerConfig.java
@@ -56,8 +56,8 @@ public class TcServerConfig implements ITcServerConfig {
/** Build parameters which may be used for filtering. */
@Nullable private List<BuildParameterSpec> filteringParameters = new ArrayList<>();
- /** Trused suites. */
- @Nullable private List<String> trusedSuites = new ArrayList<>();
+ /** Trusted suites. */
+ @Nullable private List<String> trustedSuites = new ArrayList<>();
public TcServerConfig() {
@@ -132,10 +132,10 @@ public class TcServerConfig implements ITcServerConfig {
/** {@inheritDoc} */
@NotNull @Override public Collection<String> trustedSuites() {
- if (trusedSuites == null || trusedSuites.isEmpty())
+ if (trustedSuites == null || trustedSuites.isEmpty())
return Collections.emptySet();
- return Collections.unmodifiableList(trusedSuites);
+ return Collections.unmodifiableList(trustedSuites);
}
/**
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
index f74f43c..aadcfc8 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/issue/IssueDetector.java
@@ -25,6 +25,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Optional;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@@ -45,6 +46,7 @@ import org.apache.ignite.ci.jobs.CheckQueueJob;
import org.apache.ignite.ci.mail.EmailSender;
import org.apache.ignite.ci.mail.SlackSender;
import org.apache.ignite.ci.tcbot.chain.TrackedBranchChainsProcessor;
+import org.apache.ignite.ci.tcbot.conf.BranchTracked;
import org.apache.ignite.ci.tcbot.conf.INotificationChannel;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
import org.apache.ignite.ci.tcbot.conf.ITcServerConfig;
@@ -57,6 +59,7 @@ import org.apache.ignite.ci.teamcity.ignited.ITeamcityIgnitedProvider;
import org.apache.ignite.ci.teamcity.ignited.SyncMode;
import org.apache.ignite.ci.teamcity.ignited.change.ChangeCompacted;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
+import org.apache.ignite.ci.teamcity.ignited.runhist.InvocationData;
import org.apache.ignite.ci.user.ICredentialsProv;
import org.apache.ignite.ci.user.TcHelperUser;
import org.apache.ignite.ci.web.model.current.ChainAtServerCurrentStatus;
@@ -158,6 +161,19 @@ public class IssueDetector {
return issueAgeMs <= TimeUnit.HOURS.toMillis(2);
})
+ .filter(issue -> {
+ long buildStartTs = issue.buildStartTs == null ? 0 : issue.buildStartTs;
+ long buildAgeMs = System.currentTimeMillis() - buildStartTs;
+ long maxBuildAgeToNotify = TimeUnit.DAYS.toMillis(InvocationData.MAX_DAYS) / 2;
+
+ return buildAgeMs <= maxBuildAgeToNotify;
+ })
+ .filter(issue -> {
+ return cfg.getTrackedBranches()
+ .get(issue.trackedBranchName)
+ .filter(tb -> !tb.disableIssueTypes().contains(issue.type()))
+ .isPresent();
+ })
.forEach(issue -> {
List<String> addrs = new ArrayList<>();