From 558310ad9c54bb2f92d99ead8d7c1467fcbc6dda Mon Sep 17 00:00:00 2001 From: elopezcastro <82950460+elopezcastro@users.noreply.github.com> Date: Mon, 2 Oct 2023 15:00:21 +0200 Subject: [PATCH] remove cyclic repository dependency from core data services (#403) --- .../VersionsReconciliationService.java | 4 +- .../refresh/RefreshDependenciesService.java | 9 +-- .../purge/ArtifactsPurgeServiceImpl.java | 6 +- .../VersionsReconciliationServiceImpl.java | 10 +-- .../refresh/ProjectVersionRefreshHandler.java | 14 ++-- .../RefreshDependenciesServiceImpl.java | 34 ++++------ .../guice/ArtifactsServicesModule.java | 12 ++++ .../VersionReconciliationSchedulesModule.java | 26 ++++---- .../ArtifactDependenciesRefreshResource.java | 26 ++++---- .../VersionsReconciliationResource.java | 65 +++++++++++++++++++ .../guice/ArtifactsResourcesModule.java | 3 + .../purge/TestArtifactsPurgeService.java | 4 +- .../TestVersionsMismatchService.java | 5 +- .../refresh/TestArtifactsRefreshService.java | 8 +-- .../TestProjectVersionRefreshHandler.java | 8 +-- .../TestRefreshDependenciesService.java | 29 +++++---- legend-depot-artifacts-store-mongo/pom.xml | 5 +- .../api/dependencies/DependencyOverride.java | 27 ++++++++ legend-depot-core-data-services/pom.xml | 4 -- .../services/dependencies/DependencyUtil.java | 17 ++--- .../guice/CoreDataServicesModule.java | 7 +- .../guice/ManageCoreDataServicesModule.java | 9 --- .../projects/ManageProjectsServiceImpl.java | 4 +- .../projects/ProjectsServiceImpl.java | 13 ++-- .../guice/ManageCoreDataResourcesModule.java | 3 - .../ManageProjectsVersionsResource.java | 17 +---- .../pom.xml | 4 -- .../store/server/LegendDepotStoreServer.java | 4 +- 28 files changed, 223 insertions(+), 154 deletions(-) rename legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/projects/ProjectsVersionsReconciliationService.java => legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/reconciliation/VersionsReconciliationService.java (86%) rename legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/ManageDependenciesService.java => legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/refresh/RefreshDependenciesService.java (73%) rename legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/VersionsMismatchService.java => legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/reconciliation/VersionsReconciliationServiceImpl.java (94%) rename legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/ManageDependenciesServiceImpl.java => legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/RefreshDependenciesServiceImpl.java (84%) rename legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataSchedulesModule.java => legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/VersionReconciliationSchedulesModule.java (62%) rename legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/dependencies/ManageDependenciesResource.java => legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/ArtifactDependenciesRefreshResource.java (68%) create mode 100644 legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/VersionsReconciliationResource.java rename {legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services => legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/reconciliation}/TestVersionsMismatchService.java (95%) rename legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/dependencies/TestManageDependenciesService.java => legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestRefreshDependenciesService.java (88%) create mode 100644 legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/DependencyOverride.java diff --git a/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/projects/ProjectsVersionsReconciliationService.java b/legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/reconciliation/VersionsReconciliationService.java similarity index 86% rename from legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/projects/ProjectsVersionsReconciliationService.java rename to legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/reconciliation/VersionsReconciliationService.java index c05b3bf67..b0c6ae1b0 100644 --- a/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/projects/ProjectsVersionsReconciliationService.java +++ b/legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/reconciliation/VersionsReconciliationService.java @@ -13,13 +13,13 @@ // limitations under the License. // -package org.finos.legend.depot.services.api.projects; +package org.finos.legend.depot.services.api.artifacts.reconciliation; import org.finos.legend.depot.domain.version.VersionMismatch; import java.util.List; -public interface ProjectsVersionsReconciliationService +public interface VersionsReconciliationService { List findVersionsMismatches(); } diff --git a/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/ManageDependenciesService.java b/legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/refresh/RefreshDependenciesService.java similarity index 73% rename from legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/ManageDependenciesService.java rename to legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/refresh/RefreshDependenciesService.java index 92ba28df7..37ea8b537 100644 --- a/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/ManageDependenciesService.java +++ b/legend-depot-artifacts-api/src/main/java/org/finos/legend/depot/services/api/artifacts/refresh/RefreshDependenciesService.java @@ -13,19 +13,16 @@ // limitations under the License. // -package org.finos.legend.depot.services.api.dependencies; +package org.finos.legend.depot.services.api.artifacts.refresh; import org.finos.legend.depot.domain.project.ProjectVersion; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; -import org.finos.legend.depot.domain.project.dependencies.VersionDependencyReport; import java.util.List; -public interface ManageDependenciesService +public interface RefreshDependenciesService { - List calculateDependencies(String groupId, String artifactId, String versionId); - - VersionDependencyReport calculateTransitiveDependencies(List directDependencies); + List retrieveDependenciesFromRepository(String groupId, String artifactId, String versionId); List validateDependencies(List dependencies, String versionId); diff --git a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/purge/ArtifactsPurgeServiceImpl.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/purge/ArtifactsPurgeServiceImpl.java index 132083ff1..4842ba944 100644 --- a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/purge/ArtifactsPurgeServiceImpl.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/purge/ArtifactsPurgeServiceImpl.java @@ -24,7 +24,7 @@ import org.finos.legend.depot.services.api.artifacts.purge.ArtifactsPurgeService; import org.finos.legend.depot.services.api.metrics.query.QueryMetricsService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.api.projects.ProjectsVersionsReconciliationService; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; import org.finos.legend.depot.store.model.projects.StoreProjectData; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; import org.finos.legend.depot.tracing.services.TracerFactory; @@ -60,11 +60,11 @@ public class ArtifactsPurgeServiceImpl implements ArtifactsPurgeService private static final String EVICT_OLDEST = "evict_old"; private final ManageProjectsService projects; - private final ProjectsVersionsReconciliationService versionsMismatchService; + private final VersionsReconciliationService versionsMismatchService; private final QueryMetricsService metrics; @Inject - public ArtifactsPurgeServiceImpl(ManageProjectsService projects, ProjectsVersionsReconciliationService versionsMismatchService, QueryMetricsService metrics) + public ArtifactsPurgeServiceImpl(ManageProjectsService projects, VersionsReconciliationService versionsMismatchService, QueryMetricsService metrics) { this.projects = projects; this.metrics = metrics; diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/VersionsMismatchService.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/reconciliation/VersionsReconciliationServiceImpl.java similarity index 94% rename from legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/VersionsMismatchService.java rename to legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/reconciliation/VersionsReconciliationServiceImpl.java index ab795e3a3..bb055e776 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/VersionsMismatchService.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/reconciliation/VersionsReconciliationServiceImpl.java @@ -13,11 +13,11 @@ // limitations under the License. // -package org.finos.legend.depot.services; +package org.finos.legend.depot.services.artifacts.reconciliation; import org.eclipse.collections.impl.parallel.ParallelIterate; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; import org.finos.legend.depot.services.api.artifacts.repository.ArtifactRepository; -import org.finos.legend.depot.services.api.projects.ProjectsVersionsReconciliationService; import org.finos.legend.depot.store.model.projects.StoreProjectData; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; import org.finos.legend.depot.domain.version.VersionMismatch; @@ -34,9 +34,9 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.stream.Collectors; -public class VersionsMismatchService implements ProjectsVersionsReconciliationService +public class VersionsReconciliationServiceImpl implements VersionsReconciliationService { - private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(VersionsMismatchService.class); + private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(VersionsReconciliationServiceImpl.class); public static final String REPO_VERSIONS = "repo_versions"; public static final String STORE_VERSIONS = "store_versions"; @@ -51,7 +51,7 @@ public class VersionsMismatchService implements ProjectsVersionsReconciliationSe private final ProjectsService projects; @Inject - public VersionsMismatchService(ArtifactRepository repository, ProjectsService projectsService) + public VersionsReconciliationServiceImpl(ArtifactRepository repository, ProjectsService projectsService) { this.repository = repository; this.projects = projectsService; diff --git a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/ProjectVersionRefreshHandler.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/ProjectVersionRefreshHandler.java index efd095518..e41b078f7 100644 --- a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/ProjectVersionRefreshHandler.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/ProjectVersionRefreshHandler.java @@ -26,7 +26,7 @@ import org.finos.legend.depot.domain.project.ProjectVersionData; import org.finos.legend.depot.domain.project.Property; import org.finos.legend.depot.domain.version.VersionValidator; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; import org.finos.legend.depot.services.artifacts.handlers.ManifestLoader; import org.finos.legend.depot.store.api.admin.artifacts.ArtifactsFilesStore; @@ -84,12 +84,12 @@ public final class ProjectVersionRefreshHandler implements NotificationEventHand private final List projectPropertiesInScope; private final List manifestPropertiesInScope; private final Queue workQueue; - private final ManageDependenciesService manageDependenciesService; + private final RefreshDependenciesService refreshDependenciesService; private final int maximumSnapshotsAllowed; @Inject - public ProjectVersionRefreshHandler(ManageProjectsService projects, ArtifactRepository repositoryServices, Queue workQueue, ArtifactsFilesStore artifacts, IncludeProjectPropertiesConfiguration includePropertyConfig, ManageDependenciesService manageDependenciesService, @Named("maximumSnapshotsAllowed") int maximumSnapshotsAllowed) + public ProjectVersionRefreshHandler(ManageProjectsService projects, ArtifactRepository repositoryServices, Queue workQueue, ArtifactsFilesStore artifacts, IncludeProjectPropertiesConfiguration includePropertyConfig, RefreshDependenciesService refreshDependenciesService, @Named("maximumSnapshotsAllowed") int maximumSnapshotsAllowed) { this.projects = projects; this.workQueue = workQueue; @@ -97,7 +97,7 @@ public ProjectVersionRefreshHandler(ManageProjectsService projects, ArtifactRepo this.repositoryServices = repositoryServices; this.projectPropertiesInScope = includePropertyConfig != null ? includePropertyConfig.getProperties() : Collections.EMPTY_LIST; this.manifestPropertiesInScope = includePropertyConfig != null ? includePropertyConfig.getManifestProperties() : Collections.EMPTY_LIST; - this.manageDependenciesService = manageDependenciesService; + this.refreshDependenciesService = refreshDependenciesService; this.maximumSnapshotsAllowed = maximumSnapshotsAllowed; try @@ -230,8 +230,8 @@ MetadataEventResponse doRefresh(MetadataNotification event) StoreProjectData project = getProject(event.getGroupId(), event.getArtifactId()); try { - List newDependencies = this.manageDependenciesService.calculateDependencies(event.getGroupId(), event.getArtifactId(), event.getVersionId()); - this.manageDependenciesService.validateDependencies(newDependencies, event.getVersionId()).forEach(error -> response.addError(error)); + List newDependencies = this.refreshDependenciesService.retrieveDependenciesFromRepository(event.getGroupId(), event.getArtifactId(), event.getVersionId()); + this.refreshDependenciesService.validateDependencies(newDependencies, event.getVersionId()).forEach(error -> response.addError(error)); if (!response.hasErrors()) { LOGGER.info("Processing artifacts for [{}-{}-{}]", event.getGroupId(), event.getArtifactId(), event.getVersionId()); @@ -282,7 +282,7 @@ private void updateProjectVersionData(StoreProjectData project, String versionId StoreProjectVersionData storeProjectVersionData = projectVersionData.isPresent() ? projectVersionData.get() : new StoreProjectVersionData(project.getGroupId(), project.getArtifactId(), versionId); ProjectVersionData versionData = storeProjectVersionData.getVersionData(); versionData.setDependencies(newDependencies); - this.manageDependenciesService.setProjectDataTransitiveDependencies(storeProjectVersionData); + this.refreshDependenciesService.setProjectDataTransitiveDependencies(storeProjectVersionData); if (this.projectPropertiesInScope != null && !this.projectPropertiesInScope.isEmpty()) { diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/ManageDependenciesServiceImpl.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/RefreshDependenciesServiceImpl.java similarity index 84% rename from legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/ManageDependenciesServiceImpl.java rename to legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/RefreshDependenciesServiceImpl.java index 4205157ad..a6641db65 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/ManageDependenciesServiceImpl.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/artifacts/refresh/RefreshDependenciesServiceImpl.java @@ -13,13 +13,14 @@ // limitations under the License. // -package org.finos.legend.depot.services.dependencies; +package org.finos.legend.depot.services.artifacts.refresh; import org.finos.legend.depot.domain.project.ProjectVersion; import org.finos.legend.depot.domain.project.dependencies.ProjectDependencyWithPlatformVersions; import org.finos.legend.depot.domain.project.dependencies.VersionDependencyReport; import org.finos.legend.depot.domain.version.VersionValidator; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; +import org.finos.legend.depot.services.api.dependencies.DependencyOverride; import org.finos.legend.depot.services.api.projects.ManageProjectsService; import org.finos.legend.depot.services.api.artifacts.repository.ArtifactRepository; import org.finos.legend.depot.domain.artifacts.repository.ArtifactDependency; @@ -35,31 +36,24 @@ import java.util.Set; import java.util.stream.Collectors; -public class ManageDependenciesServiceImpl implements ManageDependenciesService +public class RefreshDependenciesServiceImpl implements RefreshDependenciesService { - private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(ManageDependenciesServiceImpl.class); + private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(RefreshDependenciesServiceImpl.class); private final ManageProjectsService projects; private final ArtifactRepository repositoryServices; - private final DependencyUtil dependencyUtil; + private final DependencyOverride dependencyOverride; @Inject - public ManageDependenciesServiceImpl(ManageProjectsService projects, ArtifactRepository repositoryServices, @Named("dependencyUtil") DependencyUtil dependencyUtil) + public RefreshDependenciesServiceImpl(ManageProjectsService projects, ArtifactRepository repositoryServices,@Named("dependencyOverride") DependencyOverride dependencyOverride) { this.projects = projects; this.repositoryServices = repositoryServices; - this.dependencyUtil = dependencyUtil; - } - - public ManageDependenciesServiceImpl(ManageProjectsService projects, ArtifactRepository repositoryServices) - { - this.projects = projects; - this.repositoryServices = repositoryServices; - this.dependencyUtil = new DependencyUtil(); + this.dependencyOverride = dependencyOverride; } @Override - public List calculateDependencies(String groupId, String artifactId, String versionId) + public List retrieveDependenciesFromRepository(String groupId, String artifactId, String versionId) { List versionDependencies = new ArrayList<>(); LOGGER.info("Finding dependencies for [{}-{}-{}]", groupId, artifactId, versionId); @@ -69,13 +63,13 @@ public List calculateDependencies(String groupId, String artifac return versionDependencies; } - @Override - public VersionDependencyReport calculateTransitiveDependencies(List directDependencies) + + private VersionDependencyReport calculateTransitiveDependencies(List projectVersions) { Set projectDependencies = new HashSet<>(); try { - directDependencies.forEach(deps -> + projectVersions.forEach(deps -> { LOGGER.info(String.format("Finding dependencies for %s-%s-%s", deps.getGroupId(), deps.getArtifactId(), deps.getVersionId())); Optional projectData = this.projects.find(deps.getGroupId(), deps.getArtifactId(), deps.getVersionId()); @@ -95,7 +89,7 @@ else if (!projectData.get().getTransitiveDependenciesReport().isValid()) else { LOGGER.info(String.format("Finding dependencies for %s-%s-%s as no data is present in the store", deps.getGroupId(), deps.getArtifactId(), deps.getVersionId())); - List dependencies = this.calculateDependencies(deps.getGroupId(), deps.getArtifactId(), deps.getVersionId()); + List dependencies = this.retrieveDependenciesFromRepository(deps.getGroupId(), deps.getArtifactId(), deps.getVersionId()); projectDependencies.addAll(dependencies); VersionDependencyReport report = calculateTransitiveDependencies(dependencies); if (!report.isValid()) @@ -116,7 +110,7 @@ else if (!projectData.get().getTransitiveDependenciesReport().isValid()) return new VersionDependencyReport(new ArrayList<>(), false); } LOGGER.info("Completed finding dependencies"); - List finalDependencies = this.dependencyUtil.overrideDependencies(directDependencies, projectDependencies.stream().collect(Collectors.toList()), this::getCalculatedTransitiveDependencies); + List finalDependencies = this.dependencyOverride.overrideWith(projectDependencies.stream().collect(Collectors.toList()), projectVersions, this::getCalculatedTransitiveDependencies); return new VersionDependencyReport(finalDependencies, true); } diff --git a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/ArtifactsServicesModule.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/ArtifactsServicesModule.java index bf85365eb..63aaccf41 100644 --- a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/ArtifactsServicesModule.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/ArtifactsServicesModule.java @@ -21,7 +21,9 @@ import com.google.inject.name.Named; import org.finos.legend.depot.domain.artifacts.repository.ArtifactType; import org.finos.legend.depot.services.api.artifacts.purge.ArtifactsPurgeService; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; import org.finos.legend.depot.services.api.artifacts.refresh.ArtifactsRefreshService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.services.artifacts.handlers.entities.EntitiesHandlerImpl; import org.finos.legend.depot.services.artifacts.handlers.entities.EntityProvider; import org.finos.legend.depot.services.artifacts.handlers.entities.VersionedEntitiesHandlerImpl; @@ -31,6 +33,8 @@ import org.finos.legend.depot.services.artifacts.purge.ArtifactsPurgeServiceImpl; import org.finos.legend.depot.services.artifacts.refresh.ArtifactsRefreshServiceImpl; import org.finos.legend.depot.services.artifacts.refresh.ProjectVersionRefreshHandler; +import org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl; +import org.finos.legend.depot.services.artifacts.refresh.RefreshDependenciesServiceImpl; import org.finos.legend.depot.store.notifications.api.NotificationEventHandler; import org.finos.legend.depot.services.api.artifacts.handlers.ProjectArtifactHandlerFactory; import org.finos.legend.depot.services.api.artifacts.configuration.ArtifactsRetentionPolicyConfiguration; @@ -56,6 +60,13 @@ protected void configure() configureHandlers(); configureRefresh(); configurePurge(); + configureVersionReconciliation(); + } + + protected void configureVersionReconciliation() + { + bind(VersionsReconciliationService.class).to(VersionsReconciliationServiceImpl.class); + expose(VersionsReconciliationService.class); } protected void configurePurge() @@ -68,6 +79,7 @@ protected void configureRefresh() { bind(ArtifactsRefreshService.class).to(ArtifactsRefreshServiceImpl.class); bind(NotificationEventHandler.class).to(ProjectVersionRefreshHandler.class); + bind(RefreshDependenciesService.class).to(RefreshDependenciesServiceImpl.class); bind(ProjectVersionRefreshHandler.class); expose(ArtifactsRefreshService.class); diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataSchedulesModule.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/VersionReconciliationSchedulesModule.java similarity index 62% rename from legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataSchedulesModule.java rename to legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/VersionReconciliationSchedulesModule.java index f34b70d19..ade302a91 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataSchedulesModule.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/services/guice/VersionReconciliationSchedulesModule.java @@ -18,23 +18,22 @@ import com.google.inject.PrivateModule; import com.google.inject.Provides; import com.google.inject.Singleton; -import org.finos.legend.depot.services.api.projects.ProjectsVersionsReconciliationService; +import com.google.inject.name.Named; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; import org.finos.legend.depot.services.api.schedules.SchedulesFactory; import org.finos.legend.depot.tracing.api.PrometheusMetricsHandler; import org.finos.legend.depot.tracing.configuration.PrometheusConfiguration; -import javax.inject.Named; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.MISSING_REPO_VERSIONS; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.MISSING_STORE_VERSIONS; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.PROJECTS; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.REPO_EXCEPTIONS; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.REPO_VERSIONS; +import static org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl.STORE_VERSIONS; -import static org.finos.legend.depot.services.VersionsMismatchService.MISSING_REPO_VERSIONS; -import static org.finos.legend.depot.services.VersionsMismatchService.MISSING_STORE_VERSIONS; -import static org.finos.legend.depot.services.VersionsMismatchService.PROJECTS; -import static org.finos.legend.depot.services.VersionsMismatchService.REPO_EXCEPTIONS; -import static org.finos.legend.depot.services.VersionsMismatchService.REPO_VERSIONS; -import static org.finos.legend.depot.services.VersionsMismatchService.STORE_VERSIONS; - -public class ManageCoreDataSchedulesModule extends PrivateModule +public class VersionReconciliationSchedulesModule extends PrivateModule { - private static final String REPOSITORY_METRICS_SCHEDULE = "repository-metrics-schedule"; + public static final String REPOSITORY_METRICS_SCHEDULE = "repository-metrics-schedule"; @Override protected void configure() @@ -44,7 +43,7 @@ protected void configure() @Provides @Named("repository-metrics") @Singleton - boolean registerMetrics(PrometheusConfiguration prometheusConfiguration, SchedulesFactory schedulesFactory, ProjectsVersionsReconciliationService versionsMismatchService) + boolean registerMetrics(PrometheusConfiguration prometheusConfiguration, SchedulesFactory schedulesFactory, VersionsReconciliationService versionsReconciliationService) { if (prometheusConfiguration.isEnabled()) { @@ -55,8 +54,9 @@ boolean registerMetrics(PrometheusConfiguration prometheusConfiguration, Schedul metricsHandler.registerGauge(MISSING_REPO_VERSIONS, MISSING_REPO_VERSIONS); metricsHandler.registerGauge(MISSING_STORE_VERSIONS, MISSING_STORE_VERSIONS); metricsHandler.registerGauge(REPO_EXCEPTIONS, REPO_EXCEPTIONS); - schedulesFactory.register(REPOSITORY_METRICS_SCHEDULE, 5 * SchedulesFactory.MINUTE, 5 * SchedulesFactory.MINUTE, versionsMismatchService::findVersionsMismatches); + schedulesFactory.register(REPOSITORY_METRICS_SCHEDULE, 5 * SchedulesFactory.MINUTE, 5 * SchedulesFactory.MINUTE, versionsReconciliationService::findVersionsMismatches); } return true; } + } diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/dependencies/ManageDependenciesResource.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/ArtifactDependenciesRefreshResource.java similarity index 68% rename from legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/dependencies/ManageDependenciesResource.java rename to legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/ArtifactDependenciesRefreshResource.java index 3102b1517..c7e731489 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/dependencies/ManageDependenciesResource.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/ArtifactDependenciesRefreshResource.java @@ -13,14 +13,14 @@ // limitations under the License. // -package org.finos.legend.depot.store.resources.dependencies; +package org.finos.legend.depot.store.resources.artifacts; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.finos.legend.depot.core.authorisation.api.AuthorisationProvider; import org.finos.legend.depot.core.authorisation.resources.BaseAuthorisedResource; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.tracing.resources.ResourceLoggingAndTracing; import javax.inject.Inject; @@ -35,23 +35,23 @@ @Path("") -@Api("Dependencies") -public class ManageDependenciesResource extends BaseAuthorisedResource +@Api("Artifacts Refresh") +public class ArtifactDependenciesRefreshResource extends BaseAuthorisedResource { - public static final String DEPENDENCIES_RESOURCE = "Dependencies"; - private final ManageDependenciesService manageDependenciesService; + public static final String ARTIFACTS_RESOURCE = "ArtifactsRefresh"; + private final RefreshDependenciesService refreshDependenciesService; @Inject - public ManageDependenciesResource(ManageDependenciesService manageDependenciesService, - AuthorisationProvider authorisationProvider, - @Named("requestPrincipal") Provider principalProvider) + public ArtifactDependenciesRefreshResource(RefreshDependenciesService refreshDependenciesService, + AuthorisationProvider authorisationProvider, + @Named("requestPrincipal") Provider principalProvider) { super(authorisationProvider, principalProvider); - this.manageDependenciesService = manageDependenciesService; + this.refreshDependenciesService = refreshDependenciesService; } @PUT - @Path("/dependencies/{groupId}/{artifactId}/{versionId}") + @Path("/artifactsRefresh/dependencies/{groupId}/{artifactId}/{versionId}") @ApiOperation(ResourceLoggingAndTracing.UPDATE_PROJECT_TRANSITIVE_DEPENDENCIES) @Produces(MediaType.APPLICATION_JSON) public StoreProjectVersionData updateTransitiveDependencies(@PathParam("groupId") String groupId, @@ -61,13 +61,13 @@ public StoreProjectVersionData updateTransitiveDependencies(@PathParam("groupId" return handle(ResourceLoggingAndTracing.UPDATE_PROJECT_TRANSITIVE_DEPENDENCIES, ResourceLoggingAndTracing.UPDATE_PROJECT_TRANSITIVE_DEPENDENCIES + groupId + artifactId + versionId, () -> { validateUser(); - return manageDependenciesService.updateTransitiveDependencies(groupId, artifactId, versionId); + return refreshDependenciesService.updateTransitiveDependencies(groupId, artifactId, versionId); }); } @Override protected String getResourceName() { - return DEPENDENCIES_RESOURCE; + return ARTIFACTS_RESOURCE; } } diff --git a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/VersionsReconciliationResource.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/VersionsReconciliationResource.java new file mode 100644 index 000000000..dad905ac1 --- /dev/null +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/artifacts/VersionsReconciliationResource.java @@ -0,0 +1,65 @@ +// Copyright 2021 Goldman Sachs +// +// Licensed 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.finos.legend.depot.store.resources.artifacts; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.finos.legend.depot.core.authorisation.api.AuthorisationProvider; +import org.finos.legend.depot.core.authorisation.resources.BaseAuthorisedResource; +import org.finos.legend.depot.domain.version.VersionMismatch; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; +import org.finos.legend.depot.tracing.resources.ResourceLoggingAndTracing; + +import javax.inject.Inject; +import javax.inject.Named; +import javax.inject.Provider; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import java.security.Principal; +import java.util.List; + +@Path("") +@Api("Repository") +public class VersionsReconciliationResource extends BaseAuthorisedResource +{ + private static final String REPOSITORY = "Repository"; + private final VersionsReconciliationService reconciliationService; + + @Inject + public VersionsReconciliationResource(VersionsReconciliationService repositoryService, AuthorisationProvider authorisationProvider, @Named("requestPrincipal") Provider principalProvider) + { + super(authorisationProvider, principalProvider); + this.reconciliationService = repositoryService; + + } + + @Override + protected String getResourceName() + { + return REPOSITORY; + } + + @GET + @Path("/versions/mismatch") + @ApiOperation(ResourceLoggingAndTracing.GET_PROJECT_CACHE_MISMATCHES) + @Produces(MediaType.APPLICATION_JSON) + public List getVersionMissMatches() + { + return handle(ResourceLoggingAndTracing.GET_PROJECT_CACHE_MISMATCHES, () -> this.reconciliationService.findVersionsMismatches()); + } +} diff --git a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/guice/ArtifactsResourcesModule.java b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/guice/ArtifactsResourcesModule.java index ccede5923..d4f3f5ab6 100644 --- a/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/guice/ArtifactsResourcesModule.java +++ b/legend-depot-artifacts-services/src/main/java/org/finos/legend/depot/store/resources/guice/ArtifactsResourcesModule.java @@ -18,6 +18,7 @@ import com.google.inject.PrivateModule; import org.finos.legend.depot.store.resources.artifacts.ArtifactsPurgeResource; import org.finos.legend.depot.store.resources.artifacts.ArtifactsRefreshResource; +import org.finos.legend.depot.store.resources.artifacts.VersionsReconciliationResource; public class ArtifactsResourcesModule extends PrivateModule { @@ -27,9 +28,11 @@ protected void configure() { bind(ArtifactsPurgeResource.class); bind(ArtifactsRefreshResource.class); + bind(VersionsReconciliationResource.class); expose(ArtifactsPurgeResource.class); expose(ArtifactsRefreshResource.class); + expose(VersionsReconciliationResource.class); } } diff --git a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/purge/TestArtifactsPurgeService.java b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/purge/TestArtifactsPurgeService.java index 04963a950..c611c9ed6 100644 --- a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/purge/TestArtifactsPurgeService.java +++ b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/purge/TestArtifactsPurgeService.java @@ -17,6 +17,7 @@ import org.finos.legend.depot.services.TestBaseServices; import org.finos.legend.depot.services.api.metrics.query.QueryMetricsService; +import org.finos.legend.depot.services.artifacts.reconciliation.VersionsReconciliationServiceImpl; import org.finos.legend.depot.store.model.metrics.query.VersionQueryMetric; import org.finos.legend.depot.services.api.artifacts.repository.ArtifactRepository; import org.finos.legend.depot.domain.artifacts.repository.ArtifactType; @@ -25,7 +26,6 @@ import org.finos.legend.depot.domain.api.MetadataEventResponse; import org.finos.legend.depot.store.model.projects.StoreProjectData; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; -import org.finos.legend.depot.services.VersionsMismatchService; import org.finos.legend.depot.services.api.entities.ManageEntitiesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; import org.finos.legend.depot.services.entities.ManageEntitiesServiceImpl; @@ -85,7 +85,7 @@ public class TestArtifactsPurgeService extends TestBaseServices protected UpdateEntities entitiesStore = new EntitiesMongo(mongoProvider); protected UpdateFileGenerations fileGenerationsStore = new FileGenerationsMongo(mongoProvider); protected ArtifactRepository repository = mock(ArtifactRepository.class); - protected VersionsMismatchService versionsMismatchService = new VersionsMismatchService(repository, projectsService); + protected VersionsReconciliationServiceImpl versionsMismatchService = new VersionsReconciliationServiceImpl(repository, projectsService); protected ManageEntitiesService entitiesService = new ManageEntitiesServiceImpl(entitiesStore, projectsService); protected ArtifactsPurgeService purgeService = new ArtifactsPurgeServiceImpl(projectsService, versionsMismatchService, metricHandler); diff --git a/legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/TestVersionsMismatchService.java b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/reconciliation/TestVersionsMismatchService.java similarity index 95% rename from legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/TestVersionsMismatchService.java rename to legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/reconciliation/TestVersionsMismatchService.java index 77dc3d93b..1acc9f45a 100644 --- a/legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/TestVersionsMismatchService.java +++ b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/reconciliation/TestVersionsMismatchService.java @@ -13,8 +13,9 @@ // limitations under the License. // -package org.finos.legend.depot.services; +package org.finos.legend.depot.services.artifacts.reconciliation; +import org.finos.legend.depot.services.api.artifacts.reconciliation.VersionsReconciliationService; import org.finos.legend.depot.services.api.artifacts.repository.ArtifactRepository; import org.finos.legend.depot.services.api.artifacts.repository.ArtifactRepositoryException; import org.finos.legend.depot.store.model.projects.StoreProjectData; @@ -38,7 +39,7 @@ public class TestVersionsMismatchService { protected ArtifactRepository repository = mock(ArtifactRepository.class); protected ProjectsService projects = mock(ProjectsService.class); - protected VersionsMismatchService repositoryServices = new VersionsMismatchService(repository, projects); + protected VersionsReconciliationService repositoryServices = new VersionsReconciliationServiceImpl(repository, projects); @Before public void setup() throws ArtifactRepositoryException diff --git a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestArtifactsRefreshService.java b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestArtifactsRefreshService.java index 7cea58344..3f42068a1 100644 --- a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestArtifactsRefreshService.java +++ b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestArtifactsRefreshService.java @@ -20,10 +20,10 @@ import org.finos.legend.depot.domain.notifications.MetadataNotification; import org.finos.legend.depot.domain.project.ProjectVersion; import org.finos.legend.depot.domain.project.ProjectVersionData; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.services.api.entities.ManageEntitiesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.dependencies.ManageDependenciesServiceImpl; +import org.finos.legend.depot.services.dependencies.DependencyUtil; import org.finos.legend.depot.services.entities.ManageEntitiesServiceImpl; import org.finos.legend.depot.services.generations.impl.ManageFileGenerationsServiceImpl; import org.finos.legend.depot.services.projects.ManageProjectsServiceImpl; @@ -99,9 +99,9 @@ public class TestArtifactsRefreshService extends TestStoreMongo protected FileGenerationsArtifactsProvider fileGenerationsProvider = new FileGenerationsProvider(); protected ManageEntitiesService entitiesService = new ManageEntitiesServiceImpl(entitiesStore, projectsService); protected ArtifactRepository repository = new TestMavenArtifactsRepository(); - protected ManageDependenciesService manageDependenciesService = new ManageDependenciesServiceImpl(projectsService, repository); + protected RefreshDependenciesService refreshDependenciesService = new RefreshDependenciesServiceImpl(projectsService, repository, new DependencyUtil()); - protected ProjectVersionRefreshHandler versionHandler = new ProjectVersionRefreshHandler(projectsService, repository, queue, artifacts, new IncludeProjectPropertiesConfiguration(properties, manifestProperties), manageDependenciesService, 10); + protected ProjectVersionRefreshHandler versionHandler = new ProjectVersionRefreshHandler(projectsService, repository, queue, artifacts, new IncludeProjectPropertiesConfiguration(properties, manifestProperties), refreshDependenciesService, 10); protected ArtifactsRefreshService artifactsRefreshService = new ArtifactsRefreshServiceImpl(projectsService, repository, queue); diff --git a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestProjectVersionRefreshHandler.java b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestProjectVersionRefreshHandler.java index a062d3fd1..a057831ce 100644 --- a/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestProjectVersionRefreshHandler.java +++ b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestProjectVersionRefreshHandler.java @@ -18,10 +18,10 @@ import org.finos.legend.depot.domain.api.MetadataEventResponse; import org.finos.legend.depot.domain.api.status.MetadataEventStatus; import org.finos.legend.depot.domain.notifications.MetadataNotification; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.services.api.entities.ManageEntitiesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.dependencies.ManageDependenciesServiceImpl; +import org.finos.legend.depot.services.dependencies.DependencyUtil; import org.finos.legend.depot.services.entities.ManageEntitiesServiceImpl; import org.finos.legend.depot.services.projects.ManageProjectsServiceImpl; import org.finos.legend.depot.services.projects.configuration.ProjectsConfiguration; @@ -85,9 +85,9 @@ public class TestProjectVersionRefreshHandler extends TestStoreMongo protected EntityArtifactsProvider entitiesProvider = new EntityProvider(); protected ArtifactRepository repositoryServices = mock(ArtifactRepository.class); - protected ManageDependenciesService manageDependenciesService = new ManageDependenciesServiceImpl(projectsService, repositoryServices); + protected RefreshDependenciesService refreshDependenciesService = new RefreshDependenciesServiceImpl(projectsService, repositoryServices,new DependencyUtil()); - protected ProjectVersionRefreshHandler versionHandler = new ProjectVersionRefreshHandler(projectsService, repositoryServices, queue, artifactsStore, new IncludeProjectPropertiesConfiguration(properties, manifestProperties), manageDependenciesService, 3); + protected ProjectVersionRefreshHandler versionHandler = new ProjectVersionRefreshHandler(projectsService, repositoryServices, queue, artifactsStore, new IncludeProjectPropertiesConfiguration(properties, manifestProperties), refreshDependenciesService, 3); @Before diff --git a/legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/dependencies/TestManageDependenciesService.java b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestRefreshDependenciesService.java similarity index 88% rename from legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/dependencies/TestManageDependenciesService.java rename to legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestRefreshDependenciesService.java index eb3dfd972..504174caf 100644 --- a/legend-depot-core-data-services/src/test/java/org/finos/legend/depot/services/dependencies/TestManageDependenciesService.java +++ b/legend-depot-artifacts-services/src/test/java/org/finos/legend/depot/services/artifacts/refresh/TestRefreshDependenciesService.java @@ -12,11 +12,12 @@ // limitations under the License. // -package org.finos.legend.depot.services.dependencies; +package org.finos.legend.depot.services.artifacts.refresh; import org.finos.legend.depot.domain.project.ProjectVersion; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; +import org.finos.legend.depot.services.api.artifacts.refresh.RefreshDependenciesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; +import org.finos.legend.depot.services.dependencies.DependencyUtil; import org.finos.legend.depot.services.projects.ManageProjectsServiceImpl; import org.finos.legend.depot.services.projects.configuration.ProjectsConfiguration; import org.finos.legend.depot.store.api.projects.UpdateProjects; @@ -40,7 +41,7 @@ import static org.mockito.Mockito.mock; -public class TestManageDependenciesService extends CoreDataMongoStoreTests +public class TestRefreshDependenciesService extends CoreDataMongoStoreTests { protected UpdateProjects projectsStore = new ProjectsMongo(mongoProvider); protected UpdateProjectsVersions projectsVersionsStore = new ProjectsVersionsMongo(mongoProvider); @@ -48,7 +49,7 @@ public class TestManageDependenciesService extends CoreDataMongoStoreTests protected Queue queue = new NotificationsQueueMongo(mongoProvider); protected ManageProjectsService projectsService = new ManageProjectsServiceImpl(projectsVersionsStore,projectsStore,metrics,queue,new ProjectsConfiguration("master")); protected ArtifactRepository repository = mock(ArtifactRepository.class); - protected ManageDependenciesService manageDependenciesService = new ManageDependenciesServiceImpl(projectsService, repository); + protected RefreshDependenciesService refreshDependenciesService = new RefreshDependenciesServiceImpl(projectsService, repository,new DependencyUtil()); private static final String GROUPID = "examples.metadata"; @@ -71,7 +72,7 @@ public void canUpdateTransitiveDependencies() project1.getVersionData().setDependencies(Collections.singletonList(dependency)); projectsVersionsStore.createOrUpdate(project1); - StoreProjectVersionData versionData = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); + StoreProjectVersionData versionData = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); Assert.assertTrue(versionData.getTransitiveDependenciesReport().isValid()); List transitiveDependencies = versionData.getTransitiveDependenciesReport().getTransitiveDependencies(); Assert.assertEquals(5, transitiveDependencies.size()); @@ -101,7 +102,7 @@ public void canUpdateTransitiveDependenciesForRevision() project3.getVersionData().setDependencies(Collections.singletonList(dependency3)); projectsVersionsStore.createOrUpdate(project3); - project1 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "branch1-SNAPSHOT"); + project1 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "branch1-SNAPSHOT"); Assert.assertTrue(project1.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Collections.singletonList(dependency1), project1.getTransitiveDependenciesReport().getTransitiveDependencies()); //chain update of snapshot dependants @@ -121,7 +122,7 @@ public void canOverrideDependencies1() ProjectVersion dependency = new ProjectVersion(GROUPID, "test", "1.0.0"); project1.getVersionData().setDependencies(Collections.singletonList(dependency)); projectsService.createOrUpdate(project1); - project1 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); + project1 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); Assert.assertTrue(project1.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Collections.singletonList(dependency), project1.getTransitiveDependenciesReport().getTransitiveDependencies()); @@ -132,7 +133,7 @@ public void canOverrideDependencies1() project2.getVersionData().setDependencies(Arrays.asList(dependency1, dependency2)); projectsService.createOrUpdate(project2); - project2 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); + project2 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); Assert.assertTrue(project2.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Arrays.asList(dependency1, dependency2, new ProjectVersion(GROUPID, "test-dependencies", "2.0.0"), new ProjectVersion(GROUPID, "art101", "1.0.0")), project2.getTransitiveDependenciesReport().getTransitiveDependencies()); } @@ -146,7 +147,7 @@ public void canOverrideDependencies2() ProjectVersion dependency = new ProjectVersion(GROUPID, "art104", "1.0.0"); project1.getVersionData().setDependencies(Collections.singletonList(dependency)); projectsService.createOrUpdate(project1); - project1 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); + project1 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); Assert.assertTrue(project1.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Collections.singletonList(dependency), project1.getTransitiveDependenciesReport().getTransitiveDependencies()); @@ -157,7 +158,7 @@ public void canOverrideDependencies2() project2.getVersionData().setDependencies(Arrays.asList(dependency1, dependency2)); projectsService.createOrUpdate(project2); - project2 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); + project2 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); Assert.assertTrue(project2.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Arrays.asList(dependency1, dependency, dependency2, new ProjectVersion(GROUPID, "test-dependencies", "2.0.0"), new ProjectVersion(GROUPID, "art101", "1.0.0")), project2.getTransitiveDependenciesReport().getTransitiveDependencies()); } @@ -175,7 +176,7 @@ public void canOverrideDependencies3() ProjectVersion dependency = new ProjectVersion(GROUPID, "art104", "1.0.0"); project1.getVersionData().setDependencies(Collections.singletonList(dependency)); projectsService.createOrUpdate(project1); - project1 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "1.0.0"); + project1 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "1.0.0"); Assert.assertTrue(project1.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Collections.singletonList(dependency), project1.getTransitiveDependenciesReport().getTransitiveDependencies()); @@ -185,7 +186,7 @@ public void canOverrideDependencies3() ProjectVersion dependency1 = new ProjectVersion(GROUPID, "art104", "2.0.0"); project2.getVersionData().setDependencies(Collections.singletonList(dependency1)); projectsService.createOrUpdate(project2); - project2 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); + project2 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "art102", "2.0.0"); Assert.assertTrue(project2.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Collections.singletonList(dependency1), project2.getTransitiveDependenciesReport().getTransitiveDependencies()); @@ -193,7 +194,7 @@ public void canOverrideDependencies3() ProjectVersion dependency2 = new ProjectVersion(GROUPID, "art102", "1.0.0"); project3.getVersionData().setDependencies(Collections.singletonList(dependency2)); projectsService.createOrUpdate(project3); - project3 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test", "5.0.0"); + project3 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test", "5.0.0"); Assert.assertTrue(project3.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Arrays.asList(dependency, dependency2), project3.getTransitiveDependenciesReport().getTransitiveDependencies()); @@ -204,7 +205,7 @@ public void canOverrideDependencies3() project4.getVersionData().setDependencies(Arrays.asList(dependency3, dependency4)); projectsService.createOrUpdate(project4); - project4 = manageDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); + project4 = refreshDependenciesService.updateTransitiveDependencies(GROUPID, "test-master", "3.0.0"); Assert.assertTrue(project4.getTransitiveDependenciesReport().isValid()); Assert.assertEquals(Arrays.asList(dependency3, dependency4, dependency1), project4.getTransitiveDependenciesReport().getTransitiveDependencies()); } diff --git a/legend-depot-artifacts-store-mongo/pom.xml b/legend-depot-artifacts-store-mongo/pom.xml index 9bd5597e4..c3261d9c7 100644 --- a/legend-depot-artifacts-store-mongo/pom.xml +++ b/legend-depot-artifacts-store-mongo/pom.xml @@ -30,10 +30,7 @@ - - org.finos.legend.depot - legend-depot-core-schedules-api - + org.finos.legend.depot legend-depot-artifacts-api diff --git a/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/DependencyOverride.java b/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/DependencyOverride.java new file mode 100644 index 000000000..135f92450 --- /dev/null +++ b/legend-depot-core-data-api/src/main/java/org/finos/legend/depot/services/api/dependencies/DependencyOverride.java @@ -0,0 +1,27 @@ +// Copyright 2021 Goldman Sachs +// +// Licensed 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.finos.legend.depot.services.api.dependencies; + +import org.eclipse.collections.api.block.function.Function2; +import org.finos.legend.depot.domain.project.ProjectVersion; + +import java.util.List; +import java.util.Set; + +public interface DependencyOverride +{ + List overrideWith(List dependencies, List overridingDependencies, Function2, Boolean, Set> executableFunction); +} diff --git a/legend-depot-core-data-services/pom.xml b/legend-depot-core-data-services/pom.xml index 31eee5d82..e723a2e5e 100644 --- a/legend-depot-core-data-services/pom.xml +++ b/legend-depot-core-data-services/pom.xml @@ -39,10 +39,6 @@ org.finos.legend.depot legend-depot-metrics-query-api - - org.finos.legend.depot - legend-depot-artifacts-repository-api - diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/DependencyUtil.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/DependencyUtil.java index ca8b6f440..c83b0aad0 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/DependencyUtil.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/dependencies/DependencyUtil.java @@ -17,6 +17,7 @@ import org.eclipse.collections.api.block.function.Function2; import org.finos.legend.depot.domain.project.ProjectVersion; +import org.finos.legend.depot.services.api.dependencies.DependencyOverride; import java.util.Set; import java.util.Collections; @@ -25,16 +26,16 @@ import java.util.Collection; import java.util.stream.Collectors; -public class DependencyUtil +public class DependencyUtil implements DependencyOverride { - public List overrideDependencies(List directDependencies, List projectDependencies, Function2, Boolean, Set> executableFunction) + public List overrideWith(List dependencies, List overridingDependencies, Function2, Boolean, Set> executableFunction) { - Map> dependenciesLocator = projectDependencies.stream().collect(Collectors.groupingBy(dep -> dep.getGroupId() + dep.getArtifactId())); - Set overriddenDependencies = directDependencies.stream().map(dep -> dependenciesLocator.getOrDefault(dep.getGroupId() + dep.getArtifactId(), Collections.emptyList())).flatMap(Collection::stream).collect(Collectors.toSet()); - overriddenDependencies.removeAll(directDependencies); + Map> dependenciesLocator = dependencies.stream().collect(Collectors.groupingBy(dep -> dep.getGroupId() + dep.getArtifactId())); + Set overriddenDependencies = overridingDependencies.stream().map(dep -> dependenciesLocator.getOrDefault(dep.getGroupId() + dep.getArtifactId(), Collections.emptyList())).flatMap(Collection::stream).collect(Collectors.toSet()); + overriddenDependencies.removeAll(overridingDependencies); Set deleteDependencies = overriddenDependencies.parallelStream().map(dep -> executableFunction.apply(Collections.singletonList(dep), true)).flatMap(Collection::stream).collect(Collectors.toSet()); - projectDependencies.removeAll(deleteDependencies); - projectDependencies.removeAll(overriddenDependencies); - return projectDependencies; + dependencies.removeAll(deleteDependencies); + dependencies.removeAll(overriddenDependencies); + return dependencies; } } diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/CoreDataServicesModule.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/CoreDataServicesModule.java index 49bb6fac0..2f96ee88e 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/CoreDataServicesModule.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/CoreDataServicesModule.java @@ -19,6 +19,7 @@ import com.google.inject.Provides; import com.google.inject.Singleton; import com.google.inject.name.Names; +import org.finos.legend.depot.services.api.dependencies.DependencyOverride; import org.finos.legend.depot.services.api.projects.ProjectsService; import org.finos.legend.depot.services.dependencies.DependencyUtil; import org.finos.legend.depot.services.projects.ProjectsServiceImpl; @@ -37,13 +38,13 @@ protected void configure() expose(ProjectsService.class); expose(InfoService.class); - expose(DependencyUtil.class).annotatedWith(Names.named("dependencyUtil")); + expose(DependencyOverride.class).annotatedWith(Names.named("dependencyOverride")); } @Provides - @Named("dependencyUtil") + @Named("dependencyOverride") @Singleton - public DependencyUtil initialiseDependencyCache() + public DependencyOverride initialiseDependencyCache() { return new DependencyUtil(); } diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataServicesModule.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataServicesModule.java index 412c15857..59275464a 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataServicesModule.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/guice/ManageCoreDataServicesModule.java @@ -15,11 +15,7 @@ package org.finos.legend.depot.services.guice; -import org.finos.legend.depot.services.VersionsMismatchService; -import org.finos.legend.depot.services.api.dependencies.ManageDependenciesService; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.api.projects.ProjectsVersionsReconciliationService; -import org.finos.legend.depot.services.dependencies.ManageDependenciesServiceImpl; import org.finos.legend.depot.services.projects.ManageProjectsServiceImpl; public class ManageCoreDataServicesModule extends CoreDataServicesModule @@ -31,12 +27,7 @@ protected void configure() super.configure(); bind(ManageProjectsService.class).to(ManageProjectsServiceImpl.class); - bind(ManageDependenciesService.class).to(ManageDependenciesServiceImpl.class); - bind(ProjectsVersionsReconciliationService.class).to(VersionsMismatchService.class); - expose(ManageProjectsService.class); - expose(ManageDependenciesService.class); - expose(ProjectsVersionsReconciliationService.class); } } diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ManageProjectsServiceImpl.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ManageProjectsServiceImpl.java index 6c5584a5d..4a6814c59 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ManageProjectsServiceImpl.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ManageProjectsServiceImpl.java @@ -16,10 +16,10 @@ package org.finos.legend.depot.services.projects; import org.finos.legend.depot.domain.project.ProjectSummary; +import org.finos.legend.depot.services.api.dependencies.DependencyOverride; import org.finos.legend.depot.store.model.projects.StoreProjectData; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.dependencies.DependencyUtil; import org.finos.legend.depot.services.projects.configuration.ProjectsConfiguration; import org.finos.legend.depot.store.api.projects.UpdateProjects; import org.finos.legend.depot.store.api.projects.UpdateProjectsVersions; @@ -39,7 +39,7 @@ public class ManageProjectsServiceImpl extends ProjectsServiceImpl implements Ma private final UpdateProjects projects; @Inject - public ManageProjectsServiceImpl(UpdateProjectsVersions projectsVersions, UpdateProjects projects, @Named("queryMetricsRegistry") QueryMetricsRegistry metricsRegistry, Queue queue, ProjectsConfiguration configuration, @Named("dependencyUtil")DependencyUtil dependencyUtil) + public ManageProjectsServiceImpl(UpdateProjectsVersions projectsVersions, UpdateProjects projects, @Named("queryMetricsRegistry") QueryMetricsRegistry metricsRegistry, Queue queue, ProjectsConfiguration configuration, @Named("dependencyOverride") DependencyOverride dependencyUtil) { super(projectsVersions,projects, metricsRegistry, queue, configuration, dependencyUtil); this.projects = projects; diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ProjectsServiceImpl.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ProjectsServiceImpl.java index 23a98119c..6cf0b4480 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ProjectsServiceImpl.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/services/projects/ProjectsServiceImpl.java @@ -19,6 +19,7 @@ import org.finos.legend.depot.domain.notifications.EventPriority; import org.finos.legend.depot.domain.notifications.MetadataNotification; import org.finos.legend.depot.domain.project.ProjectVersionData; +import org.finos.legend.depot.services.api.dependencies.DependencyOverride; import org.finos.legend.depot.store.model.projects.StoreProjectData; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; import org.finos.legend.depot.domain.project.ProjectVersion; @@ -68,20 +69,20 @@ public class ProjectsServiceImpl implements ProjectsService private final ProjectsConfiguration configuration; - private final DependencyUtil dependencyUtil; + private final DependencyOverride dependencyOverride; private static final String EXCLUSION_FOUND_IN_STORE = "project version not found for %s-%s-%s, exclusion reason: %s"; private static final String NOT_FOUND_IN_STORE = "project version not found for %s-%s-%s"; @Inject - public ProjectsServiceImpl(ProjectsVersions projectsVersions, Projects projects, @Named("queryMetricsRegistry") QueryMetricsRegistry metricsRegistry, Queue queue, ProjectsConfiguration configuration, @Named("dependencyUtil") DependencyUtil dependencyUtil) + public ProjectsServiceImpl(ProjectsVersions projectsVersions, Projects projects, @Named("queryMetricsRegistry") QueryMetricsRegistry metricsRegistry, Queue queue, ProjectsConfiguration configuration, @Named("dependencyOverride") DependencyOverride dependencyOverride) { this.projectsVersions = projectsVersions; this.projects = projects; this.metricsRegistry = metricsRegistry; this.queue = queue; this.configuration = configuration; - this.dependencyUtil = dependencyUtil; + this.dependencyOverride = dependencyOverride; } public ProjectsServiceImpl(UpdateProjectsVersions projectsVersions, UpdateProjects projects, QueryMetricsRegistry metricsRegistry, Queue queue, ProjectsConfiguration configuration) @@ -91,7 +92,7 @@ public ProjectsServiceImpl(UpdateProjectsVersions projectsVersions, UpdateProjec this.metricsRegistry = metricsRegistry; this.queue = queue; this.configuration = configuration; - this.dependencyUtil = new DependencyUtil(); + this.dependencyOverride = new DependencyUtil(); } @Override @@ -227,13 +228,13 @@ public Set getDependencies(List projectVersions, String version = this.resolveAliasesAndCheckVersionExists(pv.getGroupId(), pv.getArtifactId(), pv.getVersionId()); StoreProjectVersionData projectData = this.getProject(pv.getGroupId(), pv.getArtifactId(), version); List projectVersionDependencies = projectData.getVersionData().getDependencies(); - dependencies.addAll(this.dependencyUtil.overrideDependencies(projectVersions, projectVersionDependencies, this::getDependencies)); + dependencies.addAll(this.dependencyOverride.overrideWith(projectVersionDependencies, projectVersions, this::getDependencies)); if (transitive && !projectVersionDependencies.isEmpty()) { if (projectData.getTransitiveDependenciesReport().isValid()) { // Transitive dependencies report contains both direct and transitive dependencies - dependencies.addAll(this.dependencyUtil.overrideDependencies(projectVersions, projectData.getTransitiveDependenciesReport().getTransitiveDependencies(), this::getDependencies)); + dependencies.addAll(this.dependencyOverride.overrideWith(projectData.getTransitiveDependenciesReport().getTransitiveDependencies(), projectVersions, this::getDependencies)); } else { diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/guice/ManageCoreDataResourcesModule.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/guice/ManageCoreDataResourcesModule.java index 9cb00270b..a65f1f1f9 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/guice/ManageCoreDataResourcesModule.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/guice/ManageCoreDataResourcesModule.java @@ -16,7 +16,6 @@ package org.finos.legend.depot.store.resources.guice; import com.google.inject.PrivateModule; -import org.finos.legend.depot.store.resources.dependencies.ManageDependenciesResource; import org.finos.legend.depot.store.resources.projects.ManageProjectsResource; import org.finos.legend.depot.store.resources.versions.ManageProjectsVersionsResource; @@ -27,11 +26,9 @@ public class ManageCoreDataResourcesModule extends PrivateModule protected void configure() { bind(ManageProjectsResource.class); - bind(ManageDependenciesResource.class); bind(ManageProjectsVersionsResource.class); expose(ManageProjectsResource.class); - expose(ManageDependenciesResource.class); expose(ManageProjectsVersionsResource.class); } diff --git a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/versions/ManageProjectsVersionsResource.java b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/versions/ManageProjectsVersionsResource.java index ac27b05b1..407cbcb15 100644 --- a/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/versions/ManageProjectsVersionsResource.java +++ b/legend-depot-core-data-services/src/main/java/org/finos/legend/depot/store/resources/versions/ManageProjectsVersionsResource.java @@ -20,9 +20,7 @@ import io.swagger.annotations.ApiParam; import org.finos.legend.depot.core.authorisation.api.AuthorisationProvider; import org.finos.legend.depot.core.authorisation.resources.BaseAuthorisedResource; -import org.finos.legend.depot.domain.version.VersionMismatch; import org.finos.legend.depot.services.api.projects.ManageProjectsService; -import org.finos.legend.depot.services.api.projects.ProjectsVersionsReconciliationService; import org.finos.legend.depot.store.model.projects.StoreProjectVersionData; import org.finos.legend.depot.tracing.resources.ResourceLoggingAndTracing; @@ -46,15 +44,13 @@ public class ManageProjectsVersionsResource extends BaseAuthorisedResource public static final String PROJECTS_VERSIONS_RESOURCE = "Versions"; private final ManageProjectsService projectVersionApi; - private final ProjectsVersionsReconciliationService repositoryService; + @Inject - public ManageProjectsVersionsResource(ManageProjectsService projectVersionApi, ProjectsVersionsReconciliationService repositoryService, AuthorisationProvider authorisationProvider, @Named("requestPrincipal") Provider principalProvider) + public ManageProjectsVersionsResource(ManageProjectsService projectVersionApi, AuthorisationProvider authorisationProvider, @Named("requestPrincipal") Provider principalProvider) { super(authorisationProvider, principalProvider); this.projectVersionApi = projectVersionApi; - this.repositoryService = repositoryService; - } @Override @@ -84,13 +80,6 @@ public StoreProjectVersionData excludeProjectVersion(@PathParam("groupId") Strin ); } - @GET - @Path("/versions/mismatch") - @ApiOperation(ResourceLoggingAndTracing.GET_PROJECT_CACHE_MISMATCHES) - @Produces(MediaType.APPLICATION_JSON) - public List getVersionMissMatches() - { - return handle(ResourceLoggingAndTracing.GET_PROJECT_CACHE_MISMATCHES, () -> this.repositoryService.findVersionsMismatches()); - } + } diff --git a/legend-depot-metrics-query-store-mongo/pom.xml b/legend-depot-metrics-query-store-mongo/pom.xml index 6cbd3476f..ebaffcd9c 100644 --- a/legend-depot-metrics-query-store-mongo/pom.xml +++ b/legend-depot-metrics-query-store-mongo/pom.xml @@ -37,10 +37,6 @@ org.finos.legend.depot legend-depot-store-mongo - - org.finos.legend.depot - legend-depot-core-schedules-api - org.finos.legend.depot legend-depot-store-mongo diff --git a/legend-depot-store-server/src/main/java/org/finos/legend/depot/store/server/LegendDepotStoreServer.java b/legend-depot-store-server/src/main/java/org/finos/legend/depot/store/server/LegendDepotStoreServer.java index b67f40915..bc32434f5 100644 --- a/legend-depot-store-server/src/main/java/org/finos/legend/depot/store/server/LegendDepotStoreServer.java +++ b/legend-depot-store-server/src/main/java/org/finos/legend/depot/store/server/LegendDepotStoreServer.java @@ -23,7 +23,7 @@ import org.finos.legend.depot.core.http.resources.InfoPageModule; import org.finos.legend.depot.services.guice.ArtifactsSchedulesModule; import org.finos.legend.depot.services.guice.ArtifactsServicesModule; -import org.finos.legend.depot.services.guice.ManageCoreDataSchedulesModule; +import org.finos.legend.depot.services.guice.VersionReconciliationSchedulesModule; import org.finos.legend.depot.services.guice.ManageCoreDataServicesModule; import org.finos.legend.depot.services.guice.ManageEntitiesServicesModule; import org.finos.legend.depot.services.guice.ManageGenerationsServicesModule; @@ -94,7 +94,7 @@ protected List getServerModules() new ManageCoreDataResourcesModule(), new ManageCoreDataServicesModule(), new ManageCoreDataStoreMongoModule(), - new ManageCoreDataSchedulesModule(), + new VersionReconciliationSchedulesModule(), new CoreDataMigrationsStoreMongoModule(), new ManageEntitiesResourcesModule(),