Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to prepare for Scala Steward #50

Merged
merged 13 commits into from
Nov 11, 2021
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ target/

# IDE
.idea/
.vscode/
*.iml
.metals/
.bsp/
project/metals.sbt
project/project/
.history/

# Scala
*.class
17 changes: 17 additions & 0 deletions .scala-steward.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Reference conf file -> https://github.com/scala-steward-org/scala-steward/blob/master/docs/repo-specific-configuration.md

updates.pin = [
{groupId = "com.sky:akka-streams", version = "4.0.1"}, # 4.0.4 not yet available in Alterfactory
Smudgey marked this conversation as resolved.
Show resolved Hide resolved
{groupId = "com.sky:akka-streams-kafka", version = "4.0.1"}, # 4.0.4 not yet available in Alterfactory
Smudgey marked this conversation as resolved.
Show resolved Hide resolved
]

# If set, Scala Steward will only create or update `n` PRs each time it runs (see `pullRequests.frequency` above).
# Useful if running frequently and/or CI build are costly
updates.limit = 2

# If "always", Scala Steward will always update the PR it created as long as
# you don't change it yourself.
updatePullRequests = "always"

# If set, Scala Steward will use this message template for the commit messages and PR titles.
commits.message = "Update ${artifactName} from ${currentVersion} to ${nextVersion}"
1 change: 1 addition & 0 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ newlines.sometimesBeforeColonInMethodReturnType = false
rewrite.rules = [SortImports, RedundantBraces, RedundantParens, PreferCurlyFors]

project.git = true
lineEndings = preserve

spaces.beforeContextBoundColon = true
38 changes: 17 additions & 21 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
organization := "com.sky"
scalaVersion := "2.13.2"
scalaVersion := "2.13.7"
name := "kafka-topic-loader"

crossScalaVersions := Seq("2.12.11", "2.13.2")
crossScalaVersions := Seq("2.12.15", "2.13.7")

scalacOptions ++= Seq(
// format: off
ThisBuild / scalacOptions ++= Seq(
"-deprecation",
"-encoding",
"utf-8",
"-encoding", "utf8",
"-explaintypes",
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xcheckinit",
"-Xfatal-warnings",
"-Xlint",
"-Ywarn-dead-code",
"-Ywarn-extra-implicit",
"-Ywarn-numeric-widen",
Expand All @@ -31,40 +29,38 @@ scalacOptions ++= Seq(
if (scalaBinaryVersion.value == "2.13") Seq("-Wconf:msg=annotation:silent")
else Seq("-Xfuture", "-Ypartial-unification", "-Yno-adapted-args")
}
// format: on

scalafmtVersion := "1.5.1"
scalafmtOnCompile := true

parallelExecution in Test := false
fork in Test := true
Test / parallelExecution := false
Test / fork := true

releaseCrossBuild := true
bintrayOrganization := Some("sky-uk")
bintrayReleaseOnPublish in ThisBuild := false
bintrayRepository := "oss-maven"
bintrayVcsUrl := Some("https://github.com/sky-uk/kafka-topic-loader")
licenses += ("BSD New", url("https://opensource.org/licenses/BSD-3-Clause"))

val AkkaVersion = "2.6.5"
val CatsVersion = "2.1.1"
val AkkaVersion = "2.6.16"
val CatsVersion = "2.6.1"
val KafkaVersion = "2.8.0"
val RefinedVersion = "0.9.27"

// @formatter:off
libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream" % AkkaVersion,
"com.typesafe.akka" %% "akka-stream-kafka" % "2.0.3",
"org.apache.kafka" % "kafka-clients" % "2.5.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"com.typesafe.akka" %% "akka-stream-kafka" % "2.1.1",
"org.apache.kafka" % "kafka-clients" % KafkaVersion,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.4",
"org.typelevel" %% "cats-core" % CatsVersion,
"org.typelevel" %% "cats-kernel" % CatsVersion,
"eu.timepit" %% "refined" % RefinedVersion,
"eu.timepit" %% "refined-pureconfig" % RefinedVersion,
"com.github.pureconfig" %% "pureconfig" % "0.17.0",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.1.6",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.5.0",
"com.typesafe.akka" %% "akka-stream-testkit" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-testkit" % AkkaVersion % Test,
"org.scalatest" %% "scalatest" % "3.1.2" % Test,
"io.github.embeddedkafka" %% "embedded-kafka" % "2.7.0" % Test
"org.scalatest" %% "scalatest" % "3.2.9" % Test,
"io.github.embeddedkafka" %% "embedded-kafka" % KafkaVersion % Test
)
// @formatter:on

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.3.10
sbt.version=1.5.5
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.10")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.16")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.10")
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.16")
6 changes: 2 additions & 4 deletions src/main/scala/com/sky/kafka/topicloader/TopicLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ import org.apache.kafka.clients.consumer._
import org.apache.kafka.common.serialization._
import cats.syntax.bifunctor._
import org.apache.kafka.common.TopicPartition
import pureconfig._
import pureconfig.ConfigSource
import pureconfig.generic.auto._

import scala.annotation.nowarn
import scala.concurrent.Future
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object TopicLoader extends TopicLoader with DeprecatedMethods {
private[topicloader] case class LogOffsets(lowest: Long, highest: Long)
Expand Down Expand Up @@ -65,7 +64,6 @@ object TopicLoader extends TopicLoader with DeprecatedMethods {
_.map(tp => s"${tp.topic}:${tp.partition}").mkString(", ")
}

@nowarn("msg=JavaConverters")
trait TopicLoader extends LazyLogging {

import TopicLoader._
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/base/AkkaSpecBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import org.scalatest.{BeforeAndAfterAll, Suite}
import org.scalatest.matchers.should.Matchers

import scala.concurrent.ExecutionContext
import scala.concurrent.duration._
import scala.concurrent.duration.DurationInt

abstract class AkkaSpecBase extends TestKitBase with Suite with BeforeAndAfterAll with Matchers {

Expand Down
11 changes: 5 additions & 6 deletions src/test/scala/base/IntegrationSpecBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import akka.util.Timeout
import cats.data.NonEmptyList
import cats.syntax.option._
import com.typesafe.config.ConfigFactory
import net.manub.embeddedkafka.{EmbeddedKafka, EmbeddedKafkaConfig}
import io.github.embeddedkafka.{EmbeddedKafka, EmbeddedKafkaConfig}
import io.github.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import org.apache.kafka.clients.CommonClientConfigs
import org.apache.kafka.clients.consumer.{Consumer, ConsumerConfig, ConsumerRecord, ConsumerRecords}
import org.apache.kafka.clients.producer.ProducerConfig
import org.apache.kafka.common.TopicPartition
import org.scalatest.Assertion
import org.scalatest.concurrent.Eventually
import net.manub.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import utils.RandomPort

import scala.annotation.{nowarn, tailrec}
import scala.collection.JavaConverters._
import scala.concurrent.duration._
import scala.annotation.tailrec
import scala.jdk.CollectionConverters._
import scala.concurrent.duration.DurationInt

@nowarn("msg=JavaConverters")
abstract class IntegrationSpecBase extends WordSpecBase with Eventually {

override implicit val patienceConfig = PatienceConfig(20.seconds, 200.millis)
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/integration/DeprecatedMethodsIntSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ import akka.util.Timeout
import base.IntegrationSpecBase
import cats.data.NonEmptyList
import com.sky.kafka.topicloader._
import net.manub.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import io.github.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import org.apache.kafka.clients.consumer._
import org.apache.kafka.common.TopicPartition

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import scala.concurrent.Future

@deprecated("Remove when deprecated methods are gone", "")
class DeprecatedMethodsIntSpec extends IntegrationSpecBase {

"fromTopics" should {
"execute onRecord for all messages in provided topics" in new TestContext {
val store = new RecordStore()
val store = new RecordStore
val (recordsTopic1, recordsTopic2) = records(1 to 30).splitAt(15)
val topics = NonEmptyList.of(testTopic1, testTopic2)

Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/integration/TopicLoaderIntSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import base.IntegrationSpecBase
import cats.data.NonEmptyList
import com.sky.kafka.topicloader._
import com.typesafe.config.ConfigFactory
import net.manub.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import io.github.embeddedkafka.Codecs.{stringDeserializer, stringSerializer}
import org.apache.kafka.common.errors.{TimeoutException => KafkaTimeoutException}
import org.scalatest.prop.TableDrivenPropertyChecks._
import org.scalatest.prop.Tables.Table
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "1.4.2-SNAPSHOT"
ThisBuild / version := "1.4.2-SNAPSHOT"