Skip to content
Permalink
Browse files
TC Bot modules refactoring: JIRA module extracted, PR processor moved…
… to the engine
  • Loading branch information
dspavlov committed Jun 13, 2019
1 parent 6a5572f commit ef7ba95983cef95891f09bd334ff3556d69a7036
Showing 39 changed files with 178 additions and 297 deletions.
@@ -28,9 +28,9 @@
import org.apache.ignite.Ignite;
import org.apache.ignite.ci.db.Ignite1Init;
import org.apache.ignite.ci.di.cache.GuavaCachedModule;
import org.apache.ignite.ci.di.scheduler.SchedulerModule;
import org.apache.ignite.tcbot.persistence.scheduler.SchedulerModule;
import org.apache.ignite.githubignited.GitHubIgnitedModule;
import org.apache.ignite.ci.jira.ignited.JiraIgnitedModule;
import org.apache.ignite.jiraignited.JiraIgnitedModule;
import org.apache.ignite.ci.observer.BuildObserver;
import org.apache.ignite.ci.observer.ObserverTask;
import org.apache.ignite.ci.tcbot.TcBotBusinessServicesModule;
@@ -23,7 +23,7 @@
import org.apache.ignite.githubignited.IGitHubConnIgnited;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssuesStorage;
import org.apache.ignite.ci.jira.ignited.JiraTicketDao;
import org.apache.ignite.jiraignited.JiraTicketDao;

/**
* Utility class for local connection to TC helper DB (server) and any manipulations with data needed.
@@ -19,7 +19,7 @@
import com.google.common.base.Strings;
import java.util.Properties;
import org.apache.ignite.ci.HelperConfig;
import org.apache.ignite.ci.jira.pure.Ticket;
import org.apache.ignite.jiraservice.Ticket;
import org.apache.ignite.tcbot.common.conf.IJiraServerConfig;
import org.apache.ignite.tcbot.common.conf.PasswordEncoder;
import org.jetbrains.annotations.Nullable;
@@ -37,19 +37,21 @@
import javax.annotation.Nonnull;
import javax.inject.Inject;
import javax.ws.rs.QueryParam;

import org.apache.ignite.tcbot.engine.pr.BranchTicketMatcher;
import org.apache.ignite.tcservice.ITeamcity;
import org.apache.ignite.ci.github.GitHubBranch;
import org.apache.ignite.ci.github.GitHubUser;
import org.apache.ignite.ci.github.PullRequest;
import org.apache.ignite.githubignited.IGitHubConnIgnited;
import org.apache.ignite.githubignited.IGitHubConnIgnitedProvider;
import org.apache.ignite.ci.jira.ignited.IJiraIgnited;
import org.apache.ignite.ci.jira.ignited.IJiraIgnitedProvider;
import org.apache.ignite.ci.jira.pure.Ticket;
import org.apache.ignite.jiraignited.IJiraIgnited;
import org.apache.ignite.jiraignited.IJiraIgnitedProvider;
import org.apache.ignite.jiraservice.Ticket;
import org.apache.ignite.ci.observer.BuildObserver;
import org.apache.ignite.ci.observer.BuildsInfo;
import org.apache.ignite.ci.tcbot.ITcBotBgAuth;
import org.apache.ignite.ci.tcbot.chain.PrChainsProcessor;
import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
import org.apache.ignite.tcbot.common.conf.IGitHubConfig;
import org.apache.ignite.tcbot.common.conf.IJiraServerConfig;
import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
@@ -130,7 +132,8 @@ public class TcBotTriggerAndSignOffService {
/** Config. */
@Inject ITcBotConfig cfg;

@Inject BranchTicketMatcher ticketMatcher;
@Inject
BranchTicketMatcher ticketMatcher;

/** Jackson serializer. */
private final ObjectMapper objMapper = new ObjectMapper();

This file was deleted.

@@ -32,7 +32,7 @@
import org.apache.ignite.ci.github.PullRequest;
import org.apache.ignite.githubignited.IGitHubConnIgnited;
import org.apache.ignite.githubignited.IGitHubConnIgnitedProvider;
import org.apache.ignite.ci.tcbot.chain.PrChainsProcessor;
import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
import org.apache.ignite.githubservice.IGitHubConnection;
import org.apache.ignite.tcignited.SyncMode;
import org.apache.ignite.ci.user.ITcBotUserCreds;
@@ -34,7 +34,6 @@
import org.apache.ignite.ci.web.CtxListener;
import org.apache.ignite.tcbot.engine.ui.DsSummaryUi;
import org.apache.ignite.tcbot.engine.ui.UpdateInfo;
import org.apache.ignite.ci.web.rest.parms.FullQueryParams;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.tcignited.ITeamcityIgnitedProvider;
import org.apache.ignite.tcignited.SyncMode;
@@ -48,6 +47,7 @@
@Produces(MediaType.APPLICATION_JSON)
public class GetTrackedBranchTestResults {
public static final String TRACKED = "tracked";
public static final int DEFAULT_COUNT = 10;

/** Servlet Context. */
@Context
@@ -138,7 +138,7 @@ public DsSummaryUi getAllTestFailsForMergedBuidls(@Nullable @QueryParam("branch"
@QueryParam("checkAllLogs") @Nullable Boolean checkAllLogs,
SyncMode mode) {
ITcBotUserCreds creds = ITcBotUserCreds.get(req);
int cntLimit = cnt == null ? FullQueryParams.DEFAULT_COUNT : cnt;
int cntLimit = cnt == null ? DEFAULT_COUNT : cnt;
Injector injector = CtxListener.getInjector(ctx);

return injector.getInstance(TrackedBranchChainsProcessor.class)
@@ -25,10 +25,10 @@
import org.apache.ignite.ci.github.PullRequest;
import org.apache.ignite.githubignited.IGitHubConnIgnited;
import org.apache.ignite.githubignited.IGitHubConnIgnitedProvider;
import org.apache.ignite.ci.jira.ignited.IJiraIgnited;
import org.apache.ignite.ci.jira.ignited.IJiraIgnitedProvider;
import org.apache.ignite.ci.jira.pure.IJiraIntegration;
import org.apache.ignite.ci.jira.pure.IJiraIntegrationProvider;
import org.apache.ignite.jiraignited.IJiraIgnited;
import org.apache.ignite.jiraignited.IJiraIgnitedProvider;
import org.apache.ignite.jiraservice.IJiraIntegration;
import org.apache.ignite.jiraservice.IJiraIntegrationProvider;
import org.apache.ignite.ci.tcbot.conf.TcBotJsonConfig;
import org.apache.ignite.githubservice.IGitHubConnection;
import org.apache.ignite.githubservice.IGitHubConnectionProvider;
@@ -27,6 +27,8 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;

import org.apache.ignite.tcbot.engine.pr.PrChainsProcessor;
import org.apache.ignite.tcservice.ITeamcity;
import org.apache.ignite.tcservice.model.conf.BuildType;
import org.apache.ignite.tcservice.model.hist.BuildRef;
@@ -26,7 +26,7 @@
import org.apache.ignite.Ignition;
import org.apache.ignite.ci.db.TcHelperDb;
import org.apache.ignite.ci.di.scheduler.DirectExecNoWaitScheduler;
import org.apache.ignite.ci.jira.pure.IJiraIntegrationProvider;
import org.apache.ignite.jiraservice.IJiraIntegrationProvider;
import org.apache.ignite.ci.tcbot.chain.PrChainsProcessorTest;
import org.apache.ignite.ci.tcbot.conf.TcBotJsonConfig;
import org.apache.ignite.tcbot.engine.conf.ITcBotConfig;
@@ -7,5 +7,7 @@ include 'tcbot-teamcity'
include 'tcbot-teamcity-ignited'
include 'tcbot-github'
include 'tcbot-github-ignited'
include 'tcbot-jira'
include 'tcbot-jira-ignited'
include 'tcbot-engine'

@@ -24,4 +24,6 @@ public interface IDataSourcesConfigSupplier {
public ITcServerConfig getTeamcityConfig(String srvCode);

public IGitHubConfig getGitConfig(String srvCode);

public IJiraServerConfig getJiraConfig(String srvCode);
}
@@ -18,8 +18,8 @@
apply plugin: 'java'

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

0 comments on commit ef7ba95

Please sign in to comment.