Conversation
- Replace monix-eval/monix-execution with zio 2.1.25
- Replace cats.effect.Resource with ZIO.acquireRelease + Scope
- Replace monix Atomic with java.util.concurrent.atomic.AtomicReference
- Replace Task(...) with ZIO.attempt(...)
- Replace Task.parSequenceUnordered with ZIO.collectAllParDiscard
- Replace .runSyncUnsafe() with Unsafe.unsafe { Runtime.default.unsafe.run(...) }
- Replace ScalaTest/ScalaCheck with zio-test
- Rewrite tests using ZIOSpecDefault and assertTrue
There was a problem hiding this comment.
Pull request overview
This PR migrates the ConcurrentConstantMemoryExcel implementation and its tests away from Monix + ScalaTest toward ZIO 2.x and zio-test, updating both runtime concurrency primitives and the test framework integration.
Changes:
- Replaced Monix
Task/Atomicusage with ZIOTaskandjava.util.concurrent.atomic.AtomicReference. - Reworked
writeFileresource management fromcats.effect.ResourcetoZIO.acquireRelease+Scope. - Migrated ScalaTest specs to zio-test (
ZIOSpecDefault,suite,test,assertTrue) and updated sbt test framework config.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
| core/src/main/scala/com/colisweb/jruby/concurrent/constant/memory/excel/ConcurrentConstantMemoryExcel.scala | Swaps Monix/Cats-Effect resource + atomic usage for ZIO + AtomicReference and scoped resource handling. |
| core/src/test/scala/com/colisweb/jruby/concurrent/constant/memory/excel/ConcurrentConstantMemoryExcelSpec.scala | Rewrites ScalaTest tests to zio-test structure/assertions. |
| build.sbt | Introduces ZIO dependencies and zio-test test framework wiring; removes ScalaTest/ScalaCheck libs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+159
to
+165
| ZIO.succeed { | ||
| wb.dispose() // dispose of temporary files backing this workbook on disk. Necessary because not done in the `close()`. See: https://stackoverflow.com/a/50363245 | ||
| wb.close() | ||
| } | ||
| ) | ||
| _ <- computeWorkbookData(wb) | ||
| out <- ZIO.acquireRelease(ZIO.attempt(new FileOutputStream(fileName)))(out => ZIO.succeed(out.close())) |
Comment on lines
+159
to
+165
| ZIO.succeed { | ||
| wb.dispose() // dispose of temporary files backing this workbook on disk. Necessary because not done in the `close()`. See: https://stackoverflow.com/a/50363245 | ||
| wb.close() | ||
| } | ||
| ) | ||
| _ <- computeWorkbookData(wb) | ||
| out <- ZIO.acquireRelease(ZIO.attempt(new FileOutputStream(fileName)))(out => ZIO.succeed(out.close())) |
Comment on lines
+72
to
+76
| assertTrue( | ||
| new File(fileName).exists(), | ||
| cms.get().pages.nonEmpty, | ||
| !cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically. | ||
| ) |
Comment on lines
+99
to
+103
| assertTrue( | ||
| new File(fileName).exists(), | ||
| cms.get().pages.nonEmpty, | ||
| !cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically. | ||
| ) |
Comment on lines
+118
to
+122
| assertTrue( | ||
| new File(fileName).exists(), | ||
| cms.get().pages.nonEmpty, | ||
| !cms.get().pages.forall(page => Files.exists(page.path)), // clean the tmp CSV files automatically. | ||
| ) |
guizmaii
added a commit
that referenced
this pull request
Apr 13, 2026
* Replace Monix with ZIO, ScalaTest with zio-test
- Replace monix-eval/monix-execution with zio 2.1.25
- Replace cats.effect.Resource with ZIO.acquireRelease + Scope
- Replace monix Atomic with java.util.concurrent.atomic.AtomicReference
- Replace Task(...) with ZIO.attempt(...)
- Replace Task.parSequenceUnordered with ZIO.collectAllParDiscard
- Replace .runSyncUnsafe() with Unsafe.unsafe { Runtime.default.unsafe.run(...) }
- Replace ScalaTest/ScalaCheck with zio-test
- Rewrite tests using ZIOSpecDefault and assertTrue
* Format build.sbt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
monix-eval/monix-executionwithzio2.1.25cats.effect.ResourcewithZIO.acquireRelease+Scopemonix.execution.atomic.Atomicwithjava.util.concurrent.atomic.AtomicReferencezio-testZIOSpecDefaultandassertTrueTest plan
sbt compilepassessbt test)