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 47b591d IGNITE-10519 JavaDocs added - Fixes #93.
47b591d is described below
commit 47b591d79009a437202c642496d2cadd732fab37
Author: ololo3000 <[email protected]>
AuthorDate: Thu Dec 6 20:55:11 2018 +0300
IGNITE-10519 JavaDocs added - Fixes #93.
Signed-off-by: Dmitriy Pavlov <[email protected]>
---
.../apache/ignite/ci/jira/IJiraIntegration.java | 20 ++++++++--
.../ignite/ci/jira/JiraIntegrationProvider.java | 4 +-
.../CompactVisa.java => jira/package-info.java} | 32 ++--------------
.../apache/ignite/ci/observer/BuildObserver.java | 11 +++++-
.../org/apache/ignite/ci/observer/BuildsInfo.java | 6 +--
.../ignite/ci/observer/CompactBuildsInfo.java | 3 +-
.../apache/ignite/ci/observer/ObserverTask.java | 18 +++++++--
.../apache/ignite/ci/observer/package-info.java | 44 ++++++++++++++++++++++
.../ci/web/model/CompactContributionKey.java | 3 +-
.../apache/ignite/ci/web/model/CompactVisa.java | 3 +-
.../ignite/ci/web/model/CompactVisaRequest.java | 3 +-
11 files changed, 102 insertions(+), 45 deletions(-)
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/IJiraIntegration.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/IJiraIntegration.java
index f7f34e1..d952b2f 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/IJiraIntegration.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/IJiraIntegration.java
@@ -21,19 +21,23 @@ import org.apache.ignite.ci.web.model.Visa;
import org.apache.ignite.ci.user.ICredentialsProv;
/**
- *
+ * Reperesents methods to provide interaction with Jira servers.
*/
public interface IJiraIntegration {
/** Message to show user when JIRA ticket was successfully commented by
the Bot. */
public static String JIRA_COMMENTED = "JIRA commented.";
/**
+ * Produce visa message(see {@link Visa}) based on passed
+ * parameters and publish it as a comment for specified ticket
+ * on Jira server.
+ *
* @param srvId TC Server ID to take information about token from.
* @param prov Credentials.
* @param buildTypeId Suite name.
* @param branchForTc Branch for TeamCity.
* @param ticket JIRA ticket full name. E.g. IGNITE-5555
- * @return {@code True} if JIRA was notified.
+ * @return {@link Visa} instance.
*/
public Visa notifyJira(String srvId, ICredentialsProv prov, String
buildTypeId, String branchForTc,
String ticket);
@@ -44,9 +48,17 @@ public interface IJiraIntegration {
/** */
public void init(String srvId);
- /** */
+ /**
+ * @param ticketFullName Ticket full name (e.g IGNITE-8331)
+ *
+ * @return URL which is used as link to Jira ticket with specified name.
+ */
public String generateTicketUrl(String ticketFullName);
- /** */
+ /**
+ * @param ticketFullName Ticket full name (e.g IGNITE-8331)
+ *
+ * @return URL which is used as link to Jira comment with specified id.
+ */
public String generateCommentUrl(String ticketFullName, int commentId);
}
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/JiraIntegrationProvider.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/JiraIntegrationProvider.java
index b841df3..62a6618 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/JiraIntegrationProvider.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/JiraIntegrationProvider.java
@@ -27,7 +27,9 @@ import javax.inject.Inject;
import org.apache.ignite.ci.util.ExceptionUtil;
/**
- *
+ * Class for providing {@link IJiraIntegration} instance for specified Jira
+ * server. Instance for each server is cached with defining instance
+ * expiration time.
*/
public class JiraIntegrationProvider implements IJiraIntegrationProvider {
/** */
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java
similarity index 52%
copy from
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
copy to
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java
index b739294..7c06326 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/jira/package-info.java
@@ -15,33 +15,9 @@
* limitations under the License.
*/
-package org.apache.ignite.ci.web.model;
-
-import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
-import org.jetbrains.annotations.Nullable;
-
/**
- *
+ * This package is inteneded 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.
*/
-public class CompactVisa {
- /** */
- public final int status;
-
- /** */
- @Nullable public final JiraCommentResponse jiraCommentRes;
-
- /** */
- public final int blockers;
-
- /** */
- public CompactVisa(Visa visa, IStringCompactor strCompactor) {
- this.status = strCompactor.getStringId(visa.status);
- this.blockers = visa.blockers;
- this.jiraCommentRes = visa.getJiraCommentResponse();
- }
-
- /** */
- public Visa toVisa(IStringCompactor strCompactor) {
- return new Visa(strCompactor.getStringFromId(status), jiraCommentRes,
blockers);
- }
-}
+package org.apache.ignite.ci.jira;
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 98287d2..4918c32 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
@@ -29,7 +29,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.
*/
public class BuildObserver {
/** Logger. */
@@ -67,7 +68,13 @@ public class BuildObserver {
timer.cancel();
}
- /** */
+ /**
+ * {@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.
+ */
public boolean stopObservation(ContributionKey key) {
try {
return observerTask.removeBuildInfo(key);
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 6143f54..89dffc3 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
@@ -30,9 +30,9 @@ import org.apache.ignite.ci.user.ICredentialsProv;
import org.apache.ignite.ci.web.model.ContributionKey;
/**
- * Represents parameters to determine context of rerunned builds, list of
build IDs
- * which were requested to rerun and provides methods to check status of
- * rerunned 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. */
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 df70048..9094420 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,7 +25,8 @@ import java.util.Objects;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
/**
- *
+ * Representation of {@link BuildsInfo} with compacted properties for more
+ * effective cache storing.
*/
public class 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 41e19f0..5d127fc 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,6 +44,10 @@ 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.
*/
public class ObserverTask extends TimerTask {
/** Logger. */
@@ -69,7 +73,11 @@ public class ObserverTask extends TimerTask {
ObserverTask() {
}
- /** */
+ /**
+ * 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()
.filter(req -> req.isObserving())
@@ -87,7 +95,11 @@ public class ObserverTask extends TimerTask {
return infos.values();
}
- /** */
+ /**
+ * Add {@link BuildsInfo} for observation.
+ * Observation with similar to given {@link ContributionKey} will be
+ * overwritten.
+ */
public void addInfo(BuildsInfo info) {
visasHistStorage.updateLastVisaRequest(info.getContributionKey(), req
-> req.setObservingStatus(false));
@@ -126,7 +138,7 @@ public class ObserverTask extends TimerTask {
}
/**
- *
+ * That method is runned by {@link ObserverTask} scheduled.
*/
@AutoProfiling
@MonitoredTask(name = "Build Observer")
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/package-info.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/package-info.java
new file mode 100644
index 0000000..f7e1a1c
--- /dev/null
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/package-info.java
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+/**
+ * This package is intended for creating tasks which statuses and
+ * results will be observed scheduled. {@link
org.apache.ignite.ci.observer.BuildObserver},
+ * {@link org.apache.ignite.ci.observer.BuildsInfo} and {@link
org.apache.ignite.ci.observer.ObserverTask} are used for automatic Jira
+ * Visa reporting for every {@link org.apache.ignite.ci.observer.BuildsInfo}
whose builds were finished.
+ * {@link org.apache.ignite.ci.observer.BuildsInfo} is representation of
observation request and contains
+ * context of observed builds. {@link
org.apache.ignite.ci.observer.BuildObserver} is used to run
+ * {@link org.apache.ignite.ci.observer.ObserverTask} scheduled and register
builds which status should be
+ * observed. {@link org.apache.ignite.ci.observer.ObserverTask} uses
+ * {@link org.apache.ignite.ci.web.model.hist.VisasHistoryStorage} as
+ * persistent storage for observed {@link
org.apache.ignite.ci.observer.BuildsInfo} which are stored as
+ * property of {@link org.apache.ignite.ci.web.model.VisaRequest}. It's
+ * assumed that only one {@link org.apache.ignite.ci.observer.BuildsInfo}
observation should be for every
+ * {@link org.apache.ignite.ci.web.model.ContributionKey} in same time. And
+ * {@link org.apache.ignite.ci.web.model.VisaRequest} with which this
+ * observation is connected should be last in
+ * {@link org.apache.ignite.ci.web.model.hist.VisasHistoryStorage} request's
+ * list for specific {@link org.apache.ignite.ci.web.model.ContributionKey}.
+ * It's needed for proper changing of status and result of
+ * {@link org.apache.ignite.ci.web.model.VisaRequest} by {@link
org.apache.ignite.ci.observer.ObserverTask}.
+ * If happens an attempt to add observation
+ * for {@link org.apache.ignite.ci.web.model.ContributionKey} while current
+ * observation is not finished, then current observation will be marked as
+ * cancelled and overwritten by the new one.
+ *
+ */
+package org.apache.ignite.ci.observer;
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactContributionKey.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactContributionKey.java
index 217a961..3cc8814 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactContributionKey.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactContributionKey.java
@@ -21,7 +21,8 @@ import java.util.Objects;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
/**
- *
+ * Representation of {@link ContributionKey} with compacted properties for more
+ * effective cache storing.
*/
public class CompactContributionKey {
/** */
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
index b739294..98dac46 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisa.java
@@ -21,7 +21,8 @@ import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
import org.jetbrains.annotations.Nullable;
/**
- *
+ * Representation of {@link Visa} with compacted properties for more
+ * effective cache storing.
*/
public class CompactVisa {
/** */
diff --git
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisaRequest.java
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisaRequest.java
index 5ce9a71..bf5b896 100644
---
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisaRequest.java
+++
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/CompactVisaRequest.java
@@ -21,7 +21,8 @@ import org.apache.ignite.ci.observer.CompactBuildsInfo;
import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
/**
- *
+ * Representation of {@link CompactVisaRequest} with compacted properties for
more
+ * effective cache storing.
*/
public class CompactVisaRequest {
/** */