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/01/28 13:21:04 UTC
[ignite-teamcity-bot] branch ignite-11105-alias updated:
IGNITE-11105 Support Teamcity servers aliases: Alias implementation started
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a commit to branch ignite-11105-alias
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git
The following commit(s) were added to refs/heads/ignite-11105-alias by this push:
new 89b3320 IGNITE-11105 Support Teamcity servers aliases: Alias implementation started
89b3320 is described below
commit 89b33204c527fdcdb3d5ce63b4ba048d8401a5fe
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Mon Jan 28 16:20:59 2019 +0300
IGNITE-11105 Support Teamcity servers aliases: Alias implementation started
---
.../apache/ignite/ci/IgniteTeamcityConnection.java | 4 +-
.../org/apache/ignite/ci/conf/BranchesTracked.java | 31 +++++++++-
.../org/apache/ignite/ci/jobs/CheckQueueJob.java | 25 +++++---
.../apache/ignite/ci/tcbot/conf/ITcBotConfig.java | 3 +-
...lFilesBasedConfig.java => ITcServerConfig.java} | 28 ++-------
.../ci/tcbot/conf/LocalFilesBasedConfig.java | 22 ++++++-
.../ignite/ci/tcbot/conf/TcServerConfig.java | 68 ++++++++++++++++++++++
.../tcbot/visa/TcBotTriggerAndSignOffService.java | 6 +-
.../teamcity/ignited/TcIgnitedCachingProvider.java | 21 +++++--
.../ignite/ci/web/rest/GetTrackedBranches.java | 8 ++-
.../ci/tcbot/chain/MockBasedTcBotModule.java | 8 ++-
11 files changed, 172 insertions(+), 52 deletions(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
index ae425c2..5f66eef 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgniteTeamcityConnection.java
@@ -28,6 +28,7 @@ import org.apache.ignite.ci.analysis.SingleBuildRunCtx;
import org.apache.ignite.ci.di.AutoProfiling;
import org.apache.ignite.ci.logs.BuildLogStreamChecker;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
+import org.apache.ignite.ci.tcbot.conf.ITcServerConfig;
import org.apache.ignite.ci.tcmodel.agent.Agent;
import org.apache.ignite.ci.tcmodel.agent.AgentsRef;
import org.apache.ignite.ci.tcmodel.changes.Change;
@@ -119,7 +120,8 @@ public class IgniteTeamcityConnection implements ITeamcity {
public void init(@Nullable String tcName) {
this.tcName = tcName;
- final Properties props = config.getTeamcityConfig(tcName);
+ ITcServerConfig tcCfg = this.config.getTeamcityConfig(tcName);
+ final Properties props = tcCfg.properties();
final String hostConf = props.getProperty(HelperConfig.HOST, "https://ci.ignite.apache.org/");
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/conf/BranchesTracked.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/conf/BranchesTracked.java
index 8dc92d0..9f64b05 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/conf/BranchesTracked.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/conf/BranchesTracked.java
@@ -19,6 +19,9 @@ package org.apache.ignite.ci.conf;
import java.util.*;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.annotation.Nullable;
+import org.apache.ignite.ci.tcbot.conf.TcServerConfig;
/**
* Config file for tracked branches.
@@ -27,6 +30,12 @@ public class BranchesTracked {
/** Branches. */
private List<BranchTracked> branches = new ArrayList<>();
+ /** Primary server ID. */
+ @Nullable private String primaryServerId;
+
+ /** Additional list Servers to be used for validation of PRs, but not for tracking any branches. */
+ private List<TcServerConfig> servers = new ArrayList<>();
+
/**
* @return list of internal identifiers of branch.
*/
@@ -34,6 +43,9 @@ public class BranchesTracked {
return branches.stream().map(BranchTracked::getId).collect(Collectors.toList());
}
+ /**
+ * Get Unique suites involved into tracked branches
+ */
public Set<ChainAtServer> getSuitesUnique() {
return branches.stream()
.flatMap(BranchTracked::getChainsStream)
@@ -49,8 +61,17 @@ public class BranchesTracked {
return get(branch).orElseThrow(() -> new RuntimeException("Branch not found: " + branch));
}
+ /**
+ *
+ */
public Set<String> getServerIds() {
- return branches.stream().flatMap(BranchTracked::getChainsStream).map(ChainAtServer::getServerId).collect(Collectors.toSet());
+ Stream<String> srvsInTracked = branches.stream()
+ .flatMap(BranchTracked::getChainsStream)
+ .map(ChainAtServer::getServerId);
+
+ return Stream.concat(srvsInTracked,
+ servers.stream().map(TcServerConfig::getName))
+ .collect(Collectors.toSet());
}
public List<BranchTracked> getBranches() {
@@ -60,4 +81,12 @@ public class BranchesTracked {
public void addBranch(BranchTracked branch) {
branches.add(branch);
}
+
+ @Nullable public String primaryServerId() {
+ return primaryServerId;
+ }
+
+ public Optional<TcServerConfig> getServer(String name) {
+ return servers.stream().filter(s->name.equals(s.getName())).findAny();
+ }
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
index 0b54c5b..22200ba 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jobs/CheckQueueJob.java
@@ -17,12 +17,21 @@
package org.apache.ignite.ci.jobs;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+import java.util.stream.Collectors;
+import javax.inject.Inject;
import jersey.repackaged.com.google.common.base.Throwables;
-import org.apache.ignite.ci.HelperConfig;
import org.apache.ignite.ci.conf.BranchTracked;
import org.apache.ignite.ci.conf.ChainAtServerTracked;
import org.apache.ignite.ci.di.AutoProfiling;
import org.apache.ignite.ci.di.MonitoredTask;
+import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
import org.apache.ignite.ci.tcmodel.agent.Agent;
import org.apache.ignite.ci.tcmodel.result.Build;
import org.apache.ignite.ci.tcmodel.result.Triggered;
@@ -36,12 +45,6 @@ import org.apache.ignite.ci.user.ICredentialsProv;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.inject.Inject;
-import java.text.MessageFormat;
-import java.util.*;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
/**
* Trigger build if half of agents are available and there is no self-triggered builds in build queue.
*/
@@ -66,6 +69,10 @@ public class CheckQueueJob implements Runnable {
@Inject private IStringCompactor compactor;
/** */
+ @Inject private ITcBotConfig cfg;
+
+
+ /** */
private final Map<ChainAtServerTracked, Long> startTimes = new HashMap<>();
/**
@@ -92,13 +99,13 @@ public class CheckQueueJob implements Runnable {
@AutoProfiling
@MonitoredTask(name = "Check Queue")
protected String runEx() {
- if (Boolean.valueOf(System.getProperty(CheckQueueJob.AUTO_TRIGGERING_BUILD_DISABLED))) {
+ if (Boolean.valueOf(System.getProperty(AUTO_TRIGGERING_BUILD_DISABLED))) {
final String msg = "Automatic build triggering was disabled.";
logger.info(msg);
return msg;
}
- List<BranchTracked> tracked = HelperConfig.getTrackedBranches().getBranches();
+ List<BranchTracked> tracked = cfg.getTrackedBranches().getBranches();
if (tracked == null || tracked.isEmpty()) {
final String msg = "Background check queue skipped - no config set for tracked branches.";
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcBotConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcBotConfig.java
index b849173..7281285 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcBotConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcBotConfig.java
@@ -28,7 +28,6 @@ public interface ITcBotConfig {
/** Default server id. */
String DEFAULT_SERVER_ID = "apache";
-
public String primaryServerId();
/**
@@ -50,5 +49,5 @@ public interface ITcBotConfig {
return getTrackedBranches().getServerIds();
}
- public Properties getTeamcityConfig(String srvName);
+ public ITcServerConfig getTeamcityConfig(String srvName);
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcServerConfig.java
similarity index 51%
copy from ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
copy to ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcServerConfig.java
index 1e537dd..dbd826e 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/ITcServerConfig.java
@@ -16,33 +16,13 @@
*/
package org.apache.ignite.ci.tcbot.conf;
-import java.io.File;
import java.util.Properties;
-import org.apache.ignite.ci.HelperConfig;
-import org.apache.ignite.ci.conf.BranchesTracked;
-import org.apache.ignite.ci.di.cache.GuavaCached;
/**
- *
+ * Teamcity Server configuration.
*/
-public class LocalFilesBasedConfig implements ITcBotConfig {
- /** {@inheritDoc} */
- @GuavaCached(softValues = true, expireAfterAccessSecs = 3 * 60)
- @Override public BranchesTracked getTrackedBranches() {
- return HelperConfig.getTrackedBranches();
- }
-
- /** {@inheritDoc} */
- @Override public Properties getTeamcityConfig(String srvName) {
- File workDir = HelperConfig.resolveWorkDir();
-
- String cfgName = HelperConfig.prepareConfigName(srvName);
-
- return HelperConfig.loadAuthProperties(workDir, cfgName);
- }
+public interface ITcServerConfig {
+ public Properties properties();
- /** {@inheritDoc} */
- @Override public String primaryServerId() {
- return ITcBotConfig.DEFAULT_SERVER_ID;
- }
+ public String reference();
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
index 1e537dd..aa00b50 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/LocalFilesBasedConfig.java
@@ -16,6 +16,7 @@
*/
package org.apache.ignite.ci.tcbot.conf;
+import com.google.common.base.Strings;
import java.io.File;
import java.util.Properties;
import org.apache.ignite.ci.HelperConfig;
@@ -33,16 +34,31 @@ public class LocalFilesBasedConfig implements ITcBotConfig {
}
/** {@inheritDoc} */
- @Override public Properties getTeamcityConfig(String srvName) {
+ @Override public ITcServerConfig getTeamcityConfig(String srvName) {
File workDir = HelperConfig.resolveWorkDir();
String cfgName = HelperConfig.prepareConfigName(srvName);
- return HelperConfig.loadAuthProperties(workDir, cfgName);
+ Properties props = HelperConfig.loadAuthProperties(workDir, cfgName);
+
+ TcServerConfig cfg = getTrackedBranches().getServer(srvName)
+ .orElseGet(() -> {
+ TcServerConfig tcCfg = new TcServerConfig();
+
+ tcCfg.name = srvName;
+
+ return tcCfg;
+ });
+
+ cfg.properties(props);
+
+ return cfg;
}
/** {@inheritDoc} */
@Override public String primaryServerId() {
- return ITcBotConfig.DEFAULT_SERVER_ID;
+ String srvId = getTrackedBranches().primaryServerId();
+
+ return Strings.isNullOrEmpty(srvId) ? ITcBotConfig.DEFAULT_SERVER_ID : srvId;
}
}
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
new file mode 100644
index 0000000..e7b7867
--- /dev/null
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/conf/TcServerConfig.java
@@ -0,0 +1,68 @@
+/*
+ * 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.tcbot.conf;
+
+import java.util.Properties;
+import javax.annotation.Nonnull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Teamcity connection configuration or reference to another config.
+ */
+public class TcServerConfig implements ITcServerConfig {
+ /** TC server name. */
+ @Nonnull String name;
+
+ /** Name of server this config points to. This config is just an alias for TC Server. */
+ @Nullable String reference;
+
+ @Nullable private Properties props;
+
+
+ public TcServerConfig() {
+
+ }
+
+ public TcServerConfig(String name, Properties properties) {
+ this.name = name;
+ this.props = properties;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /** {@inheritDoc} */
+ @Override public Properties properties() {
+ if (props == null)
+ return new Properties();
+
+ return props;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String reference() {
+ return reference;
+ }
+
+ /**
+ * @param props Properties.
+ */
+ public void properties(Properties props) {
+ this.props = props;
+ }
+}
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 05031c7..79a068f 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
@@ -51,6 +51,7 @@ 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.ci.tcbot.conf.ITcBotConfig;
import org.apache.ignite.ci.tcmodel.mute.MuteInfo;
import org.apache.ignite.ci.tcmodel.result.Build;
import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
@@ -129,6 +130,8 @@ public class TcBotTriggerAndSignOffService {
@Inject PrChainsProcessor prChainsProcessor;
+ @Inject ITcBotConfig cfg;
+
/** Jackson serializer. */
private final ObjectMapper objMapper = new ObjectMapper();
@@ -639,7 +642,8 @@ public class TcBotTriggerAndSignOffService {
@NotNull public String findDefaultBranchBuildType(String srvId) {
StringBuilder buildTypeId = new StringBuilder();
- HelperConfig.getTrackedBranches().get(DEFAULT_TRACKED_BRANCH_NAME)
+ cfg.getTrackedBranches()
+ .get(DEFAULT_TRACKED_BRANCH_NAME)
.ifPresent(
b -> b.getChainsStream()
.filter(c -> Objects.equals(srvId, c.serverId))
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TcIgnitedCachingProvider.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TcIgnitedCachingProvider.java
index ec1afc9..5891f81 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TcIgnitedCachingProvider.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TcIgnitedCachingProvider.java
@@ -25,6 +25,8 @@ import javax.annotation.Nullable;
import javax.inject.Inject;
import javax.inject.Provider;
import org.apache.ignite.ci.ITeamcity;
+import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
+import org.apache.ignite.ci.tcbot.conf.ITcServerConfig;
import org.apache.ignite.ci.teamcity.restcached.ITcServerProvider;
import org.apache.ignite.ci.user.ICredentialsProv;
import org.apache.ignite.ci.util.ExceptionUtil;
@@ -37,6 +39,8 @@ class TcIgnitedCachingProvider implements ITeamcityIgnitedProvider {
@Inject
private ITcServerProvider srvFactory;
+ @Inject private ITcBotConfig config;
+
@Inject private Provider<TeamcityIgnitedImpl> provider;
private final Cache<String, ITeamcityIgnited> srvs
@@ -47,22 +51,27 @@ class TcIgnitedCachingProvider implements ITeamcityIgnitedProvider {
.build();
/** {@inheritDoc} */
- @Override public ITeamcityIgnited server(String srvId, @Nullable ICredentialsProv prov) {
- String fullKey = Strings.nullToEmpty(prov == null ? null : prov.getUser(srvId)) + ":" + Strings.nullToEmpty(srvId);
+ @Override public ITeamcityIgnited server(String srvIdReq, @Nullable ICredentialsProv prov) {
+ ITcServerConfig cfg = config.getTeamcityConfig(srvIdReq);
+ String ref = cfg.reference();
+
+ String realSrvId = !Strings.isNullOrEmpty(ref) && !srvIdReq.equals(ref) ? ref : srvIdReq;
+
+ String fullKey = Strings.nullToEmpty(prov == null ? null : prov.getUser(realSrvId)) + ":" + Strings.nullToEmpty(realSrvId);
try {
return srvs.get(fullKey, () -> {
- ITeamcity tcRealConn = srvFactory.server(srvId, prov);
+ ITeamcity tcRealConn = srvFactory.server(realSrvId, prov);
if (prov != null) {
- final String user = prov.getUser(srvId);
- final String pwd = prov.getPassword(srvId);
+ final String user = prov.getUser(realSrvId);
+ final String pwd = prov.getPassword(realSrvId);
tcRealConn.setAuthData(user, pwd);
}
TeamcityIgnitedImpl impl = provider.get();
- impl.init(srvId, tcRealConn);
+ impl.init(realSrvId, tcRealConn);
return impl;
});
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetTrackedBranches.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetTrackedBranches.java
index 1d20811..691a86f 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetTrackedBranches.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/GetTrackedBranches.java
@@ -31,7 +31,6 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
-import org.apache.ignite.ci.HelperConfig;
import org.apache.ignite.ci.conf.ChainAtServer;
import org.apache.ignite.ci.tcbot.TcBotGeneralService;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
@@ -76,7 +75,7 @@ public class GetTrackedBranches {
public Set<ChainAtServer> getSuites(@Nullable @QueryParam("server") String srvId) {
final ICredentialsProv prov = ICredentialsProv.get(req);
- return HelperConfig.getTrackedBranches()
+ return CtxListener.getInjector(ctx).getInstance(ITcBotConfig.class).getTrackedBranches()
.getSuitesUnique()
.stream()
.filter(chainAtSrv ->
@@ -86,12 +85,15 @@ public class GetTrackedBranches {
.collect(Collectors.toSet());
}
+ /**
+ * Return all servers registered in TC Bot config: Both from tracked branches and from
+ */
@GET
@Path("getServerIds")
public Set<String> getServerIds() {
final ICredentialsProv prov = ICredentialsProv.get(req);
- return HelperConfig.getTrackedBranches()
+ return CtxListener.getInjector(ctx).getInstance(ITcBotConfig.class)
.getServerIds()
.stream()
.filter(prov::hasAccess)
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 36225f4..f372d9e 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
@@ -33,6 +33,8 @@ import org.apache.ignite.ci.github.pure.IGitHubConnectionProvider;
import org.apache.ignite.ci.jira.pure.IJiraIntegration;
import org.apache.ignite.ci.jira.pure.IJiraIntegrationProvider;
import org.apache.ignite.ci.tcbot.conf.ITcBotConfig;
+import org.apache.ignite.ci.tcbot.conf.ITcServerConfig;
+import org.apache.ignite.ci.tcbot.conf.TcServerConfig;
import org.apache.ignite.ci.tcbot.issue.IIssuesStorage;
import org.apache.ignite.ci.tcbot.user.IUserStorage;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
@@ -110,12 +112,14 @@ public class MockBasedTcBotModule extends AbstractModule {
}
/** {@inheritDoc} */
- @Override public Properties getTeamcityConfig(String srvName) {
+ @Override public ITcServerConfig getTeamcityConfig(String srvName) {
File workDir = HelperConfig.resolveWorkDir();
String cfgName = HelperConfig.prepareConfigName(srvName);
- return HelperConfig.loadAuthProperties(workDir, cfgName);
+ Properties properties = HelperConfig.loadAuthProperties(workDir, cfgName);
+
+ return new TcServerConfig(srvName, properties);
}
});