Skip to content

Commit

Permalink
Use shortname for collector name
Browse files Browse the repository at this point in the history
Previously we've moved on to using a full name which was incompatible
with the old format.
Now the name uses the expected short name (`ssc-$VERSION-$SINK`) format.
  • Loading branch information
peel committed Dec 14, 2023
1 parent ec5a74f commit 4ea0142
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ trait AppInfo {
def moduleName: String
def version: String
def dockerAlias: String
def shortName: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ class Service[F[_]: Sync](

val pixelStream = Stream.iterable[F, Byte](Service.pixel)

private val collector = s"${appInfo.name}:${appInfo.version}"
private val collector =
s"""${appInfo.shortName}-${appInfo.version}-${sinks.good.getClass.getSimpleName.toLowerCase}"""

private val splitBatch: SplitBatch = SplitBatch(appInfo)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class ServiceSpec extends Specification {
e.schema shouldEqual "iglu:com.snowplowanalytics.snowplow/CollectorPayload/thrift/1-0-0"
e.ipAddress shouldEqual "192.0.2.3"
e.encoding shouldEqual "UTF-8"
e.collector shouldEqual s"${TestUtils.appName}:${TestUtils.appVersion}"
e.collector shouldEqual s"${TestUtils.appInfo.shortName}-${TestUtils.appVersion}-testsink"
e.querystring shouldEqual "a=b"
e.body shouldEqual "b"
e.path shouldEqual "p"
Expand Down Expand Up @@ -427,7 +427,7 @@ class ServiceSpec extends Specification {
e.schema shouldEqual "iglu:com.snowplowanalytics.snowplow/CollectorPayload/thrift/1-0-0"
e.ipAddress shouldEqual "ip"
e.encoding shouldEqual "UTF-8"
e.collector shouldEqual s"${TestUtils.appName}:${TestUtils.appVersion}"
e.collector shouldEqual s"${TestUtils.appInfo.shortName}-${TestUtils.appVersion}-testsink"
e.querystring shouldEqual "q"
e.body shouldEqual "b"
e.path shouldEqual "p"
Expand Down Expand Up @@ -456,7 +456,7 @@ class ServiceSpec extends Specification {
e.schema shouldEqual "iglu:com.snowplowanalytics.snowplow/CollectorPayload/thrift/1-0-0"
e.ipAddress shouldEqual "ip"
e.encoding shouldEqual "UTF-8"
e.collector shouldEqual s"${TestUtils.appName}:${TestUtils.appVersion}"
e.collector shouldEqual s"${TestUtils.appInfo.shortName}-${TestUtils.appVersion}-testsink"
e.querystring shouldEqual null
e.body shouldEqual null
e.path shouldEqual "p"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ object TestUtils {
def moduleName = appName
def version = appVersion
def dockerAlias = "docker run collector"
def shortName = "ssc"
}

def noopSink[F[_]: Applicative]: Sink[F] = new Sink[F] {
Expand Down
2 changes: 1 addition & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ object BuildSettings {
addExampleConfToTestCp

lazy val buildInfoSettings = Seq(
buildInfoKeys := Seq[BuildInfoKey](name, moduleName, dockerAlias, version),
buildInfoKeys := Seq[BuildInfoKey](name, moduleName, dockerAlias, version, "shortName" -> "ssc"),
buildInfoOptions += BuildInfoOption.Traits("com.snowplowanalytics.snowplow.collector.core.AppInfo"),
buildInfoPackage := s"com.snowplowanalytics.snowplow.collectors.scalastream"
)
Expand Down

0 comments on commit 4ea0142

Please sign in to comment.