[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-11-01 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16672068#comment-16672068
 ] 

ASF GitHub Bot commented on IGNITE-9849:


asfgit closed pull request #57: IGNITE-9849 Refactor Master trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/DbMigrations.java 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/DbMigrations.java
index 824dc4a3..121f895e 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/DbMigrations.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/DbMigrations.java
@@ -66,6 +66,8 @@
 
 private static final String BUILD_STATISTICS = "buildStatistics";
 
+private static final String BUILD_CONDITIONS_CACHE_NAME = 
"buildConditions";
+
 public static final String TESTS_COUNT_7700 = ",count:7700";
 
 //V1 caches, 1024 parts
@@ -407,6 +409,7 @@ public void dataMigration(
 applyDestroyIgnCacheMigration(TESTS);
 applyDestroyIgnCacheMigration(STAT);
 applyDestroyIgnCacheMigration(BUILD_STATISTICS);
+applyDestroyIgnCacheMigration(BUILD_CONDITIONS_CACHE_NAME);
 applyDestroyCacheMigration(TEAMCITY_BUILD_CACHE_NAME_OLD, 
TEAMCITY_BUILD_CACHE_NAME_OLD);
 }
 
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefCompacted.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefCompacted.java
index a3aff88e..a0f6d369 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefCompacted.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefCompacted.java
@@ -140,7 +140,7 @@ public int branchName() {
 }
 
 /** */
-private int status() {
+public int status() {
 return status;
 }
 
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefDao.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefDao.java
index 0d7467a9..8a9a2643 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefDao.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/BuildRefDao.java
@@ -34,6 +34,7 @@
 import org.apache.ignite.ci.di.AutoProfiling;
 import org.apache.ignite.ci.di.cache.GuavaCached;
 import org.apache.ignite.ci.tcmodel.hist.BuildRef;
+import org.apache.ignite.ci.teamcity.ignited.fatbuild.FatBuildCompacted;
 import org.apache.ignite.configuration.CacheConfiguration;
 import org.apache.ignite.internal.util.GridIntList;
 import org.jetbrains.annotations.NotNull;
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/ITeamcityIgnited.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/ITeamcityIgnited.java
index cfdaa2eb..3e69094d 100644
--- 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/ITeamcityIgnited.java
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/ITeamcityIgnited.java
@@ -17,9 +17,10 @@
 package org.apache.ignite.ci.teamcity.ignited;
 
 import java.util.Collection;
+import java.util.Date;
 import java.util.List;
 import javax.annotation.Nullable;
-import org.apache.ignite.ci.tcbot.condition.BuildCondition;
+import org.apache.ignite.ci.teamcity.ignited.buildcondition.BuildCondition;
 import org.apache.ignite.ci.tcmodel.hist.BuildRef;
 import org.apache.ignite.ci.tcmodel.result.Build;
 import org.apache.ignite.ci.teamcity.ignited.change.ChangeCompacted;
@@ -40,7 +41,7 @@
 public String host();
 
 /**
- * Retun all builds for branch and suite, without relation to its status.
+ * Return all builds for branch and suite, without relation to its status.
  *
  * @param buildTypeId Build type identifier.
  * @param branchName Branch name.
@@ -50,7 +51,6 @@
 @Nullable String buildTypeId,
 @Nullable String branchName);
 
-
 /**
  * Retun all builds for branch and suite, without relation to its status.
  *
@@ -62,6 +62,21 @@
 @Nullable String buildTypeId,
 @Nullable String branchName);
 
+/**
+ * Return all builds for branch and suite with finish status.
+ *
+ * @param buildTypeId Build type identifier.
+ * @param branchName Branch name.
+ * @param sinceDate Since date.
+ * @param untilDate Until date.
+ * @return list of builds in history in finish status.
+ */
+public List getF

[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670815#comment-16670815
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229881457
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/buildcondition/BuildConditionDao.java
 ##
 @@ -15,18 +15,19 @@
  * limitations under the License.
  */
 
-package org.apache.ignite.ci.tcbot.condition;
+package org.apache.ignite.ci.teamcity.ignited.buildcondition;
 
 import javax.inject.Inject;
 import javax.inject.Provider;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.IgniteCache;
-import org.apache.ignite.ci.db.TcHelperDb;
 import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
 
+import static 
org.apache.ignite.ci.teamcity.ignited.IgniteStringCompactor.getCache8PartsConfig;
+
 public class BuildConditionDao {
 /** Cache name*/
-public static final String BUILD_CONDITIONS_CACHE_NAME = "buildConditions";
+public static final String BUILDS_CONDITIONS_CACHE_NAME = 
"buildsConditions";
 
 Review comment:
   We should add old cache name removal in DbMigrations class. Fewer caches we 
have, faster the bot start is.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670813#comment-16670813
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229880842
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/hist/BuildsHistory.java
 ##
 @@ -92,25 +91,26 @@
 
 /** */
 public void initialize(ICredentialsProv prov, ServletContext context) {
-if (!prov.hasAccess(srvId))
-throw ServiceUnauthorizedException.noCreds(srvId);
+final IStringCompactor compactor = 
CtxListener.getInjector(context).getInstance(IStringCompactor.class);
 
 ITcHelper tcHelper = CtxListener.getTcHelper(context);
 
-IAnalyticsEnabledTeamcity teamcity = tcHelper.server(srvId, prov);
+ITeamcity teamcity = tcHelper.server(srvId, prov);
 
 ITeamcityIgnitedProvider tcIgnitedProv = 
CtxListener.getInjector(context)
 .getInstance(ITeamcityIgnitedProvider.class);
 
-ITeamcityIgnited ignited = tcIgnitedProv.server(srvId, prov);
+ITeamcityIgnited ignitedTeamcity = tcIgnitedProv.server(srvId, prov);
 
-int[] finishedBuildsIds = 
teamcity.getBuildNumbersFromHistory(buildTypeId, branchName,
-sinceDateFilter, untilDateFilter);
+List finishedBuildsIds = ignitedTeamcity
+.getFinishedBuildsCompacted(buildTypeId, branchName, 
sinceDateFilter, untilDateFilter)
 
 Review comment:
   Probably we need filter out canceled builds here. New method may return 
finished build, but having status Unknown. It may mean build was canceled.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670809#comment-16670809
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229880064
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/BuildStatisticsSummary.java
 ##
 @@ -91,122 +96,122 @@ public BuildStatisticsSummary(Integer buildId){
 }
 
 /** Initialize build statistics. */
-public void initialize(@Nonnull final ITeamcity teamcity) {
-Build build = teamcity.getBuild(buildId);
+public void initialize(@Nonnull final IStringCompactor compactor, @Nonnull 
final ITeamcityIgnited ignitedTeamcity) {
+if (strIds.isEmpty()) {
+strIds.put(STATUS_SUCCESS, compactor.getStringId(STATUS_SUCCESS));
+strIds.put(TC_EXIT_CODE, compactor.getStringId(TC_EXIT_CODE));
+strIds.put(TC_OOME, compactor.getStringId(TC_OOME));
+strIds.put(TC_JVM_CRASH, compactor.getStringId(TC_JVM_CRASH));
+strIds.put(TC_EXECUTION_TIMEOUT, 
compactor.getStringId(TC_EXECUTION_TIMEOUT));
+}
+
+FatBuildCompacted build = ignitedTeamcity.getFatBuild(buildId);
 
 isFakeStub = build.isFakeStub();
 
 if (isFakeStub)
 return;
 
 DateFormat dateFormat = new SimpleDateFormat("dd-MM-'T'HH:mm:ss");
-dateFormat.format(build.getFinishDate());
+
 startDate = dateFormat.format(build.getStartDate());
 
-testOccurrences = build.testOccurrences;
+int[] arr = new int[4];
 
-duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
+build.getAllTests().forEach(t -> {
+if (t.getIgnoredFlag())
+arr[0]++;
+else if (t.getMutedFlag())
+arr[1]++;
+else if (t.status() != strIds.get(STATUS_SUCCESS))
+arr[2]++;
 
-List snapshotDependencies = 
getSnapshotDependencies(teamcity, build);
+arr[3]++;
+});
 
-List snapshotDependenciesWithProblems = 
getBuildsWithProblems(snapshotDependencies);
+testOccurrences.ignored = arr[0];
+testOccurrences.muted = arr[1];
+testOccurrences.failed = arr[2];
+testOccurrences.count = arr[3];
+testOccurrences.passed = testOccurrences.count - 
testOccurrences.failed - testOccurrences.ignored -
+testOccurrences.muted;
 
-problemOccurrenceList = getProblems(teamcity, 
snapshotDependenciesWithProblems);
+duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
 
-totalProblems = getRes();
-}
+List snapshotDependencies = 
getSnapshotDependencies(ignitedTeamcity, buildId);
 
-private long getExecutionTimeoutCount(String buildTypeId) {
-return 
getProblemsStream(buildTypeId).filter(ProblemOccurrence::isExecutionTimeout).count();
-}
+List snapshotDependenciesWithProblems = 
getBuildsWithProblems(snapshotDependencies);
 
-private long getJvmCrashProblemCount(String buildTypeId) {
-return 
getProblemsStream(buildTypeId).filter(ProblemOccurrence::isJvmCrash).count();
-}
+problemOccurrenceList = getProblems(snapshotDependenciesWithProblems);
 
-private long getExitCodeProblemsCount(String buildTypeId) {
-return 
getProblemsStream(buildTypeId).filter(ProblemOccurrence::isExitCode).count();
+totalProblems = getBuildTypeProblemsCount();
 }
 
-private long getOomeProblemCount(String buildTypeId) {
-return 
getProblemsStream(buildTypeId).filter(ProblemOccurrence::isOome).count();
+/**
+ * @param problemName Problem name.
+ */
+private long getProblemsCount(String problemName) {
+if (problemOccurrenceList == null)
+return 0;
+
+return problemOccurrenceList.stream()
+.filter(Objects::nonNull)
+.filter(p -> p.type() == strIds.get(problemName)).count();
 }
 
 /**
  * Problems for all snapshot-dependencies.
  *
- * @param teamcity Teamcity.
+ * @param builds Builds.
  */
-private List getProblems(@Nonnull final ITeamcity 
teamcity, List builds){
-List problemOccurrences = new ArrayList<>();
+private List getProblems(List builds){
+List problemOccurrences = new ArrayList<>();
 
-for (BuildRef buildRef : builds)
-problemOccurrences.addAll(teamcity
-.getProblems(buildRef)
-.getProblemsNonNull());
+for (FatBuildCompacted build : builds)
+problemOccurrences.addAll(
+build.problems()
+);
 
 return p

[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670807#comment-16670807
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229879687
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/BuildStatisticsSummary.java
 ##
 @@ -91,122 +96,122 @@ public BuildStatisticsSummary(Integer buildId){
 }
 
 /** Initialize build statistics. */
-public void initialize(@Nonnull final ITeamcity teamcity) {
-Build build = teamcity.getBuild(buildId);
+public void initialize(@Nonnull final IStringCompactor compactor, @Nonnull 
final ITeamcityIgnited ignitedTeamcity) {
+if (strIds.isEmpty()) {
+strIds.put(STATUS_SUCCESS, compactor.getStringId(STATUS_SUCCESS));
+strIds.put(TC_EXIT_CODE, compactor.getStringId(TC_EXIT_CODE));
+strIds.put(TC_OOME, compactor.getStringId(TC_OOME));
+strIds.put(TC_JVM_CRASH, compactor.getStringId(TC_JVM_CRASH));
+strIds.put(TC_EXECUTION_TIMEOUT, 
compactor.getStringId(TC_EXECUTION_TIMEOUT));
+}
+
+FatBuildCompacted build = ignitedTeamcity.getFatBuild(buildId);
 
 isFakeStub = build.isFakeStub();
 
 if (isFakeStub)
 return;
 
 DateFormat dateFormat = new SimpleDateFormat("dd-MM-'T'HH:mm:ss");
-dateFormat.format(build.getFinishDate());
+
 startDate = dateFormat.format(build.getStartDate());
 
-testOccurrences = build.testOccurrences;
+int[] arr = new int[4];
 
-duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
+build.getAllTests().forEach(t -> {
+if (t.getIgnoredFlag())
+arr[0]++;
+else if (t.getMutedFlag())
+arr[1]++;
+else if (t.status() != strIds.get(STATUS_SUCCESS))
+arr[2]++;
 
-List snapshotDependencies = 
getSnapshotDependencies(teamcity, build);
+arr[3]++;
+});
 
-List snapshotDependenciesWithProblems = 
getBuildsWithProblems(snapshotDependencies);
+testOccurrences.ignored = arr[0];
+testOccurrences.muted = arr[1];
+testOccurrences.failed = arr[2];
+testOccurrences.count = arr[3];
+testOccurrences.passed = testOccurrences.count - 
testOccurrences.failed - testOccurrences.ignored -
+testOccurrences.muted;
 
-problemOccurrenceList = getProblems(teamcity, 
snapshotDependenciesWithProblems);
+duration = (build.getFinishDate().getTime() - 
build.getStartDate().getTime()) / 1000;
 
 Review comment:
   Just as an option: we can take build duration from the build statistics, it 
is always provided with new FatBuild


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670805#comment-16670805
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229879186
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/BuildStatisticsSummary.java
 ##
 @@ -66,10 +71,10 @@
 public String startDate;
 
 /** Test occurrences. */
-public TestOccurrencesRef testOccurrences;
+public TestOccurrencesRef testOccurrences = new TestOccurrencesRef();;
 
 Review comment:
   ;; - can remove one


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670806#comment-16670806
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229879300
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/model/current/BuildStatisticsSummary.java
 ##
 @@ -52,8 +57,8 @@
 static {
 shortProblemNames.put(TOTAL, "TT");
 shortProblemNames.put(ProblemOccurrence.TC_EXECUTION_TIMEOUT, "ET");
 
 Review comment:
   We can replace reference to class because of static 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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670803#comment-16670803
 ] 

ASF GitHub Bot commented on IGNITE-9849:


dspavlov commented on a change in pull request #57: IGNITE-9849 Refactor Master 
trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57#discussion_r229878447
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java
 ##
 @@ -116,6 +119,142 @@ private String taskName(String taskName) {
 return conn.host();
 }
 
+/** {@inheritDoc} */
+public List getFinishedBuildsCompacted(
+@Nullable String buildTypeId,
+@Nullable String branchName,
+@Nullable Date sinceDate,
+@Nullable Date untilDate) {
+int unknownStatus = compactor.getStringId(STATUS_UNKNOWN);
+
+List buildRefs = 
getBuildHistoryCompacted(buildTypeId, branchName)
+.stream().filter(b -> b.status() != 
unknownStatus).collect(Collectors.toList());
+
+int idSince = 0;
+int idUntil = buildRefs.size() - 1;
+
+if (sinceDate != null) {
+idSince = binarySearchDate(buildRefs, 0, buildRefs.size(), 
sinceDate, true);
+idSince = idSince == -2 ? 0 : idSince;
 
 Review comment:
   To avoid magic numbers like -1, -2, -3 I can suggest introducing a constants


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-31 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16670662#comment-16670662
 ] 

ASF GitHub Bot commented on IGNITE-9849:


zzzadruga opened a new pull request #57: IGNITE-9849 Refactor Master trends
URL: https://github.com/apache/ignite-teamcity-bot/pull/57
 
 
   


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665099#comment-16665099
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r228495040
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildCondition.java
 ##
 @@ -0,0 +1,91 @@
+/*
+ * 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.condition;
+
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * Mark build as valid or invalid.
 
 Review comment:
   Clarify here: what is valid/invalid build?


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665100#comment-16665100
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r228498911
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -210,10 +255,10 @@ public BuildsHistory getBuildsHistory(
 if (Boolean.valueOf(skipTests))
 builder.skipTests();
 
-BuildsHistory buildsHistory = builder.build();
+BuildsHistory buildsHist = builder.build();
 
-buildsHistory.initialize(ICredentialsProv.get(req), ctx);
+buildsHist.initialize(ICredentialsProv.get(req), ctx);
 
 Review comment:
   Move authorization check outside of `initialize`.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665098#comment-16665098
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r228497136
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildConditionDao.java
 ##
 @@ -0,0 +1,78 @@
+/*
+ * 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.condition;
+
+import javax.inject.Inject;
+import javax.inject.Provider;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.ci.db.TcHelperDb;
+import org.apache.ignite.ci.teamcity.ignited.IStringCompactor;
+
+public class BuildConditionDao {
+/** Cache name*/
+public static final String BUILD_CONDITIONS_CACHE_NAME = "buildConditions";
+
+/** Ignite provider. */
+@Inject private Provider igniteProvider;
+
+/** Builds cache. */
+private IgniteCache buildsCache;
+
+/** Compactor. */
+@Inject private IStringCompactor compactor;
+
+/**
+ * Initialize
+ */
+public void init () {
+Ignite ignite = igniteProvider.get();
+buildsCache = 
ignite.getOrCreateCache(TcHelperDb.getCacheV2Config(BUILD_CONDITIONS_CACHE_NAME));
+}
+
+/**
+ * @param srvIdMaskHigh Server id mask high.
+ * @param buildId Build id.
+ */
+private long buildIdToCacheKey(long srvIdMaskHigh, int buildId) {
+
 
 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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-26 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16665095#comment-16665095
 ] 

ASF GitHub Bot commented on IGNITE-9849:


asfgit closed pull request #38: IGNITE-9849 Remove invalid builds from the 
selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildCondition.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildCondition.java
new file mode 100644
index 000..6a1e0fa
--- /dev/null
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildCondition.java
@@ -0,0 +1,91 @@
+/*
+ * 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.condition;
+
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * Mark build as valid or invalid.
+ */
+public class BuildCondition {
+/** Build id. */
+public int buildId;
+
+/** Username. */
+public String username;
+
+/** Is valid. */
+public boolean isValid;
+
+/** Date. */
+public Date date;
+
+/** Field, where build was marked. */
+public String field;
+
+/**
+ * Default constructor.
+ */
+public BuildCondition(){}
+
+/**
+ * @param buildId Build id.
+ * @param username Username.
+ * @param isValid Is valid.
+ * @param field Field.
+ */
+public BuildCondition(int buildId, String username, boolean isValid, 
String field) {
+this.buildId = buildId;
+this.username = username;
+this.isValid = isValid;
+this.date = new Date();
+this.field = field;
+}
+
+/** {@inheritDoc} */
+@Override public String toString() {
+return "BuildCondition{" +
+"buildId=" + buildId +
+", username='" + username + '\'' +
+", isValid=" + isValid +
+", date=" + date +
+", field='" + field + '\'' +
+'}';
+}
+
+/** {@inheritDoc} */
+@Override public boolean equals(Object o) {
+if (this == o)
+return true;
+
+if (!(o instanceof BuildCondition))
+return false;
+
+BuildCondition that = (BuildCondition)o;
+
+return buildId == that.buildId &&
+isValid == that.isValid &&
+Objects.equals(username, that.username);
+}
+
+/** {@inheritDoc} */
+@Override public int hashCode() {
+return Objects.hash(buildId, username, isValid);
+}
+}
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildConditionCompacted.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildConditionCompacted.java
new file mode 100644
index 000..83beee8
--- /dev/null
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/tcbot/condition/BuildConditionCompacted.java
@@ -0,0 +1,71 @@
+/*
+ * 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.condition;
+
+import java.util.Date;
+import org.apache.ignite.c

[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656713#comment-16656713
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226609586
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -158,6 +164,50 @@ public TestFailuresSummary getBuildTestFails(
 return res;
 }
 
+/**
+ * Mark builds as "valid" or "invalid" for a specific user.
+ *
+ * @param buildId Build id.
+ * @param isValid Is valid.
+ * @param field Field.
+ * @param srv Server.
+ */
+@GET
+@Path("condition")
+public SimpleResult setBuildCondition(
+@QueryParam("buildId") Integer buildId,
+@QueryParam("isValid") Boolean isValid,
+@QueryParam("field") String field,
+@QueryParam("serverId") String srv) {
+String srvId = isNullOrEmpty(srv) ? "apache" : srv;
+
+if (buildId == null || isValid == null)
+return new SimpleResult("" + (buildId == null ?
+("BuildId" + (isValid == null ? "and condition are" : "is")) : 
"Build condition is") + " null!");
+
 
 Review comment:
   ```suggestion
   }
   
   ```


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656712#comment-16656712
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226609952
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -158,6 +164,50 @@ public TestFailuresSummary getBuildTestFails(
 return res;
 }
 
+/**
+ * Mark builds as "valid" or "invalid" for a specific user.
+ *
+ * @param buildId Build id.
+ * @param isValid Is valid.
+ * @param field Field.
+ * @param srv Server.
+ */
+@GET
+@Path("condition")
+public SimpleResult setBuildCondition(
+@QueryParam("buildId") Integer buildId,
+@QueryParam("isValid") Boolean isValid,
+@QueryParam("field") String field,
+@QueryParam("serverId") String srv) {
+String srvId = isNullOrEmpty(srv) ? "apache" : srv;
+
+if (buildId == null || isValid == null)
+return new SimpleResult("" + (buildId == null ?
+("BuildId" + (isValid == null ? "and condition are" : "is")) : 
"Build condition is") + " null!");
+
+final ITcHelper tcHelper = CtxListener.getTcHelper(ctx);
+
+final ICredentialsProv prov = ICredentialsProv.get(req);
+
 
 Review comment:
   ```suggestion
   
   if (!prov.hasAccess(serverId))
   throw ServiceUnauthorizedException.noCreds(serverId);
   
   ```


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656706#comment-16656706
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226609918
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -158,6 +164,50 @@ public TestFailuresSummary getBuildTestFails(
 return res;
 }
 
+/**
+ * Mark builds as "valid" or "invalid" for a specific user.
+ *
+ * @param buildId Build id.
+ * @param isValid Is valid.
+ * @param field Field.
+ * @param srv Server.
+ */
+@GET
+@Path("condition")
+public SimpleResult setBuildCondition(
+@QueryParam("buildId") Integer buildId,
+@QueryParam("isValid") Boolean isValid,
+@QueryParam("field") String field,
+@QueryParam("serverId") String srv) {
+String srvId = isNullOrEmpty(srv) ? "apache" : srv;
+
+if (buildId == null || isValid == null)
+return new SimpleResult("" + (buildId == null ?
+("BuildId" + (isValid == null ? "and condition are" : "is")) : 
"Build condition is") + " null!");
+
+final ITcHelper tcHelper = CtxListener.getTcHelper(ctx);
+
 
 Review comment:
   ```suggestion
   ```


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656708#comment-16656708
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226610891
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -185,25 +233,33 @@ public TestFailuresSummary getBuildTestFails(
 
 List buildsStatistics = new ArrayList<>();
 
-for (int i = 0; i < finishedBuilds.length; i++) {
-int buildId = finishedBuilds[i];
+String username = prov.getPrincipalId();
 
-FullQueryParams param = new FullQueryParams();
-param.setBuildId(buildId);
-param.setBranch(branchName);
-param.setServerId(srvId);
+Set buildIds = teamcity.getBuildConditions(username).stream()
+.mapToInt(v -> v.buildId).boxed().collect(Collectors.toSet());
 
-BuildStatisticsSummary buildsStatistic = updater.get(
-BUILDS_STATISTICS_SUMMARY_CACHE_NAME, prov, param,
-(k) -> getBuildStatisticsSummaryNoCache(srvId, buildId), 
false);
+System.out.println(buildIds);
 
 Review comment:
   Use logger or remove sout.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656710#comment-16656710
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226618991
 
 

 ##
 File path: ignite-tc-helper-web/src/main/webapp/comparison.html
 ##
 @@ -285,7 +308,31 @@
 fillCellWithStatistics(tOcc[i], num, statistics, dates, buildIds);
 }
 
-$('#RunsCount' + num).html(map.length);
+printRunsCount();
+
+function printRunsCount(){
 
 Review comment:
   Move function outside of function.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656709#comment-16656709
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226607074
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IgnitePersistentTeamcity.java
 ##
 @@ -672,6 +683,32 @@ public static int getTriggerRelCacheValidSecs(int 
defaultSecs) {
 secondsUseCached == defaultSecs);
 }
 
+/** {@inheritDoc} */
+public Set getBuildConditions(String username) {
+final IgniteCache> cache = 
buildsConditionsCache();
+
+return cache.containsKey(username) ? cache.get(username) : new 
HashSet<>();
+}
+
+/** {@inheritDoc} */
+public boolean setBuildCondition(BuildCondition buildCond) {
+
 
 Review comment:
   ```suggestion
   ```


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656711#comment-16656711
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226620120
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/IAnalyticsEnabledTeamcity.java
 ##
 @@ -17,9 +17,24 @@
 
 package org.apache.ignite.ci;
 
+import java.util.Set;
+import org.apache.ignite.ci.analysis.BuildCondition;
+
 /**
  * Combination of REST data and persisted statistics.
  */
 public interface IAnalyticsEnabledTeamcity extends ITeamcity, ITcAnalytics {
 public void init(ITeamcity conn);
+
+/**
+ *  Set condition "valid" or "invalid" for build.
 
 Review comment:
   ```suggestion
* Set condition "valid" or "invalid" for build.
   ```


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656714#comment-16656714
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226609558
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java
 ##
 @@ -158,6 +164,50 @@ public TestFailuresSummary getBuildTestFails(
 return res;
 }
 
+/**
+ * Mark builds as "valid" or "invalid" for a specific user.
+ *
+ * @param buildId Build id.
+ * @param isValid Is valid.
+ * @param field Field.
+ * @param srv Server.
+ */
+@GET
+@Path("condition")
+public SimpleResult setBuildCondition(
+@QueryParam("buildId") Integer buildId,
+@QueryParam("isValid") Boolean isValid,
+@QueryParam("field") String field,
+@QueryParam("serverId") String srv) {
+String srvId = isNullOrEmpty(srv) ? "apache" : srv;
+
+if (buildId == null || isValid == null)
 
 Review comment:
   ```suggestion
   if (buildId == null || isValid == 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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (IGNITE-9849) Remove invalid builds from the selection

2018-10-19 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/IGNITE-9849?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16656707#comment-16656707
 ] 

ASF GitHub Bot commented on IGNITE-9849:


SomeFire commented on a change in pull request #38: IGNITE-9849 Remove invalid 
builds from the selection
URL: https://github.com/apache/ignite-teamcity-bot/pull/38#discussion_r226607589
 
 

 ##
 File path: 
ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/analysis/BuildCondition.java
 ##
 @@ -0,0 +1,79 @@
+/*
+ * 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.analysis;
+
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * Mark build as valid or invalid.
+ */
+public class BuildCondition {
+/** Build id. */
+public int buildId;
 
 Review comment:
   Add empty lines between field declarations and make fields `final`.


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


> Remove invalid builds from the selection
> 
>
> Key: IGNITE-9849
> URL: https://issues.apache.org/jira/browse/IGNITE-9849
> Project: Ignite
>  Issue Type: Sub-task
>Reporter: Nikolai Kulagin
>Assignee: Nikolai Kulagin
>Priority: Minor
>
> In selection sometimes there are builds with abnormal values. For example, 
> the average number of failed tests is 25. But in the build [1953935] there 
> are 2939 failed tests. This is an anomalous value. Need to add the ability to 
> remove it from the selection. Build [1953935] - not valid.
> In total, 
> 1. While clicking on a point on the chart, show a button that allows marking 
> a build invalid and excludes it from further selections.
> 2. Reduce the number of erroneous exceptions. Compare the value with the 
> average, if the difference is small - ask for confirmation of the operation.
> 3. Add the ability to return an excluded build to the selection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)