Skip to content
Permalink
Browse files
TC Bot engine module introduced
  • Loading branch information
dspavlov committed Jun 7, 2019
1 parent 912f8f5 commit 55ca3f4a88bd8274ffa272eca2e4ce8a1acbf272
Showing 31 changed files with 119 additions and 87 deletions.
@@ -31,8 +31,7 @@ dependencies {
compile (project(":tcbot-common"));
compile (project(":tcbot-teamcity"));
compile (project(":tcbot-teamcity-ignited"));

compile group: 'com.google.guava', name: 'guava', version: guavaVer
compile (project(":tcbot-engine"));

compile group: 'org.apache.ignite', name: 'ignite-core', version: ignVer
compile group: 'org.apache.ignite', name: 'ignite-slf4j', version: ignVer
@@ -41,13 +40,9 @@ dependencies {
compile group: 'org.slf4j', name: 'slf4j-api', version: slf4jVer
compile group: 'org.slf4j', name: 'jul-to-slf4j', version: slf4jVer


compile group: 'ch.qos.logback', name: 'logback-core', version: logbackVer
compile group: 'ch.qos.logback', name: 'logback-classic', version: logbackVer

//Apache License Version 2.0
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'

compile group: 'org.eclipse.jetty', name: 'jetty-util', version: jettyVer
compile group: 'org.eclipse.jetty', name: 'jetty-server', version: jettyVer
compile group: 'org.eclipse.jetty', name: 'jetty-webapp', version: jettyVer
@@ -71,8 +66,6 @@ dependencies {

compile group: 'com.ullink.slack', name: 'simpleslackapi', version: '1.2.0'

compile group: 'com.google.inject', name: 'guice', version: '4.2.0'

compile group: 'org.xerial.snappy', name: 'snappy-java', version: '1.1.7.2'


@@ -34,11 +34,6 @@ public class EventTemplates {
new int[]{FAIL, FAIL, FAIL, FAIL}
);

public static final EventTemplate fixOfFailure = new EventTemplate(
new int[]{FAIL, FAIL, FAIL},
new int[]{OK, OK, OK, OK, OK}
);

public static final EventTemplate newCriticalFailure = new EventTemplate(
new int[]{RES_OK_OR_FAILURE.getCode(), RES_OK_OR_FAILURE.getCode(), RES_OK_OR_FAILURE.getCode(), RES_OK_OR_FAILURE.getCode(), RES_OK_OR_FAILURE.getCode()},
new int[]{RES_CRITICAL_FAILURE.getCode(), RES_CRITICAL_FAILURE.getCode(), RES_CRITICAL_FAILURE.getCode(), RES_CRITICAL_FAILURE.getCode()}
@@ -59,7 +54,7 @@ public class EventTemplates {
public static ArrayList<EventTemplate> templates;

static {
templates = Lists.newArrayList(newFailure, newCriticalFailure, fixOfFailure,
templates = Lists.newArrayList(newFailure, newCriticalFailure,
newContributedTestFailure, newFailureForFlakyTest);
}
}
@@ -20,7 +20,7 @@
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import org.apache.ignite.ci.analysis.MultBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
import org.apache.ignite.ci.tcbot.chain.BuildChainProcessor;
import org.apache.ignite.tcbot.persistence.IStringCompactor;
import org.apache.ignite.tcignited.ITeamcityIgnited;
@@ -19,15 +19,15 @@

import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.Futures;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.MultBuildRunCtx;
import org.apache.ignite.ci.analysis.SingleBuildRunCtx;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.SingleBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
import org.apache.ignite.ci.teamcity.ignited.buildtype.ParametersCompacted;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
import org.apache.ignite.ci.util.FutureUtil;
import org.apache.ignite.tcbot.common.util.FutureUtil;
import org.apache.ignite.ci.web.TcUpdatePool;
import org.apache.ignite.ci.web.model.long_running.LRTest;
import org.apache.ignite.ci.web.model.long_running.SuiteLRTestsSummary;
@@ -22,10 +22,10 @@
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import javax.inject.Inject;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.TestCompactedMult;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.TestCompactedMult;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.ci.github.ignited.IGitHubConnIgnited;
import org.apache.ignite.ci.github.ignited.IGitHubConnIgnitedProvider;
import org.apache.ignite.ci.jira.ignited.IJiraIgnited;
@@ -21,9 +21,9 @@
import java.util.concurrent.atomic.AtomicInteger;
import javax.inject.Inject;

import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.ci.tcbot.conf.BranchTracked;
import org.apache.ignite.tcbot.common.interceptor.AutoProfiling;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
@@ -53,7 +53,7 @@
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.ProblemCompacted;
import org.apache.ignite.ci.user.ITcBotUserCreds;
import org.apache.ignite.ci.util.FutureUtil;
import org.apache.ignite.tcbot.common.util.FutureUtil;
import org.apache.ignite.ci.web.model.trends.BuildStatisticsSummary;
import org.apache.ignite.ci.web.model.trends.BuildsHistory;
import org.apache.ignite.internal.util.typedef.T2;
@@ -25,15 +25,15 @@
import java.util.Objects;
import java.util.stream.Stream;
import javax.annotation.Nullable;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.IMultTestOccurrence;
import org.apache.ignite.ci.analysis.MultBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.IMultTestOccurrence;
import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
import org.apache.ignite.ci.github.PullRequest;
import org.apache.ignite.ci.github.ignited.IGitHubConnIgnited;
import org.apache.ignite.ci.github.pure.IGitHubConnection;
import org.apache.ignite.ci.jira.ignited.IJiraIgnited;
import org.apache.ignite.ci.tcbot.visa.BranchTicketMatcher;
import org.apache.ignite.ci.util.CollectionUtil;
import org.apache.ignite.tcbot.common.util.CollectionUtil;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.tcbot.persistence.IStringCompactor;
import org.apache.ignite.tcignited.ITeamcityIgnited;
@@ -29,8 +29,8 @@
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.apache.ignite.ci.analysis.IMultTestOccurrence;
import org.apache.ignite.ci.analysis.MultBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.IMultTestOccurrence;
import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
import org.apache.ignite.ci.issue.EventTemplates;
import org.apache.ignite.ci.issue.ProblemRef;
import org.apache.ignite.tcignited.buildlog.ITestLogCheckResult;
@@ -25,8 +25,8 @@
import java.util.regex.Pattern;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.apache.ignite.ci.analysis.IMultTestOccurrence;
import org.apache.ignite.ci.analysis.TestCompactedMult;
import org.apache.ignite.tcbot.engine.chain.IMultTestOccurrence;
import org.apache.ignite.tcbot.engine.chain.TestCompactedMult;
import org.apache.ignite.ci.issue.EventTemplates;
import org.apache.ignite.ci.issue.ProblemRef;
import org.apache.ignite.tcignited.buildlog.LogMsgToWarn;
@@ -31,15 +31,15 @@
import com.google.inject.Injector;
import org.apache.ignite.ci.tcbot.chain.BuildChainProcessor;
import org.apache.ignite.tcservice.ITeamcity;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.tcbot.persistence.IStringCompactor;
import org.apache.ignite.tcignited.ITeamcityIgnited;
import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
import org.apache.ignite.tcignited.SyncMode;
import org.apache.ignite.ci.user.ITcBotUserCreds;
import org.apache.ignite.ci.util.FutureUtil;
import org.apache.ignite.tcbot.common.util.FutureUtil;
import org.apache.ignite.ci.web.CtxListener;
import org.apache.ignite.ci.web.model.current.ChainAtServerCurrentStatus;
import org.apache.ignite.ci.web.model.current.SuiteCurrentStatus;
@@ -30,9 +30,9 @@
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.ci.tcbot.chain.BuildChainProcessor;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
import org.apache.ignite.ci.tcbot.trends.MasterTrendsService;
@@ -28,11 +28,11 @@

import org.apache.ignite.tcignited.buildlog.IBuildLogProcessor;
import org.apache.ignite.tcservice.ITeamcity;
import org.apache.ignite.ci.analysis.FullChainRunCtx;
import org.apache.ignite.ci.analysis.IMultTestOccurrence;
import org.apache.ignite.ci.analysis.MultBuildRunCtx;
import org.apache.ignite.ci.analysis.mode.LatestRebuildMode;
import org.apache.ignite.ci.analysis.mode.ProcessLogsMode;
import org.apache.ignite.tcbot.engine.chain.FullChainRunCtx;
import org.apache.ignite.tcbot.engine.chain.IMultTestOccurrence;
import org.apache.ignite.tcbot.engine.chain.MultBuildRunCtx;
import org.apache.ignite.tcbot.engine.chain.LatestRebuildMode;
import org.apache.ignite.tcbot.engine.chain.ProcessLogsMode;
import org.apache.ignite.tcservice.model.hist.BuildRef;
import org.apache.ignite.tcservice.model.result.tests.TestOccurrence;
import org.apache.ignite.tcservice.model.result.tests.TestOccurrenceFull;
@@ -5,4 +5,5 @@ include 'tcbot-common'
include 'tcbot-persistence'
include 'tcbot-teamcity'
include 'tcbot-teamcity-ignited'
include 'tcbot-engine'

@@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.ignite.ci.util;
package org.apache.ignite.tcbot.common.util;

import java.util.Comparator;
import java.util.List;
@@ -15,19 +15,20 @@
* limitations under the License.
*/

package org.apache.ignite.ci.util;
package org.apache.ignite.tcbot.common.util;

import java.util.Collection;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.stream.Stream;

import org.apache.ignite.tcbot.common.exeption.ExceptionUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
* Async computation util.
*/
@@ -89,7 +90,7 @@ public class FutureUtil {
* @param listBuilds Futures to get builds.
* @return Stream with builds.
*/
@NotNull public static <V> Stream<V> getResults(Collection<Future<V>> listBuilds) {
@Nonnull public static <V> Stream<V> getResults(Collection<Future<V>> listBuilds) {
return listBuilds.stream().map(FutureUtil::getResult);
}
}
@@ -0,0 +1,29 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'java'

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
compile (project(":tcbot-persistence"));
compile (project(":tcbot-teamcity-ignited"));
}

@@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.ignite.ci.analysis;
package org.apache.ignite.tcbot.engine.chain;

import java.util.ArrayList;
import java.util.List;
@@ -24,7 +24,8 @@
import java.util.stream.Stream;
import org.apache.ignite.tcservice.model.result.Build;
import org.apache.ignite.tcbot.common.util.TimeUtil;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nonnull;

/**
*
@@ -85,7 +86,7 @@ private Stream<Long> getDurations() {
/**
* @return sum of durations of all suites printable.
*/
@NotNull public String getDurationPrintable() {
@Nonnull public String getDurationPrintable() {
return (TimeUtil.millisToDurationPrintable(getTotalDuration()))
+ (hasFullDurationInfo() ? "" : "+");
}
@@ -112,7 +113,7 @@ public String getTestsDurationPrintable() {
return (TimeUtil.millisToDurationPrintable(tests));
}

@NotNull public Stream<MultBuildRunCtx> suitesNonComposite() {
@Nonnull public Stream<MultBuildRunCtx> suitesNonComposite() {
return suites().filter(ctx -> !ctx.isComposite());
}

@@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.ignite.ci.analysis;
package org.apache.ignite.tcbot.engine.chain;

import org.apache.ignite.tcservice.model.result.tests.TestOccurrenceFull;
import org.apache.ignite.tcignited.history.IRunHistory;
@@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.ignite.ci.analysis;
package org.apache.ignite.tcbot.engine.chain;

/**
* Results from one or several builds for specific build type.
@@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.ignite.ci.analysis.mode;
package org.apache.ignite.tcbot.engine.chain;

public enum LatestRebuildMode {
/** None rebuilds are applied. */

0 comments on commit 55ca3f4

Please sign in to comment.