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/02/18 15:32:50 UTC
[ignite-teamcity-bot] branch master updated (846ae2b -> 064a0d1)
This is an automated email from the ASF dual-hosted git repository.
dpavlov pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git.
from 846ae2b IGNITE-11105 Fix for PR-less contributions in case JIRA tickets/branches mapping is used
new 7198b0a Optimize imports & code formatted for observer package
new 064a0d1 Optimize imports & code formatted for runners package
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/ignite/ci/observer/BuildObserver.java | 10 +++----
.../org/apache/ignite/ci/observer/BuildsInfo.java | 16 ++++-------
.../ignite/ci/observer/CompactBuildsInfo.java | 4 +--
.../apache/ignite/ci/observer/ObserverTask.java | 17 ++++-------
.../apache/ignite/ci/runners/ClientTmpHelper.java | 13 +++------
.../ignite/ci/runners/GenerateStatusHtml.java | 33 +++++++++++++---------
.../runners/IgniteTeamcityHelperRunnerExample.java | 26 +----------------
.../ignite/ci/runners/RemoteClientTmpHelper.java | 13 +++++----
8 files changed, 49 insertions(+), 83 deletions(-)
[ignite-teamcity-bot] 01/02: Optimize imports & code formatted for
observer package
Posted by dp...@apache.org.
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
commit 7198b0ae985ae551a04ee9a9562ec6e6927a82e0
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Mon Feb 18 18:27:37 2019 +0300
Optimize imports & code formatted for observer package
---
.../org/apache/ignite/ci/observer/BuildObserver.java | 10 ++++------
.../java/org/apache/ignite/ci/observer/BuildsInfo.java | 16 ++++++----------
.../apache/ignite/ci/observer/CompactBuildsInfo.java | 4 +---
.../org/apache/ignite/ci/observer/ObserverTask.java | 17 ++++++-----------
4 files changed, 17 insertions(+), 30 deletions(-)
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildObserver.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildObserver.java
index 503889b..c1ee9b4 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildObserver.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildObserver.java
@@ -31,8 +31,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * {@link BuildObserver} provides opportunity for scheduled run of
- * {@link ObserverTask} and controlling existing and new observations.
+ * {@link BuildObserver} provides opportunity for scheduled run of {@link ObserverTask} and controlling existing and new
+ * observations.
*/
public class BuildObserver {
/** Logger. */
@@ -76,11 +76,9 @@ public class BuildObserver {
}
/**
- * {@link ObserverTask} will stop tracking status of observation for
- * specified {@link ContributionKey}.
+ * {@link ObserverTask} will stop tracking status of observation for specified {@link ContributionKey}.
*
- * @return {@code true} if observation which is connected with specified
- * {@link ContributionKey} was stopped.
+ * @return {@code true} if observation which is connected with specified {@link ContributionKey} was stopped.
*/
public boolean stopObservation(ContributionKey key) {
try {
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildsInfo.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildsInfo.java
index bbd01da..9c1165d 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildsInfo.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildsInfo.java
@@ -32,9 +32,8 @@ import org.apache.ignite.ci.user.ICredentialsProv;
import org.apache.ignite.ci.web.model.ContributionKey;
/**
- * Represents parameters to determine context of observed builds, list of build IDs
- * which were requested for observing and provides methods to check status of
- * observed builds.
+ * Represents parameters to determine context of observed builds, list of build IDs which were requested for observing
+ * and provides methods to check status of observed builds.
*/
public class BuildsInfo {
/** Shows that all rerunned builds finished successfully. */
@@ -44,8 +43,7 @@ public class BuildsInfo {
public static final String RUNNING_STATUS = "running";
/**
- * Shows that one or more rerunned builds were cancelled or have UNKNOWN
- * status on TC for some other reasons.
+ * Shows that one or more rerunned builds were cancelled or have UNKNOWN status on TC for some other reasons.
*/
public static final String CANCELLED_STATUS = "cancelled";
@@ -105,9 +103,7 @@ public class BuildsInfo {
/**
* @param teamcity Teamcity.
* @param strCompactor {@link IStringCompactor} instance.
- *
- * @return One of {@link #FINISHED_STATUS}, {@link #CANCELLED_STATUS} or
- * {@link #RUNNING_STATUS} statuses.
+ * @return One of {@link #FINISHED_STATUS}, {@link #CANCELLED_STATUS} or {@link #RUNNING_STATUS} statuses.
*/
public String getStatus(ITeamcityIgnited teamcity, IStringCompactor strCompactor) {
boolean isFinished = true;
@@ -144,14 +140,14 @@ public class BuildsInfo {
/**
* Return builds count.
*/
- public int buildsCount(){
+ public int buildsCount() {
return builds.size();
}
/**
* Return finished builds count.
*/
- public int finishedBuildsCount(ITeamcityIgnited teamcity, IStringCompactor strCompactor){
+ public int finishedBuildsCount(ITeamcityIgnited teamcity, IStringCompactor strCompactor) {
int finishedCnt = 0;
for (Integer id : builds) {
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/CompactBuildsInfo.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/CompactBuildsInfo.java
index 9094420..66f2458 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/CompactBuildsInfo.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/CompactBuildsInfo.java
@@ -25,8 +25,7 @@ import java.util.Objects;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
/**
- * Representation of {@link BuildsInfo} with compacted properties for more
- * effective cache storing.
+ * Representation of {@link BuildsInfo} with compacted properties for more effective cache storing.
*/
public class CompactBuildsInfo {
/** */
@@ -50,7 +49,6 @@ public class CompactBuildsInfo {
/** Builds. */
private final List<Integer> builds = new ArrayList<>();
-
/** */
public CompactBuildsInfo() {
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
index f91bad6..24bd6c7 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
@@ -44,11 +44,9 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Checks observed builds for finished status and comments JIRA ticket.
- * All observations are mapped with {@link ContributionKey} which are produced
- * from BuildsInfo and used as a key for specific observation. It interacts
- * with {@link VisasHistoryStorage} as persistent storage. For more information
- * see package-info.
+ * Checks observed builds for finished status and comments JIRA ticket. All observations are mapped with {@link
+ * ContributionKey} which are produced from BuildsInfo and used as a key for specific observation. It interacts with
+ * {@link VisasHistoryStorage} as persistent storage. For more information see package-info.
*/
public class ObserverTask extends TimerTask {
/** Logger. */
@@ -80,9 +78,8 @@ public class ObserverTask extends TimerTask {
}
/**
- * Connects to {@link VisasHistoryStorage} to get observed
- * {@link VisaRequest}. Chiefly it's used for reconstructing
- * observations after server restart.
+ * Connects to {@link VisasHistoryStorage} to get observed {@link VisaRequest}. Chiefly it's used for reconstructing
+ * observations after server restart.
*/
public void init() {
visasHistStorage.getLastVisas().stream()
@@ -95,15 +92,13 @@ public class ObserverTask extends TimerTask {
return infos.get(key);
}
-
/** */
public Collection<BuildsInfo> getInfos() {
return infos.values();
}
/**
- * Add {@link BuildsInfo} for observation.
- * Observation with similar to given {@link ContributionKey} will be
+ * Add {@link BuildsInfo} for observation. Observation with similar to given {@link ContributionKey} will be
* overwritten.
*/
public void addInfo(BuildsInfo info) {
[ignite-teamcity-bot] 02/02: Optimize imports & code formatted for
runners package
Posted by dp...@apache.org.
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
commit 064a0d1b5814f362bbf934c8fd60d1c120f84c66
Author: Dmitriy Pavlov <dp...@apache.org>
AuthorDate: Mon Feb 18 18:32:44 2019 +0300
Optimize imports & code formatted for runners package
---
.../apache/ignite/ci/runners/ClientTmpHelper.java | 13 +++------
.../ignite/ci/runners/GenerateStatusHtml.java | 33 +++++++++++++---------
.../runners/IgniteTeamcityHelperRunnerExample.java | 26 +----------------
.../ignite/ci/runners/RemoteClientTmpHelper.java | 13 +++++----
4 files changed, 32 insertions(+), 53 deletions(-)
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 35884cc..89912f7 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
@@ -22,7 +22,6 @@ import org.apache.ignite.IgniteCache;
import org.apache.ignite.ci.db.TcHelperDb;
import org.apache.ignite.ci.issue.Issue;
import org.apache.ignite.ci.issue.IssuesStorage;
-import org.apache.ignite.ci.tcbot.user.UserAndSessionsStorage;
/**
* Utility class for local connection to TC helper DB (server) and any manipulations with data needed.
@@ -49,19 +48,15 @@ public class ClientTmpHelper {
public static void main0(String[] args) {
Ignite ignite = TcHelperDb.startClient();
- //ignite.cache(IgnitePersistentTeamcity.ISSUES).clear();
- //ignite.cache(UserAndSessionsStorage.USERS).destroy();
- Object dpavlov = ignite.cache(UserAndSessionsStorage.USERS).get("dpavlov");
-
IgniteCache<Object, Object> cache = ignite.cache(IssuesStorage.BOT_DETECTED_ISSUES);
cache.forEach(
- issue->{
+ issue -> {
Object key = issue.getKey();
- Issue value = (Issue)issue.getValue();
- // value.addressNotified.clear();
+ Issue val = (Issue)issue.getValue();
+ // val.addressNotified.clear();
- cache.put(key, value);
+ cache.put(key, val);
}
);
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/GenerateStatusHtml.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/GenerateStatusHtml.java
index a987ff1..8a87a2c 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/GenerateStatusHtml.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/GenerateStatusHtml.java
@@ -19,14 +19,22 @@ package org.apache.ignite.ci.runners;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.io.Writer;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Properties;
+import java.util.TreeMap;
+import java.util.TreeSet;
+import java.util.function.Predicate;
import org.apache.ignite.ci.IgniteTeamcityConnection;
import org.apache.ignite.ci.tcmodel.conf.BuildType;
import org.apache.ignite.ci.teamcity.pure.TcConnectionStaticLinker;
-import java.io.*;
-import java.util.*;
-import java.util.function.Predicate;
-
import static com.google.common.base.Strings.isNullOrEmpty;
import static org.apache.ignite.ci.util.UrlUtil.escape;
import static org.apache.ignite.ci.util.UrlUtil.escapeOrB64;
@@ -118,7 +126,7 @@ public class GenerateStatusHtml {
HtmlBuilder builder = new HtmlBuilder(writer);
String tabAllId = "all";
- Iterable<String> tabs = Lists.newArrayList(tabAllId) ;
+ Iterable<String> tabs = Lists.newArrayList(tabAllId);
if (groupByResponsible) {
builder.line("<div id=\"tabs\">");
@@ -136,12 +144,10 @@ public class GenerateStatusHtml {
builder.line("Private TC status");
- writeBuildsTable(branchesPriv, privStatuses, builder,
- buildId -> true);
+ writeBuildsTable(branchesPriv, privStatuses, builder, buildId -> true);
builder.line("<br><br>Public TC status");
- writeBuildsTable(branchesPub, pubStatus, builder,
- buildId -> true);
+ writeBuildsTable(branchesPub, pubStatus, builder, buildId -> true);
builder.line("</div>");
@@ -174,7 +180,6 @@ public class GenerateStatusHtml {
writer.write(str + ENDL);
}
-
private static TreeSet<String> allRespPersons(Map privResp, Map pubResp) {
TreeSet<String> respPerson = new TreeSet<>();
@@ -195,7 +200,7 @@ public class GenerateStatusHtml {
" <link rel=\"stylesheet\" href=\"https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css\">\n" +
" <script src=\"https://code.jquery.com/jquery-1.12.4.js\"></script>\n" +
" <script src=\"https://code.jquery.com/ui/1.12.1/jquery-ui.js\"></script>\n");
- if(groupByResponsible) {
+ if (groupByResponsible) {
writer.write(" <script>\n");
writer.write("$( function() {\n" +
@@ -234,7 +239,7 @@ public class GenerateStatusHtml {
"table tr:nth-child(even) td{\n" +
"}" +
" </style>" +
- "</head>");
+ "</head>");
}
private static void writeBuildsTable(
@@ -252,7 +257,7 @@ public class GenerateStatusHtml {
hdr.end("tr");
for (Map.Entry<String, SuiteStatus> suiteStatusEntry : projectStatus.suiteIdToStatusUrl.entrySet()) {
- if(!includeBuildId.test(suiteStatusEntry.getValue().suiteId))
+ if (!includeBuildId.test(suiteStatusEntry.getValue().suiteId))
continue;
final HtmlBuilder row = tbl.start("tr");
@@ -264,7 +269,7 @@ public class GenerateStatusHtml {
for (Branch branch : branches) {
BuildStatusHref statusHref = branches1.branchIdToStatusUrl.get(branch.idForRest);
HtmlBuilder cell = row.start("td");
- cell.line("<a href='" + statusHref.hrefToBuild + "'>" );
+ cell.line("<a href='" + statusHref.hrefToBuild + "'>");
cell.line("<img src='" + statusHref.statusImageSrc + "'/>");
cell.line("</a>");
cell.end("td");
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/IgniteTeamcityHelperRunnerExample.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/IgniteTeamcityHelperRunnerExample.java
index 05ff217..fc6b3f9 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/IgniteTeamcityHelperRunnerExample.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/IgniteTeamcityHelperRunnerExample.java
@@ -15,19 +15,14 @@
* limitations under the License.
*/
-package org.apache.ignite.ci.runners;
+package org.apache.ignite.ci.runners;
-import com.google.common.base.Throwables;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.stream.Collectors;
-
import org.apache.ignite.ci.IgniteTeamcityConnection;
import org.apache.ignite.ci.tcmodel.conf.BuildType;
import org.apache.ignite.ci.tcmodel.conf.bt.BuildTypeFull;
@@ -94,7 +89,6 @@ public class IgniteTeamcityHelperRunnerExample {
duplicates.forEach((k, v) -> {
System.err.println(k + "\t" + v);
});
- ;
}
}
@@ -134,22 +128,4 @@ public class IgniteTeamcityHelperRunnerExample {
System.err.println("Incorrect configuration for dependency from [" + next.bt().getName() + "]");
}
}
-
- private static <T> List<T> getFuturesResults(List<? extends Future<T>> fileFutList) {
- return fileFutList.stream().map(IgniteTeamcityHelperRunnerExample::getFutureResult).collect(Collectors.toList());
- }
-
- private static <T> T getFutureResult(Future<T> fut) {
- try {
- return fut.get();
- }
- catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- throw Throwables.propagate(e);
- }
- catch (ExecutionException e) {
- throw Throwables.propagate(e.getCause());
- }
- }
-
}
diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/RemoteClientTmpHelper.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/RemoteClientTmpHelper.java
index 5413f04..4e3475a 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/RemoteClientTmpHelper.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/runners/RemoteClientTmpHelper.java
@@ -29,16 +29,16 @@ import javax.xml.bind.JAXBException;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
+import org.apache.ignite.ci.tcbot.user.UserAndSessionsStorage;
import org.apache.ignite.ci.tcmodel.hist.BuildRef;
import org.apache.ignite.ci.tcmodel.result.Build;
import org.apache.ignite.ci.teamcity.ignited.BuildRefCompacted;
-import org.apache.ignite.ci.teamcity.ignited.buildref.BuildRefDao;
import org.apache.ignite.ci.teamcity.ignited.ITeamcityIgnited;
import org.apache.ignite.ci.teamcity.ignited.IgniteStringCompactor;
+import org.apache.ignite.ci.teamcity.ignited.buildref.BuildRefDao;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildDao;
import org.apache.ignite.ci.user.TcHelperUser;
-import org.apache.ignite.ci.tcbot.user.UserAndSessionsStorage;
import org.apache.ignite.ci.util.XmlUtil;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.logger.slf4j.Slf4jLogger;
@@ -48,6 +48,9 @@ import org.jetbrains.annotations.NotNull;
import static org.apache.ignite.ci.teamcity.ignited.runhist.RunHistCompactedDao.BUILD_START_TIME_CACHE_NAME;
+/**
+ * Utility class for connecting to a remote server.
+ */
public class RemoteClientTmpHelper {
public static String DUMPS = "dumps";
private static boolean dumpDict = false;
@@ -55,7 +58,7 @@ public class RemoteClientTmpHelper {
public static void mainResetUser(String[] args) {
try (Ignite ignite = tcbotServerConnectedClient()) {
IgniteCache<Object, Object> users = ignite.cache(UserAndSessionsStorage.USERS);
- TcHelperUser user = (TcHelperUser) users.get("user");
+ TcHelperUser user = (TcHelperUser)users.get("user");
user.resetCredentials();
users.put(user.username, user);
}
@@ -116,7 +119,7 @@ public class RemoteClientTmpHelper {
inconsistent.incrementAndGet();
- if(!fat.isOutdatedEntityVersion())
+ if (!fat.isOutdatedEntityVersion())
Preconditions.checkState(false);
}
}
@@ -192,7 +195,7 @@ public class RemoteClientTmpHelper {
return Ignition.start(cfg);
}
- public static void dumpBuildRef(IgniteCache<Long, BuildRefCompacted> cache, int apache, int id) throws IOException {
+ public static void dumpBuildRef(IgniteCache<Long, BuildRefCompacted> cache, int apache, int id) {
long l = BuildRefDao.buildIdToCacheKey(apache, id);
BuildRefCompacted compacted = cache.get(l);
dumpBuildRef(id, compacted);