[ https://issues.apache.org/jira/browse/IGNITE-10203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697166#comment-16697166 ]
ASF GitHub Bot commented on IGNITE-10203: ----------------------------------------- SomeFire commented on a change in pull request #78: IGNITE-10203 Support for alternative configurations for PR testing URL: https://github.com/apache/ignite-teamcity-bot/pull/78#discussion_r235948717 ########## File path: ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/teamcity/ignited/TeamcityIgnitedImpl.java ########## @@ -308,6 +330,120 @@ else if (midValStartDate.before(key)) return chains; } + /** + * Actualize saved list of composite suites for project. + * + * @param projectId Project id. + */ + private void actualizeSavedCompositeBuildTypesIds(String projectId) { + if (projectId.equals(DEFAULT_PROJECT_ID)) { + compositeBuildTypesIdsForDefaultProject = + fatBuildTypeDao.compositeBuildTypesIdsSortedByBuildNumberCounter(srvIdMaskHigh, projectId); + } + } + + /** {@inheritDoc} */ + @Override public List<String> getCompositeBuildTypesIdsSortedByBuildNumberCounter(String projectId) { + ensureActualizeBuildTypeRefsRequested(); + ensureActualizeBuildTypesRequested(); + + return projectId.equals(DEFAULT_PROJECT_ID) ? compositeBuildTypesIdsForDefaultProject : + fatBuildTypeDao.compositeBuildTypesIdsSortedByBuildNumberCounter(srvIdMaskHigh, projectId); + } + + /** {@inheritDoc} */ + @Override public List<BuildTypeRefCompacted> getAllBuildTypesCompacted(String projectId) { + ensureActualizeBuildTypeRefsRequested(); + + return buildTypeRefDao.buildTypesCompacted(srvIdMaskHigh, projectId); + } + + /** + * Ensure actualize BuildTypeRefs requested. Add this task to scheduler. + */ + private void ensureActualizeBuildTypeRefsRequested() { + scheduler.sheduleNamed(taskName("actualizeAllBuildTypeRefs"), + this::reindexBuildTypeRefs, 4, TimeUnit.HOURS); + } + + /** + *Ensure actualize BuildTypes requested. Add this task to scheduler. + */ + private void ensureActualizeBuildTypesRequested() { + scheduler.sheduleNamed(taskName("actualizeAllBuildTypes"), + this::reindexBuildTypes, 24, TimeUnit.HOURS); + } + + /** + * Re-index all references to "IgniteTests24Java8" suites. + */ + private void reindexBuildTypeRefs() { + runActualizeBuildTypeRefs(DEFAULT_PROJECT_ID); + } + + /** + * Re-index all "IgniteTests24Java8" suites. + */ + private void reindexBuildTypes() { + runActualizeBuildTypes(DEFAULT_PROJECT_ID); + } + + /** + * Re-index all project suites. + * + * @param projectId Project id. + * @return Statistics with the number of updated and requested buildTypes. + */ + @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) + @MonitoredTask(name = "Reindex BuildTypes (projectId)", nameExtArgsIndexes = {0}) + @AutoProfiling + protected String runActualizeBuildTypes(String projectId) { + List<String> buildTypeIds = buildTypeRefDao.buildTypeIds(srvIdMaskHigh, projectId); + + int updated = 0; + + for (String buildTypeId : buildTypeIds) { + + BuildType buildType = conn.getBuildType(buildTypeId); + + FatBuildTypeCompacted existingBuildType = fatBuildTypeDao.getFatBuildType(srvIdMaskHigh, buildTypeId); + + if (fatBuildTypeDao.saveBuildType(srvIdMaskHigh, buildType, existingBuildType) != null) + updated++; + } + + if (updated != 0) + actualizeSavedCompositeBuildTypesIds(projectId); + + return "BuildTypes updated " + updated + " from " + buildTypeIds.size() + " requested"; + } + + /** + * Re-index all references to project suites. + * + * @param projectId Project id. + * @return Statistics with the number of updated and requested buildTypeRefs. + */ + @SuppressWarnings({"WeakerAccess", "UnusedReturnValue"}) + @MonitoredTask(name = "Reindex BuildTypeRefs (projectId)", nameExtArgsIndexes = {0}) + @AutoProfiling + protected String runActualizeBuildTypeRefs(String projectId) { + List<BuildTypeRef> tcData = conn.getBuildTypes(projectId); + + Set<Long> buildsUpdated = buildTypeRefDao.saveChunk(srvIdMaskHigh, tcData); + + Set<String> removedBuildTypes = buildTypeRefDao.markMissingBuildsAsRemoved(srvIdMaskHigh, + tcData.stream().map(BuildTypeRef::getId).collect(Collectors.toList()), projectId); + + if (!(buildsUpdated.isEmpty() && removedBuildTypes.isEmpty())) { Review comment: Remove braces. ---------------------------------------------------------------- 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 > [TC Bot] Support for alternative configurations for PR testing > -------------------------------------------------------------- > > Key: IGNITE-10203 > URL: https://issues.apache.org/jira/browse/IGNITE-10203 > Project: Ignite > Issue Type: Task > Reporter: Nikolai Kulagin > Assignee: Nikolai Kulagin > Priority: Major > > Support for alternative configurations for PR testing (for example, > IgniteTests24Java8_RunMl) -- This message was sent by Atlassian JIRA (v7.6.3#76005)