pjfanning commented on code in PR #523:
URL: 
https://github.com/apache/pekko-persistence-r2dbc/pull/523#discussion_r4370729816


##########
project/CommonSettings.scala:
##########
@@ -21,8 +21,10 @@ object CommonSettings extends AutoPlugin {
   override def requires = JvmPlugin && ApacheSonatypePlugin && DynVerPlugin
 
   override lazy val projectSettings = Seq(
-    crossScalaVersions := Seq(Dependencies.Scala213, Dependencies.Scala3, 
Dependencies.Scala3Next),
+    crossScalaVersions := Seq(Dependencies.Scala213, Dependencies.Scala3) ++ 
Dependencies.Scala3TestOnly,

Review Comment:
   Putting the test-only Scala 3 versions in `crossScalaVersions` means every 
`+` command iterates over them, not just the test matrix. 
`binary-compatibility-checks.yml` runs `sbt +compile` and `sbt 
+mimaReportBinaryIssues`, and the release/nightly workflows run 
`+publishSigned` / `+publish`. This was already true for `Scala3Next` before 
this PR, but it now adds another version to each of those. If a Scala Next 
release breaks compilation, the required `Check / Binary Compatibility` job 
goes red even though no published artifact is affected.



##########
project/CommonSettings.scala:
##########
@@ -21,8 +21,10 @@ object CommonSettings extends AutoPlugin {
   override def requires = JvmPlugin && ApacheSonatypePlugin && DynVerPlugin
 
   override lazy val projectSettings = Seq(
-    crossScalaVersions := Seq(Dependencies.Scala213, Dependencies.Scala3, 
Dependencies.Scala3Next),
+    crossScalaVersions := Seq(Dependencies.Scala213, Dependencies.Scala3) ++ 
Dependencies.Scala3TestOnly,
     scalaVersion := Dependencies.Scala213,
+    // all Scala 3 versions share the _3 suffix, so only the Scala3 build may 
be published
+    publish / skip := (publish / skip).value || 
Dependencies.Scala3TestOnly.contains(scalaVersion.value),

Review Comment:
   This `publish / skip` override (and the `Scala3TestOnly` special case for 
`mimaPreviousArtifacts` in build.sbt) only exists to undo the effect of listing 
test-only versions in `crossScalaVersions`. Alternative: keep 
`crossScalaVersions` to the published versions (2.13, 3.3) and have the CI 
matrix run `sbt "++3.10.0!" test`; the `!` forces a version that is not in the 
list. Then the publish-skip, the MiMa exclusion and the extra cross-build cost 
in the release and binary-compat workflows all go away, and future 
modules/publishing paths don't need to remember to honour `Scala3TestOnly`.



##########
.github/workflows/build-test.yml:
##########
@@ -8,12 +8,34 @@ on:
     tags-ignore: [ v.* ]
 
 jobs:
+  scala-versions:
+    name: Read Scala versions
+    runs-on: ubuntu-latest
+    outputs:
+      versions: ${{ steps.versions.outputs.versions }}
+    steps:
+      - name: Checkout
+        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+
+      # every `val Scala... = "x.y.z"` in Dependencies.scala becomes a matrix 
entry
+      - name: Read Scala versions from project/Dependencies.scala
+        id: versions
+        run: |-
+          versions=$(sed -n 's/^ *val Scala[0-9A-Za-z]* = "\([^"]*\)".*/\1/p' 
project/Dependencies.scala | jq -R . | jq -cs .)

Review Comment:
   This picks up every `val Scala... = "x.y.z"` line in Dependencies.scala. If 
someone later adds e.g. `val ScalaTestVersion = "3.2.20"` or `val 
ScalaCollectionCompatVersion = ...`, every job gets a matrix entry running `sbt 
++3.2.20 test` and CI fails with no obvious link to the naming convention. A 
static version list in the workflow avoids that and also removes the extra 
`scala-versions` job that all matrix jobs now wait on (it also runs on forks, 
where the DB jobs it gates are skipped).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to