SomeFire commented on a change in pull request #25: IGNITE-9645 [TC Bot] Add comparison of failed tests lists in two date intervals URL: https://github.com/apache/ignite-teamcity-bot/pull/25#discussion_r223286626
########## File path: ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/web/rest/build/GetBuildTestFailures.java ########## @@ -159,75 +155,63 @@ public TestFailuresSummary getBuildTestFails( } @GET - @Path("history") - public List<BuildStatisticsSummary> getBuildsHistory( + @Produces(MediaType.TEXT_PLAIN) + @Path("testRef") + public String getTestRef( + @NotNull @QueryParam("testName") String name, + @NotNull @QueryParam("suiteName") String suiteName, @Nullable @QueryParam("server") String srv, - @Nullable @QueryParam("buildType") String buildType, - @Nullable @QueryParam("branch") String branch, - @Nullable @QueryParam("sinceDate") String sinceDate, - @Nullable @QueryParam("untilDate") String untilDate) - throws ServiceUnauthorizedException { - String srvId = isNullOrEmpty(srv) ? "apache" : srv; - String buildTypeId = isNullOrEmpty(buildType) ? "IgniteTests24Java8_RunAll" : buildType; - String branchName = isNullOrEmpty(branch) ? "refs/heads/master" : branch; - Date sinceDateFilter = isNullOrEmpty(sinceDate) ? null : dateParse(sinceDate); - Date untilDateFilter = isNullOrEmpty(untilDate) ? null : dateParse(untilDate); - - final BackgroundUpdater updater = CtxListener.getBackgroundUpdater(ctx); - - final ITcHelper tcHelper = CtxListener.getTcHelper(ctx); + @Nullable @QueryParam("projectId") String projectId) + throws InterruptedException, ExecutionException, ServiceUnauthorizedException { + final ITcHelper helper = CtxListener.getTcHelper(ctx); final ICredentialsProv prov = ICredentialsProv.get(req); - IAnalyticsEnabledTeamcity teamcity = tcHelper.server(srvId, prov); + String project = projectId == null ? "IgniteTests24Java8" : projectId; - int[] finishedBuilds = teamcity.getBuildNumbersFromHistory(buildTypeId, branchName, sinceDateFilter, untilDateFilter); + String srvId = srv == null ? "apache" : srv; - List<BuildStatisticsSummary> buildsStatistics = new ArrayList<>(); + if (!prov.hasAccess(srvId)) + throw ServiceUnauthorizedException.noCreds(srvId); - for (int i = 0; i < finishedBuilds.length; i++) { - int buildId = finishedBuilds[i]; + IAnalyticsEnabledTeamcity teamcity = helper.server(srvId, prov); - FullQueryParams param = new FullQueryParams(); - param.setBuildId(buildId); - param.setBranch(branchName); - param.setServerId(srvId); + FullQueryParams key = new FullQueryParams(); - BuildStatisticsSummary buildsStatistic = updater.get( - BUILDS_STATISTICS_SUMMARY_CACHE_NAME, prov, param, - (k) -> getBuildStatisticsSummaryNoCache(srvId, buildId), false); + key.setTestName(name); Review comment: Redundant empty lines between `set` calls. ---------------------------------------------------------------- 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