Fix zio-json release process#2806
Conversation
.github/workflows/ci.yml
Outdated
| run: echo "ONLY_LOOM=1" >> $GITHUB_ENV | ||
| run: | | ||
| echo "WITH_ZIO=1" >> $GITHUB_ENV | ||
| echo "ALSO_LOOM=1" >> $GITHUB_ENV |
There was a problem hiding this comment.
Given that target-platform and scala-version don't exist in release steps, ZIO and Loom-specific module steps are merged. We have two options here:
- using
ALSO_LOOMwhich activates all projects - using
ONLY_LOOMand leaving zioJson as loom project to restrict the amount of projects affected (also note that JVM / 3 / 21 compiles only loom projects)
@adamw Please advice.
There was a problem hiding this comment.
Alternatively, we can replace WITH_ZIO with ONLY_ZIO and ALSO_ZIO and then make sure to use ONLY_ZIO in publishing for 21 (combined with ALSO_LOOM, thus releasing 3 projects that are java 21 built, while the rest falls under 11), and using ALSO_ZIO in compilation/test, where appropriate, so that everything is properly tested under java 21.
There was a problem hiding this comment.
IMO, using ONLY_LOOM and leaving zio-json as loom project is the simplest approach. Now that I adjusted the release predictate, it should work without any problems. Let me know if I should adjust it.
| sudo apt-get update | ||
| sudo apt-get install libidn2-dev libcurl3-dev | ||
| - name: Enable Native-specific modules | ||
| if: matrix.target-platform == 'Native' |
There was a problem hiding this comment.
hm I think this should remain unchanged?
There was a problem hiding this comment.
It must be changed, that's a bug I accidentally introduced. publish job does not have a build matrix that includes the target-platform. I restored it to the state before my change.
There was a problem hiding this comment.
yeah I read far enough into the code :)
There was a problem hiding this comment.
Pull request overview
This PR fixes issues with the zio-json release process that were introduced by PR #2804, which upgraded zio-json. The main fix removes the accidentally-enabled native platform support for zio-json (which requires additional work to properly support) and adjusts the CI workflow conditions for enabling platform-specific modules during releases.
Changes:
- Removed
.nativePlatformconfiguration from zioJson module in build.sbt - Changed Native-specific modules condition from
matrix.target-platform == 'Native'tomatrix.java == '11' - Consolidated "Enable ZIO-specific modules" and "Enable Loom-specific modules" steps into a single step for Java 21
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| build.sbt | Removed nativePlatform support from zioJson module to match its actual capabilities |
| .github/workflows/ci.yml | Updated release workflow conditions to use Java version instead of non-existent target-platform matrix variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: echo "WITH_ZIO=1" >> $GITHUB_ENV | ||
| - name: Enable Loom-specific modules | ||
| if: matrix.target-platform == 'JVM' && matrix.java == '21' && matrix.scala-version == '3' | ||
| run: echo "ONLY_LOOM=1" >> $GITHUB_ENV |
There was a problem hiding this comment.
The Java 21 step needs to also set WITH_ZIO=1 environment variable. Looking at build.sbt lines 198-204, when WITH_ZIO is not defined, zioJson projects are filtered out from the aggregate. Since zioJson is part of loomProjects (line 179), setting only ONLY_LOOM=1 without WITH_ZIO=1 will result in zioJson being excluded before the loom filter is applied. This means zioJson modules won't be published during the Java 21 release job.
| run: echo "ONLY_LOOM=1" >> $GITHUB_ENV | |
| run: | | |
| echo "ONLY_LOOM=1" >> $GITHUB_ENV | |
| echo "WITH_ZIO=1" >> $GITHUB_ENV |
There was a problem hiding this comment.
@adamw Copilot's remark is in place. Please don't merge.
There was a problem hiding this comment.
Oh, you already did 😄 Then, please don't release :)
There was a problem hiding this comment.
ah sorry, I already did, with another PR. And I once again didn't catch the problem, I must pay closer attention next time. New PR?
|
Let's try :) |
@adamw Applying Copilot's correct review suggestion softwaremill#2806 (comment)
|
No harm done, I cancelled the other release and will make a new one :) |
@adamw Applying Copilot's correct review suggestion #2806 (comment) Before submitting pull request: - [x] Check if the project compiles by running `sbt compile` - [x] Verify docs compilation by running `sbt compileDocs` - [x] Check if tests pass by running `sbt test` - [x] Format code by running `sbt scalafmt`
Resolves issues introduced by #2804:
target-platformdoes not exist there 🤦♂️, see 923fbe7)Before submitting pull request:
sbt compilesbt compileDocssbt testsbt scalafmt