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
The following commit(s) were added to refs/heads/master by this push: new ef7ba95 TC Bot modules refactoring: JIRA module extracted, PR processor moved to the engine ef7ba95 is described below commit ef7ba95983cef95891f09bd334ff3556d69a7036 Author: Dmitriy Pavlov <dpav...@apache.org> AuthorDate: Thu Jun 13 15:01:24 2019 +0300 TC Bot modules refactoring: JIRA module extracted, PR processor moved to the engine --- .../org/apache/ignite/ci/di/IgniteTcBotModule.java | 4 +- .../apache/ignite/ci/runners/ClientTmpHelper.java | 2 +- .../ignite/ci/tcbot/conf/JiraServerConfig.java | 2 +- .../tcbot/visa/TcBotTriggerAndSignOffService.java | 13 +- .../ignite/ci/web/rest/parms/FullQueryParams.java | 196 --------------------- .../ignite/ci/web/rest/pr/GetPrTestFailures.java | 2 +- .../rest/tracked/GetTrackedBranchTestResults.java | 4 +- .../ci/tcbot/chain/MockBasedTcBotModule.java | 8 +- .../ci/tcbot/chain/PrChainsProcessorTest.java | 2 + .../IgnitedTcInMemoryIntegrationTest.java | 2 +- settings.gradle | 2 + .../common/conf/IDataSourcesConfigSupplier.java | 2 + tcbot-engine/build.gradle | 2 +- .../tcbot/engine/pr}/BranchTicketMatcher.java | 31 ++-- .../ignite/tcbot/engine/pr}/PrChainsProcessor.java | 30 ++-- {tcbot-engine => tcbot-jira-ignited}/build.gradle | 3 +- .../ignite/ci/jira/ignited/TicketCompacted.java | 14 +- .../apache/ignite/jiraignited}/IJiraIgnited.java | 17 +- .../ignite/jiraignited}/IJiraIgnitedProvider.java | 2 +- .../apache/ignite/jiraignited}/JiraIgnited.java | 9 +- .../ignite/jiraignited}/JiraIgnitedModule.java | 4 +- .../ignite/jiraignited}/JiraIgnitedProvider.java | 6 +- .../apache/ignite/jiraignited}/JiraTicketDao.java | 6 +- .../apache/ignite/jiraignited}/JiraTicketSync.java | 20 +-- tcbot-jira/README.md | 3 + {tcbot-engine => tcbot-jira}/build.gradle | 7 +- .../org/apache/ignite/jiraservice}/Fields.java | 2 +- .../ignite/jiraservice}/IJiraIntegration.java | 3 +- .../jiraservice}/IJiraIntegrationProvider.java | 2 +- .../java/org/apache/ignite/jiraservice}/Jira.java | 7 +- .../ignite/jiraservice}/JiraIntegrationModule.java | 2 +- .../jiraservice}/JiraIntegrationProvider.java | 2 +- .../org/apache/ignite/jiraservice}/Status.java | 2 +- .../org/apache/ignite/jiraservice}/Ticket.java | 6 +- .../org/apache/ignite/jiraservice}/Tickets.java | 4 +- .../apache/ignite/jiraservice}/package-info.java | 2 +- .../tcbot/persistence}/scheduler/NamedTask.java | 2 +- .../persistence}/scheduler/SchedulerModule.java | 3 +- .../persistence}/scheduler/TcBotScheduler.java | 3 +- 39 files changed, 132 insertions(+), 301 deletions(-) diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/IgniteTcBotModule.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/IgniteTcBotModule.java index efed362..dcceff1 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/IgniteTcBotModule.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/IgniteTcBotModule.java @@ -28,9 +28,9 @@ import javax.inject.Provider; 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; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/ClientTmpHelper.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/ClientTmpHelper.java index b114350..58a20b1 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/ClientTmpHelper.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/ClientTmpHelper.java @@ -23,7 +23,7 @@ import org.apache.ignite.ci.db.TcHelperDb; 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. diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java index 0de7cd5..a18b9ea 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/JiraServerConfig.java @@ -19,7 +19,7 @@ package org.apache.ignite.ci.tcbot.conf; 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; 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 e1bdb2c..da034a0 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 @@ -37,19 +37,21 @@ import java.util.stream.Stream; 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(); diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java deleted file mode 100644 index 11d0b56..0000000 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/parms/FullQueryParams.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * 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. - */ - -package org.apache.ignite.ci.web.rest.parms; - -import com.google.common.base.MoreObjects; -import java.util.Objects; -import javax.annotation.Nonnull; -import javax.ws.rs.QueryParam; -import org.jetbrains.annotations.Nullable; - -/** - * Contains maximum combination of query parameters - */ -public class FullQueryParams { - - //see definitions in Index.html javascript - public static final String HISTORY = "History"; - public static final String LATEST = "Latest"; - public static final String CHAIN = "Chain"; - public static final int DEFAULT_COUNT = 10; - - /** Tracked branch name (branch naming in terms of bot). */ - @Nullable @QueryParam("branch") String branch; - - /** Server For not tracked branches. */ - @Nullable @QueryParam("serverId") String serverId; - - /** Suite ID to check. For not tracked branches. */ - @Nonnull @QueryParam("suiteId") String suiteId; - - /** TC identified branch. For not tracked branches. */ - @Nonnull @QueryParam("branchForTc") String branchForTc; - - /** Type of rebuilds loading: */ - @Nonnull @QueryParam("action") String action; - - /** Count of suites to analyze, for multiple runs results. */ - @Nullable @QueryParam("count") Integer count; - - /** Enables all logs to be loaded locally without relation to run/failure category. */ - @Nullable @QueryParam("checkAllLogs") Boolean checkAllLogs; - private Integer buildId; - - /** TC identified base branch: null means the same as <default>, master. For not tracked branches. */ - @Nullable @QueryParam("baseBranchForTc") private String baseBranchForTc; - - /** TC project identifier */ - @Nullable @QueryParam("projectId") String projectId; - - /** TC test name */ - @Nullable @QueryParam("testName") String testName; - - public FullQueryParams() { - } - - public FullQueryParams(String serverId, String suiteId, String branchForTc, String action, Integer count, - String baseBranchForTc) { - this.serverId = serverId; - this.suiteId = suiteId; - this.branchForTc = branchForTc; - this.action = action; - this.count = count; - this.baseBranchForTc = baseBranchForTc; - } - - @Nullable public String getBranch() { - return branch; - } - - @Nullable public String getServerId() { - return serverId; - } - - @Nonnull public String getSuiteId() { - return suiteId; - } - - @Nonnull public String getBranchForTc() { - return branchForTc; - } - - @Nonnull public String getAction() { - return action; - } - - @Nullable public Integer getCount() { - return count; - } - - @Nullable public String getTestName() { - return testName; - } - - @Nullable public String getProjectId() { - return projectId ; - } - - @Nullable public Boolean getCheckAllLogs() { - return checkAllLogs; - } - - /** {@inheritDoc} */ - @Override public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - - FullQueryParams params = (FullQueryParams)o; - - return Objects.equals(branch, params.branch) && - Objects.equals(serverId, params.serverId) && - Objects.equals(suiteId, params.suiteId) && - Objects.equals(branchForTc, params.branchForTc) && - Objects.equals(action, params.action) && - Objects.equals(count, params.count) && - Objects.equals(checkAllLogs, params.checkAllLogs) && - Objects.equals(buildId, params.buildId) && - Objects.equals(baseBranchForTc, params.baseBranchForTc) && - Objects.equals(projectId, params.projectId) && - Objects.equals(testName, params.testName); - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - return Objects.hash(branch, serverId, suiteId, branchForTc, action, count, checkAllLogs, buildId, - baseBranchForTc, projectId, testName); - } - - public void setBranch(@Nullable String branch) { - this.branch = branch; - } - - public void setCheckAllLogs(@Nullable Boolean checkAllLogs) { - this.checkAllLogs = checkAllLogs; - } - - @Override public String toString() { - return MoreObjects.toStringHelper(this) - .add("branch", branch) - .add("serverId", serverId) - .add("suiteId", suiteId) - .add("branchForTc", branchForTc) - .add("action", action) - .add("count", count) - .add("checkAllLogs", checkAllLogs) - .add("buildId", buildId) - .add("baseBranchForTc", baseBranchForTc) - .add("projectId", projectId) - .add("testName", testName) - .toString(); - } - - public void setSuiteId(@Nonnull String suiteId) { - this.suiteId = suiteId; - } - - public void setCount(@Nullable int count) { - this.count = count; - } - - public void setProjectId(@Nullable String projectId) { - this.projectId = projectId; - } - - public void setTestName(@Nullable String testName) { - this.testName = testName; - } - - public void setBuildId(Integer buildId) { - this.buildId = buildId; - } - - public void setServerId(@Nullable String serverId) { - this.serverId = serverId; - } - - public Integer getBuildId() { - return buildId; - } -} diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/pr/GetPrTestFailures.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/pr/GetPrTestFailures.java index 761a497..644a195 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/pr/GetPrTestFailures.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/pr/GetPrTestFailures.java @@ -32,7 +32,7 @@ import javax.ws.rs.core.MediaType; 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; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java index 5d8cce1..e0fbc41 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/tracked/GetTrackedBranchTestResults.java @@ -34,7 +34,6 @@ import org.apache.ignite.ci.user.ITcBotUserCreds; 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 @@ import static org.apache.ignite.tcignited.TeamcityIgnitedImpl.DEFAULT_PROJECT_ID @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 class GetTrackedBranchTestResults { @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) diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java index c8037cb..554b930 100644 --- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java +++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/MockBasedTcBotModule.java @@ -25,10 +25,10 @@ import org.apache.ignite.ci.HelperConfig; 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; diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java index 2dec781..f38ce55 100644 --- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java +++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessorTest.java @@ -27,6 +27,8 @@ import java.util.Optional; 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; diff --git a/ignite-tc-helper-web/src/test/java/org/apache/ignite/tcignited/IgnitedTcInMemoryIntegrationTest.java b/ignite-tc-helper-web/src/test/java/org/apache/ignite/tcignited/IgnitedTcInMemoryIntegrationTest.java index 6afa380..398c8f8 100644 --- a/ignite-tc-helper-web/src/test/java/org/apache/ignite/tcignited/IgnitedTcInMemoryIntegrationTest.java +++ b/ignite-tc-helper-web/src/test/java/org/apache/ignite/tcignited/IgnitedTcInMemoryIntegrationTest.java @@ -26,7 +26,7 @@ import org.apache.ignite.IgniteCache; 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; diff --git a/settings.gradle b/settings.gradle index 67a2d87..423525f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -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' diff --git a/tcbot-common/src/main/java/org/apache/ignite/tcbot/common/conf/IDataSourcesConfigSupplier.java b/tcbot-common/src/main/java/org/apache/ignite/tcbot/common/conf/IDataSourcesConfigSupplier.java index 1b399dd..68873ad 100644 --- a/tcbot-common/src/main/java/org/apache/ignite/tcbot/common/conf/IDataSourcesConfigSupplier.java +++ b/tcbot-common/src/main/java/org/apache/ignite/tcbot/common/conf/IDataSourcesConfigSupplier.java @@ -24,4 +24,6 @@ public interface IDataSourcesConfigSupplier { public ITcServerConfig getTeamcityConfig(String srvCode); public IGitHubConfig getGitConfig(String srvCode); + + public IJiraServerConfig getJiraConfig(String srvCode); } diff --git a/tcbot-engine/build.gradle b/tcbot-engine/build.gradle index bfac9d0..7050ae2 100644 --- a/tcbot-engine/build.gradle +++ b/tcbot-engine/build.gradle @@ -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")); } \ No newline at end of file diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/BranchTicketMatcher.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/BranchTicketMatcher.java similarity index 93% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/BranchTicketMatcher.java rename to tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/BranchTicketMatcher.java index 8876f3a..996da71 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/BranchTicketMatcher.java +++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/BranchTicketMatcher.java @@ -15,24 +15,22 @@ * limitations under the License. */ -package org.apache.ignite.ci.tcbot.visa; +package org.apache.ignite.tcbot.engine.pr; import com.google.common.base.Strings; import org.apache.ignite.githubservice.IGitHubConnection; import org.apache.ignite.tcbot.common.interceptor.GuavaCached; import org.apache.ignite.ci.github.PullRequest; import org.apache.ignite.githubignited.IGitHubConnIgnitedProvider; -import org.apache.ignite.ci.jira.ignited.IJiraIgnitedProvider; -import org.apache.ignite.ci.jira.ignited.TicketCompacted; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraignited.IJiraIgnitedProvider; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.tcbot.common.conf.IGitHubConfig; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; import org.apache.ignite.tcbot.engine.conf.ITcBotConfig; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import javax.inject.Inject; -import javax.ws.rs.QueryParam; import java.util.Collection; import java.util.Objects; @@ -50,8 +48,8 @@ public class BranchTicketMatcher { @Inject private IJiraIgnitedProvider jiraIgnProv; @Nullable public String resolveTcBranchForPrLess(Ticket ticket, - IJiraServerConfig jiraCfg, - IGitHubConfig gitHubCfg) { + IJiraServerConfig jiraCfg, + IGitHubConfig gitHubCfg) { String branchNumPrefix = jiraCfg.branchNumPrefix(); if (Strings.isNullOrEmpty(branchNumPrefix)) { @@ -98,7 +96,7 @@ public class BranchTicketMatcher { if (Strings.isNullOrEmpty(branchNumPrefix)) { //an easy way, no special branch and ticket mappings specified, use project code. - String jiraPrefix = jiraCfg.projectCodeForVisa() + TicketCompacted.PROJECT_DELIM; + String jiraPrefix = jiraCfg.projectCodeForVisa() + Ticket.PROJECT_DELIM; final String ticketKey = findFixPrefixedNumber(pr.getTitle(), jiraPrefix); @@ -173,7 +171,7 @@ public class BranchTicketMatcher { return false; } - @Nullable private String findFixPrefixedNoInValues(@NotNull String prefix, String... values) { + @Nullable private String findFixPrefixedNoInValues(@Nonnull String prefix, String... values) { for (String value : values) { String fixPrefixedNum = findFixPrefixedNumber(value, prefix); @@ -188,7 +186,7 @@ public class BranchTicketMatcher { * @param prefix Ticket prefix. * @return Branch number or null. */ - @Nullable private String findFixPrefixedNumber(@Nullable String val, @NotNull String prefix) { + @Nullable private String findFixPrefixedNumber(@Nullable String val, @Nonnull String prefix) { if (Strings.isNullOrEmpty(val)) return null; @@ -237,7 +235,7 @@ public class BranchTicketMatcher { String branchNumPrefix = jiraCfg.branchNumPrefix(); ticketPrefix = Strings.isNullOrEmpty(branchNumPrefix) - ? jiraCfg.projectCodeForVisa() + TicketCompacted.PROJECT_DELIM + ? jiraCfg.projectCodeForVisa() + Ticket.PROJECT_DELIM : branchNumPrefix; String prLessTicket = prLessTicket(branchForTc, ticketPrefix, gitCfg); @@ -291,9 +289,10 @@ public class BranchTicketMatcher { " or use branch name according ticket name."); } - @Nullable private PullRequest findPrForBranch( - @Nullable @QueryParam("serverId") String srvId, - @Nullable @QueryParam("branchName") String branchForTc) { + @Nullable + private PullRequest findPrForBranch( + @Nullable String srvId, + @Nullable String branchForTc) { Integer prId = IGitHubConnection.convertBranchToPrId(branchForTc); if (prId == null) diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java similarity index 93% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java rename to tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java index f2a45aa..7d4b4d3 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/chain/PrChainsProcessor.java +++ b/tcbot-engine/src/main/java/org/apache/ignite/tcbot/engine/pr/PrChainsProcessor.java @@ -14,13 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.tcbot.chain; +package org.apache.ignite.tcbot.engine.pr; import com.google.common.base.Strings; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; +import javax.annotation.Nullable; import javax.inject.Inject; import org.apache.ignite.ci.github.PullRequest; @@ -28,29 +29,32 @@ import org.apache.ignite.githubservice.IGitHubConnection; import org.apache.ignite.tcbot.engine.chain.*; 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.tcbot.visa.BranchTicketMatcher; -import org.apache.ignite.ci.user.ITcBotUserCreds; +import org.apache.ignite.jiraignited.IJiraIgnited; +import org.apache.ignite.jiraignited.IJiraIgnitedProvider; import org.apache.ignite.tcbot.engine.ui.DsChainUi; import org.apache.ignite.tcbot.engine.ui.DsSuiteUi; import org.apache.ignite.tcbot.engine.ui.DsTestFailureUi; import org.apache.ignite.tcbot.engine.ui.DsSummaryUi; -import org.apache.ignite.ci.web.rest.parms.FullQueryParams; import org.apache.ignite.tcbot.common.interceptor.AutoProfiling; 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.tcignited.creds.ICredentialsProv; import org.apache.ignite.tcignited.history.IRunHistory; import org.apache.ignite.tcignited.history.RunHistSync; import org.apache.ignite.tcservice.ITeamcity; -import org.jetbrains.annotations.Nullable; /** * Process pull request/untracked branch chain at particular server. */ public class PrChainsProcessor { + private static class Action { + public static final String HISTORY = "History"; + public static final String LATEST = "Latest"; + public static final String CHAIN = "Chain"; + } + /** Build chain processor. */ @Inject private BuildChainProcessor buildChainProcessor; @@ -81,7 +85,7 @@ public class PrChainsProcessor { */ @AutoProfiling public DsSummaryUi getTestFailuresSummary( - ITcBotUserCreds creds, + ICredentialsProv creds, String srvCode, String suiteId, String branchForTc, @@ -103,11 +107,11 @@ public class PrChainsProcessor { res.setJavaFlags(gitHubConnIgnited.config(), jiraIntegration.config()); LatestRebuildMode rebuild; - if (FullQueryParams.HISTORY.equals(act)) + if (Action.HISTORY.equals(act)) rebuild = LatestRebuildMode.ALL; - else if (FullQueryParams.LATEST.equals(act)) + else if (Action.LATEST.equals(act)) rebuild = LatestRebuildMode.LATEST; - else if (FullQueryParams.CHAIN.equals(act)) + else if (Action.CHAIN.equals(act)) rebuild = LatestRebuildMode.NONE; else rebuild = LatestRebuildMode.LATEST; @@ -212,13 +216,13 @@ public class PrChainsProcessor { @Nullable public List<DsSuiteUi> getBlockersSuitesStatuses(String buildTypeId, String branchForTc, String srvId, - ITcBotUserCreds prov) { + ICredentialsProv prov) { return getBlockersSuitesStatuses(buildTypeId, branchForTc, srvId, prov, SyncMode.RELOAD_QUEUED); } @Nullable public List<DsSuiteUi> getBlockersSuitesStatuses(String buildTypeId, String branchForTc, String srvId, - ITcBotUserCreds prov, SyncMode syncMode) { + ICredentialsProv prov, SyncMode syncMode) { //using here non persistent TC allows to skip update statistic ITeamcityIgnited tcIgnited = tcIgnitedProvider.server(srvId, prov); diff --git a/tcbot-engine/build.gradle b/tcbot-jira-ignited/build.gradle similarity index 89% copy from tcbot-engine/build.gradle copy to tcbot-jira-ignited/build.gradle index bfac9d0..b8fed7f 100644 --- a/tcbot-engine/build.gradle +++ b/tcbot-jira-ignited/build.gradle @@ -18,8 +18,7 @@ apply plugin: 'java' dependencies { + compile (project(":tcbot-jira")); compile (project(":tcbot-persistence")); - compile (project(":tcbot-teamcity-ignited")); - compile (project(":tcbot-github-ignited")); } \ No newline at end of file diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java similarity index 92% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java index 1f2a699..c11c8b6 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/ci/jira/ignited/TicketCompacted.java @@ -18,18 +18,20 @@ package org.apache.ignite.ci.jira.ignited; import java.util.Objects; -import org.apache.ignite.ci.jira.pure.Fields; -import org.apache.ignite.ci.jira.pure.Status; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.Fields; +import org.apache.ignite.jiraservice.Status; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.ci.tcbot.common.StringFieldCompacted; import org.apache.ignite.tcbot.persistence.IStringCompactor; -import org.jetbrains.annotations.Nullable; +import org.apache.ignite.tcbot.persistence.Persisted; + +import javax.annotation.Nullable; /** * */ +@Persisted public class TicketCompacted { - public static final String PROJECT_DELIM = "-"; /** Id. */ public long id; @@ -70,7 +72,7 @@ public class TicketCompacted { Ticket ticket = new Ticket(); ticket.id = id; - ticket.key = projectCode + PROJECT_DELIM + igniteId; + ticket.key = projectCode + Ticket.PROJECT_DELIM + igniteId; ticket.fields = new Fields(); ticket.fields.status = new Status(comp.getStringFromId(status)); ticket.fields.summary = summary != null ? summary.getValue() : null; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnited.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnited.java similarity index 83% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnited.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnited.java index 24a3086..4eda192 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnited.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnited.java @@ -14,13 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import java.io.IOException; import java.util.Set; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; +import javax.annotation.Nullable; + /** * */ @@ -52,4 +54,15 @@ public interface IJiraIgnited { public String postJiraComment(String ticket, String comment) throws IOException; public IJiraServerConfig config(); + + /** + * @param srvId Server id. + * @return integer representation of server ID. + */ + public static int serverIdToInt(@Nullable final String srvId) { + if (srvId == null) + return 0; + + return Math.abs(srvId.hashCode()); + } } diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnitedProvider.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnitedProvider.java similarity index 95% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnitedProvider.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnitedProvider.java index f1620a2..afaea3f 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/IJiraIgnitedProvider.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/IJiraIgnitedProvider.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; /** * diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnited.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnited.java similarity index 90% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnited.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnited.java index 38190e1..1c75424 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnited.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnited.java @@ -14,15 +14,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import java.io.IOException; import java.util.Set; import javax.inject.Inject; -import org.apache.ignite.ci.jira.pure.IJiraIntegration; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.IJiraIntegration; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; -import org.apache.ignite.tcignited.ITeamcityIgnited; /** * @@ -51,7 +50,7 @@ class JiraIgnited implements IJiraIgnited { srvCode = jira.config().getCode(); - srvIdMaskHigh = ITeamcityIgnited.serverIdToInt(srvCode); + srvIdMaskHigh = IJiraIgnited.serverIdToInt(srvCode); jiraTicketDao.init(); } diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedModule.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedModule.java similarity index 92% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedModule.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedModule.java index 4126b58..c58341f 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedModule.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedModule.java @@ -14,11 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import com.google.inject.AbstractModule; import com.google.inject.internal.SingletonScope; -import org.apache.ignite.ci.jira.pure.JiraIntegrationModule; +import org.apache.ignite.jiraservice.JiraIntegrationModule; /** * diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedProvider.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedProvider.java similarity index 92% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedProvider.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedProvider.java index 50852fe..4f4571b 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraIgnitedProvider.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraIgnitedProvider.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import com.google.common.base.Strings; import com.google.common.cache.Cache; @@ -23,8 +23,8 @@ import com.google.inject.Provider; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import javax.inject.Inject; -import org.apache.ignite.ci.jira.pure.IJiraIntegration; -import org.apache.ignite.ci.jira.pure.IJiraIntegrationProvider; +import org.apache.ignite.jiraservice.IJiraIntegration; +import org.apache.ignite.jiraservice.IJiraIntegrationProvider; import org.apache.ignite.tcbot.common.exeption.ExceptionUtil; /** diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketDao.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketDao.java similarity index 97% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketDao.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketDao.java index c836f05..5956b5a 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketDao.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketDao.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import com.google.common.base.Preconditions; import java.util.Collection; @@ -28,10 +28,10 @@ import javax.inject.Inject; import javax.inject.Provider; import org.apache.ignite.Ignite; import org.apache.ignite.IgniteCache; -import org.apache.ignite.ci.db.TcHelperDb; +import org.apache.ignite.ci.jira.ignited.TicketCompacted; import org.apache.ignite.tcbot.common.interceptor.AutoProfiling; import org.apache.ignite.tcbot.common.interceptor.GuavaCached; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.tcbot.persistence.CacheConfigs; import org.apache.ignite.tcbot.persistence.IStringCompactor; import org.apache.ignite.internal.util.typedef.F; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketSync.java b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketSync.java similarity index 91% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketSync.java rename to tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketSync.java index 6664e87..35eff37 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/ignited/JiraTicketSync.java +++ b/tcbot-jira-ignited/src/main/java/org/apache/ignite/jiraignited/JiraTicketSync.java @@ -15,25 +15,24 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.ignited; +package org.apache.ignite.jiraignited; import java.lang.reflect.Field; import java.util.Arrays; import java.util.Collection; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import javax.annotation.Nonnull; import javax.inject.Inject; import org.apache.ignite.tcbot.common.interceptor.MonitoredTask; import org.apache.ignite.tcbot.persistence.scheduler.IScheduler; -import org.apache.ignite.ci.jira.Tickets; -import org.apache.ignite.ci.jira.pure.Fields; -import org.apache.ignite.ci.jira.pure.IJiraIntegration; -import org.apache.ignite.ci.jira.pure.IJiraIntegrationProvider; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.Tickets; +import org.apache.ignite.jiraservice.Fields; +import org.apache.ignite.jiraservice.IJiraIntegration; +import org.apache.ignite.jiraservice.IJiraIntegrationProvider; +import org.apache.ignite.jiraservice.Ticket; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; -import org.apache.ignite.tcignited.ITeamcityIgnited; import org.apache.ignite.internal.util.typedef.F; -import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -83,7 +82,7 @@ public class JiraTicketSync { * @param srvCode Service ID * @return Task name concatenated with server name. */ - @NotNull + @Nonnull private String taskName(String taskName, String srvCode) { return JiraTicketSync.class.getSimpleName() + "." + taskName + "." + srvCode; } @@ -92,9 +91,10 @@ public class JiraTicketSync { * @param srvCode Server internal identification. * @param fullResync full or incremental. */ + @SuppressWarnings("WeakerAccess") @MonitoredTask(name = "Actualize Jira(srv, full resync)", nameExtArgsIndexes = {0, 1}) protected String actualizeJiraTickets(String srvCode, boolean fullResync) { - int srvIdMaskHigh = ITeamcityIgnited.serverIdToInt(srvCode); + int srvIdMaskHigh = IJiraIgnited.serverIdToInt(srvCode); IJiraIntegration jira = jiraIntegrationProvider.server(srvCode); String reqFields = Arrays.stream(Fields.class.getDeclaredFields()) diff --git a/tcbot-jira/README.md b/tcbot-jira/README.md new file mode 100644 index 0000000..241f970 --- /dev/null +++ b/tcbot-jira/README.md @@ -0,0 +1,3 @@ +TC Bot JIRA (service) module +-------------------------------- +Module for pure (non cached) requests to JIRA service \ No newline at end of file diff --git a/tcbot-engine/build.gradle b/tcbot-jira/build.gradle similarity index 73% copy from tcbot-engine/build.gradle copy to tcbot-jira/build.gradle index bfac9d0..ca6c2cc 100644 --- a/tcbot-engine/build.gradle +++ b/tcbot-jira/build.gradle @@ -18,8 +18,11 @@ apply plugin: 'java' dependencies { + compile (project(":tcbot-common")); + // JIRA integration shares entries for pure and Ignited connection, so persistence module is here for interfaces/annotations compile (project(":tcbot-persistence")); - compile (project(":tcbot-teamcity-ignited")); - compile (project(":tcbot-github-ignited")); + + testCompile group: 'junit', name: 'junit', version: junitVer + testCompile group: 'org.mockito', name: 'mockito-core', version: mockitoVer } \ No newline at end of file diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Fields.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Fields.java similarity index 97% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Fields.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Fields.java index 02ed0b2..914b2c4 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Fields.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Fields.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import com.google.common.base.MoreObjects; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegration.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegration.java similarity index 96% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegration.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegration.java index cfced3c..6d44b9d 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegration.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegration.java @@ -15,10 +15,9 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import java.io.IOException; -import org.apache.ignite.ci.jira.Tickets; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; /** diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegrationProvider.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegrationProvider.java similarity index 95% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegrationProvider.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegrationProvider.java index 984233b..6886518 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/IJiraIntegrationProvider.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/IJiraIntegrationProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; /** * diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Jira.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java similarity index 95% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Jira.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java index cdef647..b2d4943 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Jira.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Jira.java @@ -15,14 +15,13 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import com.google.common.base.Preconditions; import com.google.gson.Gson; +import org.apache.ignite.tcbot.common.conf.IDataSourcesConfigSupplier; import org.apache.ignite.tcbot.common.interceptor.AutoProfiling; -import org.apache.ignite.ci.jira.Tickets; import org.apache.ignite.tcbot.common.conf.IJiraServerConfig; -import org.apache.ignite.tcbot.engine.conf.ITcBotConfig; import org.apache.ignite.tcbot.common.util.HttpUtil; import org.checkerframework.checker.nullness.qual.Nullable; import org.slf4j.Logger; @@ -44,7 +43,7 @@ class Jira implements IJiraIntegration { private String srvCode; /** Config. */ - @Inject ITcBotConfig cfg; + @Inject private IDataSourcesConfigSupplier cfg; /** {@inheritDoc} */ @Override public void init(String srvCode) { diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationModule.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationModule.java similarity index 96% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationModule.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationModule.java index 3c19a9f..325a94e 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationModule.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationModule.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import com.google.inject.AbstractModule; import com.google.inject.internal.SingletonScope; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationProvider.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationProvider.java similarity index 98% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationProvider.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationProvider.java index fcfd473..62d648c 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/JiraIntegrationProvider.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/JiraIntegrationProvider.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import com.google.common.base.Strings; import com.google.common.cache.Cache; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Status.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Status.java similarity index 97% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Status.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Status.java index c1ad37a..3cc37e9 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Status.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Status.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; /** * Status for Jira ticket. diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Ticket.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Ticket.java similarity index 93% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Ticket.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Ticket.java index 256bb3d..2221c6c 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/pure/Ticket.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Ticket.java @@ -15,10 +15,9 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira.pure; +package org.apache.ignite.jiraservice; import com.google.common.base.MoreObjects; -import org.apache.ignite.ci.jira.ignited.TicketCompacted; import javax.annotation.Nullable; @@ -26,6 +25,7 @@ import javax.annotation.Nullable; * See example of GSON here https://issues.apache.org/jira/rest/api/2/issue/IGNITE-123 */ public class Ticket { + public static final String PROJECT_DELIM = "-"; /** Id. */ public long id; @@ -47,7 +47,7 @@ public class Ticket { * @return Ignite ticket Number ignoring project code (like 123 in IGNITE-123). */ public int keyWithoutProject(String projectCode) { - String ticketPrefix = projectCode + TicketCompacted.PROJECT_DELIM; + String ticketPrefix = projectCode + PROJECT_DELIM; return Integer.valueOf(key.substring(ticketPrefix.length())); } diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/Tickets.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Tickets.java similarity index 95% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/Tickets.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Tickets.java index 4ce85c5..125baa6 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/Tickets.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/Tickets.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.ignite.ci.jira; +package org.apache.ignite.jiraservice; import java.util.Collection; import java.util.Collections; -import org.apache.ignite.ci.jira.pure.Ticket; +import org.apache.ignite.jiraservice.Ticket; /** * See example of GSON here https://issues.apache.org/jira/rest/api/2/search?jql=project%20=%20IGNITE%20order%20by%20updated%20DESC&fields=status diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/package-info.java similarity index 96% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java rename to tcbot-jira/src/main/java/org/apache/ignite/jiraservice/package-info.java index f7c4ecf..5699df1 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java +++ b/tcbot-jira/src/main/java/org/apache/ignite/jiraservice/package-info.java @@ -19,4 +19,4 @@ * This package is intended for interacting with Jira servers. It contains classes which is needed for injection Jira * integration service instance via Guice. And interfaces and classes which provide specified functionality. */ -package org.apache.ignite.ci.jira; +package org.apache.ignite.jiraservice; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/NamedTask.java b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/NamedTask.java similarity index 98% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/NamedTask.java rename to tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/NamedTask.java index a5b2c37..8c1ef60 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/NamedTask.java +++ b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/NamedTask.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.di.scheduler; +package org.apache.ignite.tcbot.persistence.scheduler; import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.StampedLock; diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/SchedulerModule.java b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/SchedulerModule.java similarity index 91% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/SchedulerModule.java rename to tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/SchedulerModule.java index 81cd86e..2cd2ea7 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/SchedulerModule.java +++ b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/SchedulerModule.java @@ -15,11 +15,10 @@ * limitations under the License. */ -package org.apache.ignite.ci.di.scheduler; +package org.apache.ignite.tcbot.persistence.scheduler; import com.google.inject.AbstractModule; import com.google.inject.internal.SingletonScope; -import org.apache.ignite.tcbot.persistence.scheduler.IScheduler; public class SchedulerModule extends AbstractModule { /** {@inheritDoc} */ diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/TcBotScheduler.java similarity index 97% rename from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java rename to tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/TcBotScheduler.java index 791ae21..5728e0e 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/di/scheduler/TcBotScheduler.java +++ b/tcbot-persistence/src/main/java/org/apache/ignite/tcbot/persistence/scheduler/TcBotScheduler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.apache.ignite.ci.di.scheduler; +package org.apache.ignite.tcbot.persistence.scheduler; import com.google.common.base.Preconditions; import com.google.common.base.Strings; @@ -30,7 +30,6 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.apache.ignite.tcbot.common.interceptor.MonitoredTask; -import org.apache.ignite.tcbot.persistence.scheduler.IScheduler; import org.slf4j.Logger; import org.slf4j.LoggerFactory;