Skip to content
Permalink
Browse files
Deprecates removal
  • Loading branch information
dspavlov committed Jun 7, 2019
1 parent 55ca3f4 commit 9c2c559c00ac473e0b94a7a911f1bebe832962f1
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 121 deletions.
@@ -111,13 +111,6 @@ private static String prefixedWithServerName(@Nullable String tcName, String nam
return Base64Util.encodeUtf8String(user + ":" + pwd);
}

@Deprecated
public static String getMandatoryProperty(Properties props, String key, String cfgName) {
final String user = props.getProperty(key);
Preconditions.checkState(!isNullOrEmpty(user), key + " property should be filled in " + cfgName);
return user;
}

public static BranchesTracked getTrackedBranches() {
final File workDir = TcBotWorkDir.resolveWorkDir();
final File file = new File(workDir, "branches.json");
@@ -52,40 +52,6 @@ public class DbMigrations {

private static final String BUILD_CONDITIONS_CACHE_NAME = "buildConditions";

//V1 caches, 1024 parts
@Deprecated
public static final String RUN_STAT_CACHE = "runStat";

@Deprecated
public static final String TEST_OCCURRENCE_FULL = "testOccurrenceFull";

@Deprecated
private static final String PROBLEMS = "problems";

@Deprecated
private static final String STAT = "stat";

@Deprecated
private static final String FINISHED_BUILDS = "finishedBuilds";

@Deprecated
public static final String FINISHED_BUILDS_INCLUDE_FAILED = "finishedBuildsIncludeFailed";

@Deprecated
public static final String ISSUES = "issues";

@Deprecated
private static final String BUILD_HIST_FINISHED = "buildHistFinished";

@Deprecated
private static final String BUILD_HIST_FINISHED_OR_FAILED = "buildHistFinishedOrFailed";

@Deprecated
public static final String TEAMCITY_BUILD_CACHE_NAME_OLD = "teamcityBuild";

/** */
@Deprecated
public static final String COMPACT_VISAS_HISTORY_CACHE_NAME = "compactVisasHistoryCache";
public static final String DONE_MIGRATION_PREFIX = "apache";

interface Old {
@@ -123,6 +89,18 @@ interface Old {

//V2 caches, 32 parts (V1 caches were 1024 parts)
String LOG_CHECK_RESULT = "logCheckResult";
//V1 caches, 1024 parts
String RUN_STAT_CACHE = "runStat";
String TEST_OCCURRENCE_FULL = "testOccurrenceFull";
String PROBLEMS = "problems";
String STAT = "stat";
String FINISHED_BUILDS = "finishedBuilds";
String FINISHED_BUILDS_INCLUDE_FAILED = "finishedBuildsIncludeFailed";
String ISSUES = "issues";
String BUILD_HIST_FINISHED = "buildHistFinished";
String BUILD_HIST_FINISHED_OR_FAILED = "buildHistFinishedOrFailed";
String TEAMCITY_BUILD_CACHE_NAME_OLD = "teamcityBuild";
String COMPACT_VISAS_HISTORY_CACHE_NAME = "compactVisasHistoryCache";
}

private final Ignite ignite;
@@ -141,7 +119,7 @@ public String dataMigration() {

int sizeBefore = doneMigrations.size();

applyDestroyCacheMigration(COMPACT_VISAS_HISTORY_CACHE_NAME);
applyDestroyCacheMigration(Old.COMPACT_VISAS_HISTORY_CACHE_NAME);

applyMigration("InitialFillLatestRunsV3", () -> {
});
@@ -150,8 +128,8 @@ public String dataMigration() {


Cache<IssueKey, Issue> issuesCache = IssuesStorage.botDetectedIssuesCache(ignite);
applyMigration(ISSUES + "-to-" + issuesCache.getName() + "V2", () -> {
String cacheName = ISSUES;
applyMigration(Old.ISSUES + "-to-" + issuesCache.getName() + "V2", () -> {
String cacheName = Old.ISSUES;
IgniteCache<IssueKey, Issue> issuesOldCache = ignite.getOrCreateCache(cacheName);

int size = issuesOldCache.size();
@@ -180,11 +158,11 @@ public String dataMigration() {
});

applyDestroyCacheMigration(BUILD_CONDITIONS_CACHE_NAME, BUILD_CONDITIONS_CACHE_NAME);
applyDestroyCacheMigration(TEAMCITY_BUILD_CACHE_NAME_OLD, TEAMCITY_BUILD_CACHE_NAME_OLD);
applyDestroyCacheMigration(Old.TEAMCITY_BUILD_CACHE_NAME_OLD, Old.TEAMCITY_BUILD_CACHE_NAME_OLD);



applyDestroyCacheMigration(COMPACT_VISAS_HISTORY_CACHE_NAME, COMPACT_VISAS_HISTORY_CACHE_NAME);
applyDestroyCacheMigration(Old.COMPACT_VISAS_HISTORY_CACHE_NAME, Old.COMPACT_VISAS_HISTORY_CACHE_NAME);


applyDestroyCacheMigration(Old.SUITE_HIST_CACHE_NAME);
@@ -198,36 +176,36 @@ public String dataMigration() {
if(!DONE_MIGRATION_PREFIX.equals(srvId))
applyDestroyIgnCacheMigration(DONE_MIGRATIONS, srvId);

applyMigration("Remove-" + RUN_STAT_CACHE, () -> {
IgniteCache<String, Build> oldBuilds = ignite.getOrCreateCache(ignCacheNme(RUN_STAT_CACHE, srvId));
applyMigration("Remove-" + Old.RUN_STAT_CACHE, () -> {
IgniteCache<String, Build> oldBuilds = ignite.getOrCreateCache(ignCacheNme(Old.RUN_STAT_CACHE, srvId));

oldBuilds.clear();

oldBuilds.destroy();
});

applyDestroyIgnCacheMigration(TEST_OCCURRENCE_FULL, srvId);
applyDestroyIgnCacheMigration(Old.TEST_OCCURRENCE_FULL, srvId);

applyDestroyIgnCacheMigration(PROBLEMS, srvId);
applyDestroyIgnCacheMigration(Old.PROBLEMS, srvId);

applyDestroyIgnCacheMigration(FINISHED_BUILDS_INCLUDE_FAILED, srvId);
applyDestroyIgnCacheMigration(Old.FINISHED_BUILDS_INCLUDE_FAILED, srvId);
applyDestroyIgnCacheMigration(RUNNING_BUILDS, srvId);

applyDestroyIgnCacheMigration(BUILD_QUEUE, srvId);

applyDestroyIgnCacheMigration(FINISHED_BUILDS_INCLUDE_FAILED, srvId);
applyDestroyIgnCacheMigration(TEST_OCCURRENCE_FULL, srvId);
applyDestroyIgnCacheMigration(Old.FINISHED_BUILDS_INCLUDE_FAILED, srvId);
applyDestroyIgnCacheMigration(Old.TEST_OCCURRENCE_FULL, srvId);

applyDestroyIgnCacheMigration(Old.TESTS, srvId);
applyDestroyIgnCacheMigration(STAT, srvId);
applyDestroyIgnCacheMigration(Old.STAT, srvId);
applyDestroyIgnCacheMigration(BUILD_STATISTICS, srvId);

applyDestroyIgnCacheMigration(Old.CHANGE_INFO_FULL, srvId);
applyDestroyIgnCacheMigration(Old.CHANGES_LIST, srvId);

applyDestroyIgnCacheMigration(FINISHED_BUILDS, srvId);
applyDestroyIgnCacheMigration(BUILD_HIST_FINISHED, srvId);
applyDestroyIgnCacheMigration(BUILD_HIST_FINISHED_OR_FAILED, srvId);
applyDestroyIgnCacheMigration(Old.FINISHED_BUILDS, srvId);
applyDestroyIgnCacheMigration(Old.BUILD_HIST_FINISHED, srvId);
applyDestroyIgnCacheMigration(Old.BUILD_HIST_FINISHED_OR_FAILED, srvId);
applyDestroyIgnCacheMigration(Old.BUILD_PROBLEMS, srvId);
applyDestroyIgnCacheMigration(Old.TEST_FULL, srvId);

@@ -227,27 +227,6 @@ public void initStat(ITeamcityIgnited tcIgnited,
}
}

/**
* @return {@code True} if this failure is appeared in the current branch.
*/
@Deprecated
public boolean isNewFailedTest() {
if (!Strings.isNullOrEmpty(webIssueUrl))
return false;

if (histBaseBranch.latestRuns == null)
return true;

FailureSummary recent = histBaseBranch.recent;

boolean lowFailureRate = recent != null && recent.failureRate != null &&
Float.valueOf(recent.failureRate.replace(',', '.')) < 4.;

//System.out.println(name + " " + recent.failureRate);

return lowFailureRate && histBaseBranch.flakyComments == null;
}

/** {@inheritDoc} */
@Override public boolean equals(Object o) {
if (this == o)
@@ -20,7 +20,7 @@
/**
* Results from one or several builds for specific build type.
*/
public interface ISuiteResults {
interface ISuiteResults {
/** */
public boolean hasCompilationProblem();

@@ -264,8 +264,5 @@ public default String getLatestCommitVersion(FatBuildCompacted build) {
return null;
}

CompletableFuture<File> downloadBuildLogZip(int buildId);


@Nullable File downloadAndCacheBuildLog(int buildId);
}
@@ -477,15 +477,6 @@ public List<Agent> agents(boolean connected, boolean authorized) {
return conn.agents(connected, authorized);
}

@Override
@Deprecated
public CompletableFuture<File> downloadBuildLogZip(int buildId) {
if (conn instanceof ITeamcity)
return ((ITeamcity) conn).downloadBuildLogZip(buildId);

return null;
}

@Nullable
@Override
public File downloadAndCacheBuildLog(int buildId) {
@@ -53,11 +53,6 @@ public interface ITeamcity extends ITeamcityConn {
/** Fake property for addressing 'Suite Name'. */
public String SUITE_NAME_PROPERTY = "_suiteName";

CompletableFuture<File> downloadBuildLogZip(int buildId);

void setExecutor(ExecutorService pool);


/**
* @param tok TeamCity authorization token.
*/
@@ -55,11 +55,7 @@
import javax.xml.bind.JAXBException;
import java.io.*;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
import java.util.stream.Collectors;

import static java.util.concurrent.CompletableFuture.supplyAsync;
@@ -75,9 +71,6 @@ public class TeamcityServiceConnection implements ITeamcity {
/** Logger. */
private static final Logger logger = LoggerFactory.getLogger(TeamcityServiceConnection.class);

/** Executor. */
private Executor executor;

/** TeamCity authorization token. */
private String basicAuthTok;

@@ -90,8 +83,6 @@ public class TeamcityServiceConnection implements ITeamcity {

public void init(@Nullable String srvCode) {
this.srvCode = srvCode;

this.executor = MoreExecutors.directExecutor();
}

@Override public ITcServerConfig config() {
@@ -121,16 +112,6 @@ public void init(@Nullable String srvCode) {
.collect(Collectors.toList());
}

/** {@inheritDoc} */
@AutoProfiling
@Deprecated
public CompletableFuture<File> downloadBuildLogZip(int buildId) {
Supplier<File> supplier = () -> downloadAndCacheBuildLog(buildId);

return supplyAsync(supplier, executor);
}


/** {@inheritDoc} */
@AutoProfiling
public File downloadAndCacheBuildLog(int buildId) {
@@ -327,12 +308,6 @@ private <T> T getJaxbUsingHref(String href, Class<T> elem) {
}


/** {@inheritDoc} */
@AutoProfiling
@Override public void setExecutor(ExecutorService executor) {
this.executor = executor;
}

/**
*
* @throws RuntimeException in case loading failed. See details in {@link ITeamcityConn}.

0 comments on commit 9c2c559

Please sign in to comment.