From ce572f4d9f76fdd8366125bd3f1d68e51f1c5234 Mon Sep 17 00:00:00 2001 From: Oliver <20188437+olivergrabinski@users.noreply.github.com> Date: Mon, 15 Apr 2024 14:51:06 +0200 Subject: [PATCH] Don't handle the search views right now --- build.sbt | 1 - ship/src/main/resources/ship-default.conf | 5 ---- .../nexus/ship/config/ViewDefaults.scala | 3 +- .../ship/views/CompositeViewProcessor.scala | 29 ++++--------------- .../bluebrain/nexus/ship/RunShipSuite.scala | 2 +- 5 files changed, 7 insertions(+), 33 deletions(-) diff --git a/build.sbt b/build.sbt index b052802188..c62c0df1e5 100755 --- a/build.sbt +++ b/build.sbt @@ -751,7 +751,6 @@ lazy val ship = project compositeViewsPlugin % "compile->compile", elasticsearchPlugin % "compile->compile", storagePlugin % "compile->compile;test->test", - searchPlugin % "compile->compile", tests % "test->compile;test->test" ) .settings( diff --git a/ship/src/main/resources/ship-default.conf b/ship/src/main/resources/ship-default.conf index a9a850aa89..d233502cf9 100644 --- a/ship/src/main/resources/ship-default.conf +++ b/ship/src/main/resources/ship-default.conf @@ -64,11 +64,6 @@ ship { name = "Default Sparql view" description = "A Sparql view of all resources in the project." } - - search { - name = "Default global search view" - description = "An Elasticsearch view of configured resources for the global search." - } } # Service account configuration for internal operations diff --git a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/config/ViewDefaults.scala b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/config/ViewDefaults.scala index c2f7b4ae45..6c638c57a3 100644 --- a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/config/ViewDefaults.scala +++ b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/config/ViewDefaults.scala @@ -6,8 +6,7 @@ import pureconfig.generic.semiauto.deriveReader case class ViewDefaults( elasticsearch: Defaults, - blazegraph: Defaults, - search: Defaults + blazegraph: Defaults ) object ViewDefaults { diff --git a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/views/CompositeViewProcessor.scala b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/views/CompositeViewProcessor.scala index 90c6c5b49f..6508ee2807 100644 --- a/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/views/CompositeViewProcessor.scala +++ b/ship/src/main/scala/ch/epfl/bluebrain/nexus/ship/views/CompositeViewProcessor.scala @@ -6,7 +6,6 @@ import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.CompositeViews import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewEvent import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewEvent._ import ch.epfl.bluebrain.nexus.delta.plugins.compositeviews.model.CompositeViewRejection.{IncorrectRev, ResourceAlreadyExists} -import ch.epfl.bluebrain.nexus.delta.rdf.Vocabulary.nxv import ch.epfl.bluebrain.nexus.delta.rdf.jsonld.api.JsonLdApi import ch.epfl.bluebrain.nexus.delta.sdk.identities.model.Caller import ch.epfl.bluebrain.nexus.delta.sdk.projects.FetchContext @@ -38,31 +37,13 @@ class CompositeViewProcessor(views: UUID => IO[CompositeViews], projectMapper: P implicit val c: Caller = Caller(s, Set.empty) val cRev = event.rev - 1 val project = projectMapper.map(event.project) - val searchViewId = nxv + "searchView" event match { - case e: CompositeViewCreated => - e.id match { - case id if id == searchViewId => IO.unit // The search view is created upon project creation - case _ => views(event.uuid).flatMap(_.create(project, e.source)) - } - case e: CompositeViewUpdated => - e.id match { - case id if id == searchViewId => IO.unit - case _ => views(event.uuid).flatMap(_.update(e.id, project, cRev, e.source)) - } - case e: CompositeViewDeprecated => - e.id match { - case id if id == searchViewId => IO.unit - case _ => views(event.uuid).flatMap(_.deprecate(e.id, project, cRev)) - } - case e: CompositeViewUndeprecated => - e.id match { - case id if id == searchViewId => IO.unit - case _ => views(event.uuid).flatMap(_.undeprecate(e.id, project, cRev)) - } - case _: CompositeViewTagAdded => - IO.unit // TODO: Can/should we tag? + case e: CompositeViewCreated => views(event.uuid).flatMap(_.create(project, e.source)) + case e: CompositeViewUpdated => views(event.uuid).flatMap(_.update(e.id, project, cRev, e.source)) + case e: CompositeViewDeprecated => views(event.uuid).flatMap(_.deprecate(e.id, project, cRev)) + case e: CompositeViewUndeprecated => views(event.uuid).flatMap(_.undeprecate(e.id, project, cRev)) + case _: CompositeViewTagAdded => IO.unit // TODO: Can/should we tag? } }.redeemWith( { diff --git a/ship/src/test/scala/ch/epfl/bluebrain/nexus/ship/RunShipSuite.scala b/ship/src/test/scala/ch/epfl/bluebrain/nexus/ship/RunShipSuite.scala index c38a82359e..ea5a2142cc 100644 --- a/ship/src/test/scala/ch/epfl/bluebrain/nexus/ship/RunShipSuite.scala +++ b/ship/src/test/scala/ch/epfl/bluebrain/nexus/ship/RunShipSuite.scala @@ -11,7 +11,7 @@ import ch.epfl.bluebrain.nexus.delta.sdk.resources.Resources import ch.epfl.bluebrain.nexus.delta.sourcing.Transactors import ch.epfl.bluebrain.nexus.delta.sourcing.model.EntityType import ch.epfl.bluebrain.nexus.delta.sourcing.offset.Offset -import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie.{PostgresPassword, PostgresUser, transactors} +import ch.epfl.bluebrain.nexus.delta.sourcing.postgres.Doobie.{transactors, PostgresPassword, PostgresUser} import ch.epfl.bluebrain.nexus.ship.ImportReport.Count import ch.epfl.bluebrain.nexus.ship.RunShipSuite.{checkFor, clearDB, expectedImportReport, getDistinctOrgProjects} import ch.epfl.bluebrain.nexus.testkit.config.SystemPropertyOverride