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

Enable MiMa for Scala 3 #4063

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
run: sbt ++${{ matrix.scala }} buildJVM bench/test

- name: Binary compatibility ${{ matrix.scala }}
if: matrix.platform == 'jvm' && (matrix.scala != '3.0.2')
if: matrix.platform == 'jvm'
run: sbt ++${{ matrix.scala }} clean validateBC

scalafix:
Expand Down
11 changes: 7 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ ThisBuild / githubWorkflowBuild := Seq(
WorkflowStep.Sbt(
List("clean", "validateBC"), // cleaning here to avoid issues with codecov
name = Some("Binary compatibility ${{ matrix.scala }}"),
cond = Some(JvmCond + " && " + Scala2Cond)
cond = Some(JvmCond)
)
)

Expand Down Expand Up @@ -339,7 +339,7 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1
Version(ver) match {
case Some(Version(major, Seq(minor, patch), _)) =>
semverBinCompatVersions(major, minor, patch)
.map { case (maj, min, pat) => s"$maj.$min.$pat" }
.collect { case (maj, min, pat) if !scalaVer.startsWith("3.") || (maj >= 2 && min >= 7) => s"$maj.$min.$pat" }
case _ =>
List.empty[String]
}
Expand All @@ -348,9 +348,12 @@ def mimaPrevious(moduleName: String, scalaVer: String, ver: String, includeCats1
lazy val excludedVersions: List[String] = List()

// Safety Net for Inclusions
lazy val extraVersions: List[String] = List("1.0.1", "1.1.0", "1.2.0", "1.3.1", "1.4.0", "1.5.0", "1.6.1")
lazy val extraCats1Versions: List[String] = List("1.0.1", "1.1.0", "1.2.0", "1.3.1", "1.4.0", "1.5.0", "1.6.1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw checking so old versions doesn't cover new definitions (added since).
IMO we should check against the latest previous version.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are, these are just extras :) in sbt try show coreJVM/mimaPreviousArtifacts to see the list.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok I see 👍 - why do we add the extras? To be extra sure?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/shrug :)


(mimaVersions ++ (if (priorTo2_13(scalaVer) && includeCats1) extraVersions else Nil))
// Safety Net, starting with Scala 3 introduction in 2.6.1
lazy val extraVersions: List[String] = List("2.6.1")

(mimaVersions ++ extraVersions ++ (if (priorTo2_13(scalaVer) && includeCats1) extraCats1Versions else Nil))
.filterNot(excludedVersions.contains(_))
.map(v => "org.typelevel" %% moduleName % v)
}
Expand Down