You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by GitBox <gi...@apache.org> on 2018/10/31 21:43:56 UTC
[GitHub] dspavlov commented on a change in pull request #57: IGNITE-9849
Refactor Master trends
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<BuildRefCompacted> getFinishedBuildsCompacted(
+ @Nullable String buildTypeId,
+ @Nullable String branchName,
+ @Nullable Date sinceDate,
+ @Nullable Date untilDate) {
+ int unknownStatus = compactor.getStringId(STATUS_UNKNOWN);
+
+ List<BuildRefCompacted> 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:
users@infra.apache.org
With regards,
Apache Git Services