scala-steward icon indicating copy to clipboard operation
scala-steward copied to clipboard

Group artifacts that need to be upgraded together

Open ekrich opened this issue 3 years ago • 3 comments

A classic case of this is scalafix and the exact Scala version that matches.

For example, an update like scalafix cannot occur without Scala 2.13.8 which is not formally released yet - https://github.com/ekrich/sconfig/pull/228

I don't know if this is possible but it would really help at least in this case.

ekrich avatar Jan 11 '22 22:01 ekrich

Maybe updates.ignore in default Scala Steward can care this. https://github.com/scala-steward-org/scala-steward/blob/19909281fa163dd689ed2597dafd26302c279269/modules/core/src/main/resources/default.scala-steward.conf#L1-L3

It does not upgrade dependencies together, but can wait until related dependency release. So, something like this:

  // Ignore the next sbt-scalafix version until next Scala 2.13 version is announced.
  { groupId = "ch.epfl.scala", artifactId = "sbt-scalafix", version = { exact = "0.9.35" } },

It would be helpful if updating this entry is added in sbt-scalafix release workflow.

exoego avatar Feb 09 '22 03:02 exoego

For example, an update like scalafix cannot occur without Scala 2.13.8 which is not formally released yet - https://github.com/ekrich/sconfig/pull/228

For most of the sbt-scalafix usages (using rules, not defining them), upon a new Scala release, sbt-scalafix should be bumped before Scala, so that semanticdb support for the upcoming release is ready. The new Scala 2.x release process fixes that since sbt-scalafix PRs are opened ahead of the Scala PRs (provided a new release of sbt-scalafix is tagged fast enough) because of the Scala embargo in updates.ignore.

In your case, the bump of sbt-scalafix and scala must be done atomically because you define rules in the project (the missing full cross-build artifact missing is scalafix-testkit). So I am not sure adding sbt-scalafix to updates.ignore would help.

In both cases, for Scala 3.x, there is no problem as the support for generating semanticdb files is baked-in in the compiler.

bjaglin avatar Feb 09 '22 14:02 bjaglin

If the Scala versions used in the scalafix modules of your build were coming from sbt-scalafix, there wouldn't be a problem since the sbt-scalafix bump could be merged independently of the Scala bump for the rest of the modules.

I guess it won't be easy as-is as the build uses the built-in crossScalaVersions. I see 2 options

  1. Moving to sbt-projectmatrix like https://github.com/scalacenter/scalafix.g8/blob/4518a742d1e4bdcf4426075a58444e031f6e845d/src/main/g8/scalafix/build.sbt would make it possible.
  2. I am not sure that's what you want either but using sbt-scalafix to drive your main Scala versions would do the trick.

bjaglin avatar Feb 09 '22 15:02 bjaglin