[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229273660
 
 

 ##
 File path: ignite-tc-helper-web/src/main/webapp/visas.html
 ##
 @@ -0,0 +1,151 @@
+
+
+
+
+Ignite Teamcity - Visas history
+
+https://code.jquery.com/jquery-1.12.4.js";>
+https://code.jquery.com/ui/1.12.1/jquery-ui.js";>
+https://cdn.jsdelivr.net/momentjs/latest/moment.min.js";>
+https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js";>
+https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css; />
+
+https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css;>
+
+https://d3js.org/d3.v4.min.js";>
+https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js";>
+https://cdn.datatables.net/1.10.16/js/dataTables.jqueryui.js";>
+https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css;>
+https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css;>
+
+
+
+
+
+
+
+
+.
+.
+.
+.
+.
+.
+
+
+
+
+

[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229284966
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/TcHelper.java
 ##
 @@ -193,61 +216,87 @@ private String generateJiraComment(
 
 Map> fails = 
findFailures(server);
 
-for (List suites : fails.values()) {
-for (SuiteCurrentStatus suite : suites) {
-
res.append("{color:#d04437}").append(suite.name).append("{color}");
-res.append(" [[tests ").append(suite.failedTests);
+fails.entrySet().forEach(e -> res.addAll(e.getValue()));
+}
+}
+
+return res;
+}
+
+/** */
+private String generateJiraComment(List suites, String 
webUrl) {
+StringBuilder res = new StringBuilder();
 
-if (suite.result != null && !suite.result.isEmpty())
-res.append(' ').append(suite.result);
+for (SuiteCurrentStatus suite : suites) {
+res.append("{color:#d04437}").append(suite.name).append("{color}");
+res.append(" [[tests ").append(suite.failedTests);
 
-
res.append('|').append(suite.webToBuild).append("]]\\n");
+if (suite.result != null && !suite.result.isEmpty())
+res.append(' ').append(suite.result);
 
-for (TestFailure failure : suite.testFailures) {
-res.append("* ");
+res.append('|').append(suite.webToBuild).append("]]\\n");
 
-if (failure.suiteName != null && failure.testName 
!= null)
-res.append(failure.suiteName).append(": 
").append(failure.testName);
-else
-res.append(failure.name);
+for (TestFailure failure : suite.testFailures) {
+res.append("* ");
 
-FailureSummary recent = 
failure.histBaseBranch.recent;
+if (failure.suiteName != null && failure.testName != null)
+res.append(failure.suiteName).append(": 
").append(failure.testName);
+else
 
 Review comment:
   Remove empty line before closing brace.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229307325
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/TcBotTriggerAndSignOffService.java
 ##
 @@ -69,11 +75,60 @@
 /** Helper. */
 @Inject ITcHelper tcHelper;
 
+/** */
+SimpleDateFormat formatter = new SimpleDateFormat("-MM-dd HH:mm:ss");
+
 /** */
 public void startObserver() {
 buildObserverProvider.get();
 }
 
+/** */
+public List getVisasStatus(String srvId, ICredentialsProv 
prov) {
+List visaStatuses = new ArrayList<>();
+
+IAnalyticsEnabledTeamcity teamcity = tcHelper.server(srvId, prov);
+
+for (VisaRequest visaRequest : 
tcHelper.getVisasHistoryStorage().getVisas()) {
+VisaStatus visaStatus = new VisaStatus();
+
+BuildsInfo info = visaRequest.getInfo();
+
+Visa visa = visaRequest.getResult();
+
+visaStatus.date = formatter.format(info.date);
+visaStatus.branchName = info.branchName;
+visaStatus.userName = info.userName;
+visaStatus.ticket = info.ticket;
+
+if (info.isFinished(teamcity)) {
+if (visa != null && visa.isSuccess()) {
+visaStatus.commentUrl = 
"https://issues.apache.org/jira/browse/; + visaStatus.ticket +
+"?focusedCommentId=" + 
visa.getJiraCommentResponse().getId() +
+
"=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-"
 +
+visa.getJiraCommentResponse().getId();
+
+visaStatus.blockers = 
visa.getSuitesStatuses().stream().mapToInt(suite ->
+suite.testFailures.size()).sum();
+
+visaStatus.state = BuildsInfo.FINISHED_STATE;
+}
+else if (visa != null && !visa.isSuccess())
+visaStatus.state = BuildsInfo.FINISHED_WITH_FAILURES_STATE;
+
 
 Review comment:
   Remove empty line.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229271532
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/ITcHelper.java
 ##
 @@ -69,5 +74,5 @@
  * @param ticket JIRA ticket full name.
  * @return {@code True} if JIRA was notified.
  */
-String notifyJira(String srvId, ICredentialsProv prov, String buildTypeId, 
String branchForTc, String ticket);
+Visa notifyJira(String srvId, ICredentialsProv prov, String buildTypeId, 
String branchForTc, String ticket);
 
 Review comment:
   Change javadoc too.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229276186
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildObserver.java
 ##
 @@ -58,10 +63,16 @@ public void stop() {
 /**
  * @param srvId Server id.
  * @param prov Credentials.
+ * @param ticket Ticket.
+ * @param branch Branch.
  * @param ticket JIRA ticket name.
  */
-public void observe(String srvId, ICredentialsProv prov, String ticket, 
Build... builds) {
-observerTask.addBuild(new BuildsInfo(srvId, prov, ticket, builds));
+public void observe(String srvId, ICredentialsProv prov, String ticket, 
String branch, Build... builds) {
 
 Review comment:
   Rename `branch` to `branchForTc`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229284314
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/TcHelper.java
 ##
 @@ -144,44 +160,51 @@ private BranchesTracked getTrackedBranches() {
 List builds = 
teamcity.getFinishedBuildsIncludeSnDepFailed(buildTypeId, branchForTc);
 
 if (builds.isEmpty())
-return "JIRA wasn't commented - no finished builds to analyze.";
+return new Visa().setStatus("JIRA wasn't commented - no finished 
builds to analyze.");
 
 BuildRef build = builds.get(builds.size() - 1);
-String comment;
+
+List suitesStatuses;
+
+JiraCommentResponse response;
 
 try {
-comment = generateJiraComment(buildTypeId, build.branchName, 
srvId, prov, build.webUrl);
+suitesStatuses =  getSuitesStatuses(buildTypeId, build.branchName, 
srvId, prov);
+
+String comment = generateJiraComment(suitesStatuses, build.webUrl);
+
+response = objectMapper.readValue(teamcity.sendJiraComment(ticket, 
comment),
+JiraCommentResponse.class);
 
 Review comment:
   Remove empty line before closing brace.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229272122
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/VisasHistoryStorage.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * 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.model.hist;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import javax.cache.Cache;
+import javax.inject.Inject;
+import javax.inject.Provider;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.ci.db.TcHelperDb;
+import org.apache.ignite.ci.observer.BuildsInfo;
+import org.apache.ignite.ci.web.model.Visa;
+import org.apache.ignite.ci.web.model.VisaRequest;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public class VisasHistoryStorage {
+/** */
+private static final String VISAS_CACHE_NAME = "visasCache";
+
+/** */
+@Inject
+private Ignite ignite;
+
+/** */
+public void clear() {
+visas().clear();
+}
+
+/** */
+private Cache visas() {
+return 
ignite.getOrCreateCache(TcHelperDb.getCacheV2TxConfig(VISAS_CACHE_NAME));
+}
+
+/** */
+public void put(VisaRequest visaRequest) {
+visas().put(visaRequest.getInfo().date, visaRequest);
+}
+
+/** */
+@Nullable public VisaRequest get(Date date) {
+return visas().get(date);
+}
+
+/** */
+public boolean updateVisaRequestResult(Date date, Visa visa) {
+VisaRequest visaRequest = visas().get(date);
 
 Review comment:
   Rename `visaRequest` to `visaReq` or simple `req`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229308341
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/visa/VisaStatus.java
 ##
 @@ -0,0 +1,46 @@
+/*
+ * 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.visa;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public class VisaStatus {
+/** */
+@Nullable public String userName;
+
+/** Branch name. */
+@Nullable public String branchName;
+
+/** JIRA ticket full name. */
+@Nullable public String ticket;
+
+/** */
+@Nullable public String state;
+
+/** */
+@Nullable public String commentUrl;
+
+/** */
+@Nullable public String date;
+
+/** */
+@Nullable public int blockers;
 
 Review comment:
   Can't be null.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229283280
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/TcHelper.java
 ##
 @@ -193,61 +216,87 @@ private String generateJiraComment(
 
 Map> fails = 
findFailures(server);
 
-for (List suites : fails.values()) {
-for (SuiteCurrentStatus suite : suites) {
-
res.append("{color:#d04437}").append(suite.name).append("{color}");
-res.append(" [[tests ").append(suite.failedTests);
+fails.entrySet().forEach(e -> res.addAll(e.getValue()));
 
 Review comment:
   Redundant call `.entrySet()`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229273513
 
 

 ##
 File path: ignite-tc-helper-web/src/main/webapp/visas.html
 ##
 @@ -0,0 +1,151 @@
+
+
+
+
+Ignite Teamcity - Visas history
+
+https://code.jquery.com/jquery-1.12.4.js";>
+https://code.jquery.com/ui/1.12.1/jquery-ui.js";>
+https://cdn.jsdelivr.net/momentjs/latest/moment.min.js";>
+https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js";>
+https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css; />
+
+https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css;>
+
+https://d3js.org/d3.v4.min.js";>
+https://cdn.datatables.net/1.10.16/js/jquery.dataTables.js";>
+https://cdn.datatables.net/1.10.16/js/dataTables.jqueryui.js";>
+https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css;>
+https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css;>
+
+
+
+
+
+
+
+
+.
+.
+.
+.
+.
+.
+
+
+
+
+
+
+function showErrInLoadStatus(jqXHR, exception) {
+if (jqXHR.status === 0) {
+$("#loadStatus").html('Not connect.\n Verify Network.');
+} else if (jqXHR.status === 404) {
+$("#loadStatus").html('Requested page not found. [404]');
+} else if (jqXHR.status === 401) {
+$("#loadStatus").html('Unauthorized [401]');
+
+setTimeout(function() {
+window.location.href = "/login.html" + "?backref=" + 
encodeURIComponent(window.location.href);
+}, 1000);
+} else if (jqXHR.status === 403) {
+$("#loadStatus").html('Forbidden [403]');
+} else if( jqXHR.status === 418) {
+$("#loadStatus").html('Services are starting [418], I\'m a teapot');
+} else if (jqXHR.status === 424) {
+$("#loadStatus").html('Dependency problem: [424]: ' + 
jqXHR.responseText);
+} else if (jqXHR.status === 500) {
+$("#loadStatus").html('Internal Server Error [500].');
+} else if (exception === 'parsererror') {
+$("#loadStatus").html('Requested JSON parse failed.');
+} else if (exception === 'timeout') {
+$("#loadStatus").html('Time out error.');
+} else if (exception === 'abort') {
+$("#loadStatus").html('Ajax request aborted.');
+} else {
+$("#loadStatus").html('Uncaught Error.\n' + jqXHR.responseText);
+}
+}
+
+$(document).ready(function() {
+loadData();
+
+$.ajax({ url: "rest/branches/version",  success: showVersionInfo, error: 
showErrInLoadStatus });
+});
+
+function showVisasTable(result) {
+let visasTable = $('#visasTable');
+
+visasTable.dataTable().fnDestroy();
+
+var table = visasTable.DataTable({
+"order": [[ 1, 'desc' ]],
+data: result,
+"iDisplayLength": 30, //rows to be shown by default
+stateSave: true,
+columnDefs: [
+{
+targets: '_all',
+className: 'dt-body-center'
+},
+],
+columns: [
+{
+"data": "state",
+title: "Status",
+"render": function (data, type, row, meta) {
+if (type === 'display') {
+if (data ==='finished' && row.commentUrl)
+data = "" + data 
+ "";
+}
+
+return data;
+}
+},
+{
+"data": "date",
+title: "Date"
+},
+{
+"data": "userName",
+title: "User"
+},
+{
+"data": "branchName",
+title: "Branch"
+},
+{
+"data": "ticket",
+title: "Ticket"
+},
+{
+"data": "blockers",
+title: "Blockers",
+"render": function (data, type, row, meta) {
+if (type === 'display') {
+if (row.state != 'finished')
+data = "";
+}
+
+return data;
+}
+}
+
+]
+});
+}
+
+function loadData() {
+$.ajax(
+{
+url: "rest/visa/history?serverId=apache",
+success: function (result) {
+showVisasTable(result);
+},
+error: showErrInLoadStatus
+}
+);
+}
+
+
+
 
 Review comment:
   Missed last empty line.


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229282722
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Visa.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * 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.model;
+
+import java.util.ArrayList;
 
 Review comment:
   Unused import.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229282683
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/Visa.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * 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.model;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import org.apache.ignite.ci.TcHelper;
+import org.apache.ignite.ci.jira.IJiraIntegration;
+import org.apache.ignite.ci.web.model.current.SuiteCurrentStatus;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ *
+ */
+public class Visa {
+/** */
+@Nullable private String status;
 
 Review comment:
   Make fields final and replace setters by 2 constructors: with status only 
and with all fields.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229275815
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/BuildsInfo.java
 ##
 @@ -40,37 +54,68 @@
 /** JIRA ticket full name. */
 public final String ticket;
 
+/** */
+public final Date date;
+
 /** Finished builds. */
-private final Map finishedBuilds = new HashMap<>();
+private final Map finishedBuilds = new HashMap<>();
 
 /**
  * @param srvId Server id.
  * @param prov Prov.
  * @param ticket Ticket.
  * @param builds Builds.
  */
-public BuildsInfo(String srvId, ICredentialsProv prov, String ticket, 
Build[] builds) {
+public BuildsInfo(String srvId, ICredentialsProv prov, String ticket, 
String branchName, Build... builds) {
 
 Review comment:
   Rename `branchName` to `branchForTc`.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229273410
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/VisasHistoryStorage.java
 ##
 @@ -0,0 +1,89 @@
+/*
+ * 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.model.hist;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import javax.cache.Cache;
+import javax.inject.Inject;
+import javax.inject.Provider;
 
 Review comment:
   Unused import.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-30 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r229304648
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java
 ##
 @@ -31,7 +32,9 @@
 import org.apache.ignite.ci.di.MonitoredTask;
 import org.apache.ignite.ci.jira.IJiraIntegration;
 import org.apache.ignite.ci.user.ICredentialsProv;
+import org.apache.ignite.ci.web.model.VisaRequest;
 
 Review comment:
   Unused import.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver UNKNOWN build state handling added

2018-10-23 Thread GitBox
SomeFire commented on a change in pull request #40: IGNITE-9939 BuildObserver 
UNKNOWN build state handling added
URL: https://github.com/apache/ignite-teamcity-bot/pull/40#discussion_r227284241
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcmodel/hist/BuildRef.java
 ##
 @@ -181,4 +181,8 @@ public boolean isQueued() {
 public boolean isRunning() {
 return STATE_RUNNING.equals(state());
 }
+
+public boolean isUnknown() {
+return STATUS_UNKNOWN.equals(state());
 
 Review comment:
   State can't be unknown, it can be queued, running or finished. But status 
can be unknown when build is cancelled.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services