Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into subscription-stream…
Browse files Browse the repository at this point in the history
…-control
  • Loading branch information
svroonland committed Apr 14, 2024
2 parents 4c1e68d + 2bb6212 commit a38185e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Check all code compiles
run: sbt +Test/compile
- name: Check artifacts build process
Expand All @@ -60,7 +60,7 @@ jobs:
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Check if the site workflow is up to date
run: sbt ciCheckGithubWorkflow
- name: Lint
Expand All @@ -86,7 +86,7 @@ jobs:
java-version: ${{ matrix.java }}
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Git Checkout
uses: actions/checkout@v4.1.1
with:
Expand All @@ -112,7 +112,7 @@ jobs:
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Generate Readme
run: sbt docs/generateReadme
- name: Commit Changes
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Release
run: sbt ci-release
env:
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
java-version: '17'
check-latest: true
- name: Cache Dependencies
uses: coursier/cache-action@v6.4.5
uses: coursier/cache-action@v6.4.6
- name: Setup NodeJs
uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/profile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
distribution: temurin
java-version: 17
check-latest: true
- uses: coursier/cache-action@v6.4.5
- uses: coursier/cache-action@v6.4.6
- uses: VirtusLab/scala-cli-setup@main
- name: Use CI sbt jvmopts
shell: bash
Expand Down
29 changes: 25 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import sbt.Def
import MimaSettings.mimaSettings

/**
* As of zio-kafka version 2.8.0 releases are binary compatible. This is checked with Mima.
*
* Keep this value set to the oldest minor release (with patch version set to "0") that is still binary compatible.
*
* Set this value to `None` when master is _not_ binary compatible with the latest minor release, the next release shall
* increase the minor version.
*/
lazy val binCompatVersionToCompare = None // Some("2.8.0")

lazy val kafkaVersion = "3.7.0"
lazy val embeddedKafkaVersion = "3.7.0" // Should be the same as kafkaVersion, except for the patch part
Expand All @@ -15,7 +26,7 @@ lazy val _scala3 = "3.3.3"
inThisBuild(
List(
name := "ZIO Kafka",
zioVersion := "2.0.21",
zioVersion := "2.0.22",
scalaVersion := _scala213,
// zio-sbt defines these 'scala213' and 'scala3' settings, but we need to define them here to override the defaults and better control them
scala213 := _scala213,
Expand Down Expand Up @@ -66,9 +77,10 @@ val excludeInferAny = { options: Seq[String] => options.filterNot(Set("-Xlint:in
lazy val root = project
.in(file("."))
.settings(
name := "zio-kafka",
publish / skip := true,
crossScalaVersions := Nil // https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Cross+building+a+project+statefully
name := "zio-kafka",
publish / skip := true,
crossScalaVersions := Nil, // https://www.scala-sbt.org/1.x/docs/Cross-Build.html#Cross+building+a+project+statefully,
commands += lint
)
.aggregate(
zioKafka,
Expand Down Expand Up @@ -104,6 +116,7 @@ lazy val zioKafka =
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-kafka"))
.settings(buildInfoSettings("zio.kafka"))
.settings(mimaSettings(binCompatVersionToCompare, failOnProblem = true))
.settings(enableZIO(enableStreaming = true))
.settings(
libraryDependencies ++= Seq(
Expand All @@ -126,6 +139,7 @@ lazy val zioKafkaTestkit =
.dependsOn(zioKafka)
.enablePlugins(BuildInfoPlugin)
.settings(stdSettings("zio-kafka-testkit"))
.settings(mimaSettings(binCompatVersionToCompare, failOnProblem = false))
.settings(
libraryDependencies ++= Seq(
"dev.zio" %% "zio" % zioVersion.value,
Expand Down Expand Up @@ -187,6 +201,7 @@ lazy val zioKafkaExample =

addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")
addCommandAlias("mimaCheck", "+zioKafka/mimaReportBinaryIssues;+zioKafkaTestkit/mimaReportBinaryIssues")

lazy val docs = project
.in(file("zio-kafka-docs"))
Expand All @@ -206,3 +221,9 @@ lazy val docs = project
)
.enablePlugins(WebsitePlugin)
.dependsOn(zioKafka, zioKafkaTestkit)

// Extend 'lint' with mimaCheck
lazy val lint = {
val defaultLint = zio.sbt.Commands.ComposableCommand.lint
defaultLint.copy(commandStrings = defaultLint.commandStrings :+ "mimaCheck").toCommand
}
24 changes: 24 additions & 0 deletions project/MimaSettings.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import com.typesafe.tools.mima.core.*
import com.typesafe.tools.mima.core.ProblemFilters.*
import com.typesafe.tools.mima.plugin.MimaKeys.*
import sbt.*
import sbt.Keys.{ name, organization }

object MimaSettings {

def mimaSettings(binCompatVersionToCompare: Option[String], failOnProblem: Boolean): Seq[Def.Setting[?]] =
binCompatVersionToCompare match {
case None =>
Seq(mimaPreviousArtifacts := Set.empty)
case Some(binCompatVersion) =>
Seq(
mimaPreviousArtifacts := Set(organization.value %% name.value % binCompatVersion),
mimaBinaryIssueFilters ++= Seq(
exclude[Problem]("zio.kafka.consumer.internal.*")
),
mimaFailOnProblem := failOnProblem
)

}

}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ addSbtPlugin("dev.zio" % "zio-sbt-ci" % zioSbtVersion)
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.0")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")

resolvers ++= Resolver.sonatypeOssRepos("public")
2 changes: 1 addition & 1 deletion prune-benchmark-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Benchmarks are run on every commit, even in pull requests. This causes the historic graphs on
https://zio.github.io/zio-kafka/dev/bench/ to contain so many results that it becomes unreadable. Rather than limiting
the number of items in the graph (which is supported by the github action that generates the page), we keep the
benchmark results of _all_ master commits, but only keep 1 month of pull request commits.
benchmark results of _all_ master commits, but only keep pull request commits for a limited time (currently 1 week).

The process is currently manual. Here are the instructions:

Expand Down

0 comments on commit a38185e

Please sign in to comment.