From 0fa2b88671d9f0eeb6828bcc6f9af64975e50a11 Mon Sep 17 00:00:00 2001 From: Jakub Chrobasik Date: Mon, 12 Feb 2024 17:37:04 +0100 Subject: [PATCH] refactor: 'events' segment in the avro namespace; renamed 'messages' to 'events' --- build.sbt | 12 ++++++------ modules/{messages => events}/src/main/avro/api.avdl | 0 .../io/renku/events}/SerializeDeserializeTest.scala | 3 ++- .../renku/search/provision/SearchProvisioner.scala | 2 +- .../search/provision/SearchProvisionerSpec.scala | 2 +- project/AvroSchemaDownload.scala | 8 +------- 6 files changed, 11 insertions(+), 16 deletions(-) rename modules/{messages => events}/src/main/avro/api.avdl (100%) rename modules/{messages/src/test/scala/io/renku/messages => events/src/test/scala/io/renku/events}/SerializeDeserializeTest.scala (95%) diff --git a/build.sbt b/build.sbt index 1469b243..287f638a 100644 --- a/build.sbt +++ b/build.sbt @@ -54,7 +54,7 @@ lazy val root = project .aggregate( commons, httpClient, - messages, + events, redisClient, solrClient, searchSolrClient, @@ -204,11 +204,11 @@ lazy val http4sAvro = project avroCodec % "compile->compile;test->test" ) -lazy val messages = project - .in(file("modules/messages")) +lazy val events = project + .in(file("modules/events")) .settings(commonSettings) .settings( - name := "messages" + name := "events" ) .dependsOn( commons % "compile->compile;test->test", @@ -227,7 +227,7 @@ lazy val configValues = project ) .dependsOn( commons % "compile->compile;test->test", - messages % "compile->compile;test->test", + events % "compile->compile;test->test", redisClient % "compile->compile;test->test", searchSolrClient % "compile->compile;test->test" ) @@ -242,7 +242,7 @@ lazy val searchProvision = project ) .dependsOn( commons % "compile->compile;test->test", - messages % "compile->compile;test->test", + events % "compile->compile;test->test", redisClient % "compile->compile;test->test", searchSolrClient % "compile->compile;test->test", configValues % "compile->compile;test->test" diff --git a/modules/messages/src/main/avro/api.avdl b/modules/events/src/main/avro/api.avdl similarity index 100% rename from modules/messages/src/main/avro/api.avdl rename to modules/events/src/main/avro/api.avdl diff --git a/modules/messages/src/test/scala/io/renku/messages/SerializeDeserializeTest.scala b/modules/events/src/test/scala/io/renku/events/SerializeDeserializeTest.scala similarity index 95% rename from modules/messages/src/test/scala/io/renku/messages/SerializeDeserializeTest.scala rename to modules/events/src/test/scala/io/renku/events/SerializeDeserializeTest.scala index 431cd96e..538b6609 100644 --- a/modules/messages/src/test/scala/io/renku/messages/SerializeDeserializeTest.scala +++ b/modules/events/src/test/scala/io/renku/events/SerializeDeserializeTest.scala @@ -16,11 +16,12 @@ * limitations under the License. */ -package io.renku.messages +package io.renku.events import io.renku.avro.codec.decoders.all.given import io.renku.avro.codec.encoders.all.given import io.renku.avro.codec.{AvroDecoder, AvroEncoder, AvroIO} +import io.renku.events.v1.{ProjectCreated, Visibility} import munit.FunSuite import java.time.Instant diff --git a/modules/search-provision/src/main/scala/io/renku/search/provision/SearchProvisioner.scala b/modules/search-provision/src/main/scala/io/renku/search/provision/SearchProvisioner.scala index a3a012fc..7924b45e 100644 --- a/modules/search-provision/src/main/scala/io/renku/search/provision/SearchProvisioner.scala +++ b/modules/search-provision/src/main/scala/io/renku/search/provision/SearchProvisioner.scala @@ -25,7 +25,7 @@ import fs2.Chunk import fs2.io.net.Network import io.renku.avro.codec.AvroReader import io.renku.avro.codec.decoders.all.given -import io.renku.messages.ProjectCreated +import io.renku.events.v1.ProjectCreated import io.renku.queue.client.* import io.renku.redis.client.RedisUrl import io.renku.search.solr.client.SearchSolrClient diff --git a/modules/search-provision/src/test/scala/io/renku/search/provision/SearchProvisionerSpec.scala b/modules/search-provision/src/test/scala/io/renku/search/provision/SearchProvisionerSpec.scala index 2f7dd501..a459c93d 100644 --- a/modules/search-provision/src/test/scala/io/renku/search/provision/SearchProvisionerSpec.scala +++ b/modules/search-provision/src/test/scala/io/renku/search/provision/SearchProvisionerSpec.scala @@ -24,7 +24,7 @@ import fs2.Stream import fs2.concurrent.SignallingRef import io.renku.avro.codec.AvroIO import io.renku.avro.codec.encoders.all.given -import io.renku.messages.{ProjectCreated, Visibility} +import io.renku.events.v1.{ProjectCreated, Visibility} import io.renku.queue.client.Encoding import io.renku.redis.client.RedisClientGenerators import io.renku.redis.client.RedisClientGenerators.* diff --git a/project/AvroSchemaDownload.scala b/project/AvroSchemaDownload.scala index 285cdb65..c947b8e7 100644 --- a/project/AvroSchemaDownload.scala +++ b/project/AvroSchemaDownload.scala @@ -57,13 +57,7 @@ object AvroSchemaDownload extends AutoPlugin { Compile / sourceGenerators += Def .sequential( schemaDownloadRepository, - Compile / avroScalaGenerate, - Def.task { - val out = (Compile / avroScalaSource).value - val pkg = "io.renku.messages" - val logger = streams.value.log - evilHackAddPackage(logger, out, pkg) - } + Compile / avroScalaGenerate ) .taskValue )