Skip to content

Commit

Permalink
Upgrade collector to 3.2.0 and enrich to 4.2.0
Browse files Browse the repository at this point in the history
New collector and enrich versions mean:

* Cats Effect 3
* Http4s as web server, so no more Akka HTTP
* Using IO monad instead of Id

To be consistent with other Snowplow applications, this commit also brings small improvements to configuration loading.
Just like collector configuration, iglu resolver and all enrichments support HOCON configuration format.

As collector 3.2.x is on scala 2.13 and enrich 4.X on scala 2.12, it was easier to cross compile collector to 2.12 than upgrade enrich to 2.13. That's why micro is still on scala 2.12.
  • Loading branch information
pondzix committed Apr 9, 2024
1 parent 2b4150d commit 54ee753
Show file tree
Hide file tree
Showing 24 changed files with 1,116 additions and 1,021 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:

- name: Publish collector locally
run: |
git clone --branch 2.8.1 --depth 1 https://github.com/snowplow/stream-collector.git
git clone --branch 3.2.0 --depth 1 https://github.com/snowplow/stream-collector.git
cd stream-collector
sbt publishLocal
sbt +publishLocal
- name: Run sbt
run: sbt test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:

- name: Publish collector locally
run: |
git clone --branch 2.8.1 --depth 1 https://github.com/snowplow/stream-collector.git
git clone --branch 3.2.0 --depth 1 https://github.com/snowplow/stream-collector.git
cd stream-collector
sbt publishLocal
sbt +publishLocal
- name: Run sbt
run: sbt test
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Assuming [Git][git] and [sbt][sbt]:
git clone git@github.com:snowplow-incubator/snowplow-micro.git
cd snowplow-micro
git clone --branch 2.8.1 --depth 1 git@github.com:snowplow/stream-collector.git
git clone --branch 3.2.0 --depth 1 git@github.com:snowplow/stream-collector.git
cd stream-collector
sbt publishLocal && cd ..
sbt +publishLocal && cd ..
sbt test
```
Expand Down
21 changes: 12 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
* Copyright (c) 2019-2022 Snowplow Analytics Ltd. All rights reserved.
*/
import com.typesafe.sbt.packager.MappingsHelper.directory
import com.typesafe.sbt.packager.docker._
import com.typesafe.sbt.packager.docker.*

import scala.collection.Seq

lazy val buildSettings = Seq(
name := "snowplow-micro",
Expand All @@ -20,37 +22,38 @@ lazy val buildSettings = Seq(
baseDirectory.value / "ui" / "out"
),
Compile / unmanagedResources += file("LICENSE.md"),
resolvers ++= Dependencies.resolvers
resolvers ++= Dependencies.resolvers,
Test / parallelExecution := false
)

lazy val dependencies = Seq(
libraryDependencies ++= Seq(
Dependencies.snowplowStreamCollector,
Dependencies.snowplowCommonEnrich,
Dependencies.decline,
Dependencies.http4sCirce,
Dependencies.circeJawn,
Dependencies.circeGeneric,
Dependencies.specs2,
Dependencies.specs2CE,
Dependencies.badRows
)
)

lazy val exclusions = Seq(
excludeDependencies ++= Dependencies.exclusions
)

lazy val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](organization, name, version, scalaVersion),
buildInfoPackage := "buildinfo"
buildInfoKeys := Seq[BuildInfoKey](name, moduleName, dockerAlias, version, "shortName" -> "micro-ssc"),
buildInfoPackage := "com.snowplowanalytics.snowplow.micro",
buildInfoOptions += BuildInfoOption.Traits("com.snowplowanalytics.snowplow.collector.core.AppInfo")
)


lazy val dynVerSettings = Seq(
ThisBuild / dynverVTagPrefix := false, // Otherwise git tags required to have v-prefix
ThisBuild / dynverSeparator := "-" // to be compatible with docker
)

lazy val commonSettings =
dependencies ++
exclusions ++
buildSettings ++
buildInfoSettings ++
dynVerSettings ++
Expand Down
23 changes: 13 additions & 10 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,36 @@ object Dependencies {

object V {
// Snowplow
val snowplowStreamCollector = "2.8.1"
val snowplowCommonEnrich = "3.8.0"
val snowplowStreamCollector = "3.2.0"
val snowplowCommonEnrich = "4.2.0"
val http4sCirce = "0.23.23"

val decline = "2.4.1"

// circe
val circe = "0.14.2"

// specs2
val specs2 = "4.12.2"
val specs2CE = "1.5.0"

// force versions of transitive dependencies
val badRows = "2.2.0"
}

val exclusions = Seq(
"org.apache.tomcat.embed" % "tomcat-embed-core"
)

// Snowplow stream collector
val snowplowStreamCollector = "com.snowplowanalytics" %% "snowplow-stream-collector-core" % V.snowplowStreamCollector
val snowplowCommonEnrich = "com.snowplowanalytics" %% "snowplow-common-enrich" % V.snowplowCommonEnrich
val snowplowStreamCollector = "com.snowplowanalytics" %% "snowplow-stream-collector-http4s-core" % V.snowplowStreamCollector
val snowplowCommonEnrich = "com.snowplowanalytics" %% "snowplow-common-enrich" % V.snowplowCommonEnrich

val http4sCirce = "org.http4s" %% "http4s-circe" % V.http4sCirce
val decline = "com.monovore" %% "decline-effect" % V.decline

// circe
val circeJawn = "io.circe" %% "circe-jawn" % V.circe
val circeGeneric = "io.circe" %% "circe-generic" % V.circe

// specs2
val specs2 = "org.specs2" %% "specs2-core" % V.specs2 % Test
val specs2 = "org.specs2" %% "specs2-core" % V.specs2 % Test
val specs2CE = "org.typelevel" %% "cats-effect-testing-specs2" % V.specs2CE % Test

// transitive
val badRows = "com.snowplowanalytics" %% "snowplow-badrows" % V.badRows
Expand Down
13 changes: 6 additions & 7 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
logLevel := Level.Warn

addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.0.0")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.3")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.4.2")
addSbtPlugin("com.snowplowanalytics" % "sbt-snowplow-release" % "0.3.1")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.0.0")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
Loading

0 comments on commit 54ee753

Please sign in to comment.