Skip to content

Conversation

@armanbilge
Copy link
Member

@armanbilge armanbilge commented May 31, 2022

This executes the versioning strategy described in #460 (comment).

I'm leaning towards continuing to use the year.month.patch scheme in this repo, in part to keep things inline with Finagle, and in part because I'm not sure what version we'd start with if we switched over to another scheme, like early-semver. (e.g. if we switched to 1.0.0, then Scala Steward is going to consider 21.8.0 to be the newest version for a long time.)

If we continue to use year.month.patch, then I would consider year.month to be the major version, meaning we should feel free to break bincompat with each monthly release, but we maintain bincompat within a month if we make subsequent releases.

Edit: this part below is a bit trickier :)

If we can make it happen, I'd like to take it a step further and only introduce a break in a given month if Finagle or Twitter Utils also introduces a break, but I don't know if that's strictly necessary.

Comment on lines +5 to +6
ThisBuild / tlVersionIntroduced := // test bincompat starting from the beginning of this series
List("2.12", "2.13").map(_ -> s"${tlBaseVersion.value}.0").toMap
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a mild abuse of the tlVersionIntroduced setting, which is used to indicate in which version artifacts first existed.

Since we only want to check bincompat with in a year.month.x series (and not year.x.y series) all we have to do is pretend the artifacts were only introduced in version year.month.0 :)

Copy link
Member Author

@armanbilge armanbilge May 31, 2022

Choose a reason for hiding this comment

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

Oh wait, this won't work long-term, because sbt-typelevel won't look further back than the major version bump. Totally my bad, sorry. Wait, nope, that's fine, because we don't need it to.

Comment on lines +19 to +26
// Finagle releases monthly using a {year}.{month}.{patch} version scheme.
// The combination of year and month is effectively a major version, because
// each monthly release often contains binary-incompatible changes.
// This means we should release at least monthly as well, when Finagle does,
// but in between those monthly releases, maintain binary compatibility.
// This is effectively PVP style versioning.
// We set this at the project-level instead of ThisBuild to circumvent sbt-typelevel checks.
versionScheme := Some("pvp"),
Copy link
Member Author

Choose a reason for hiding this comment

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

This takes advantage of a loophole in sbt-typelevel that the versioning strategy is apparently only enforced at the ThisBuild level (although I might fix that 😅). So we can sneak it in as a project setting for now.

Btw, your custom strategy was not accepted by sbt when I moved the setting here.

java.lang.RuntimeException: unknown version scheme: year-month-patch
        at scala.sys.package$.error(package.scala:30)
        at sbt.internal.librarymanagement.VersionSchemes$.validateScheme(VersionSchemes.scala:36)
...

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I wondered if there was a list of schemes somewhere. This works for me.

@@ -1,15 +1,9 @@
val catsVersion = "2.7.0"
val finagleVersion = "21.8.0"
val finagleVersion = "22.4.0"
Copy link
Member Author

@armanbilge armanbilge May 31, 2022

Choose a reason for hiding this comment

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

I merged in #454 because MiMa needed a version bump anyway. (It was having a hard time finding 21.8.0 artifacts to compare against.)

@armanbilge
Copy link
Member Author

Ok, despite briefly confusing myself, I think this should do the trick!

@bpholt bpholt merged commit 380e14a into typelevel:main May 31, 2022
This was referenced May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants