Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ZIO 2.x #149

Merged
merged 21 commits into from
Jan 10, 2022
Merged

Support ZIO 2.x #149

merged 21 commits into from
Jan 10, 2022

Conversation

alexvanolst
Copy link
Contributor

@alexvanolst alexvanolst commented Nov 10, 2021

Here's a first attempt at upgrading to ZIO 2.x

So far I've gotten the main module, optics and protobuf modules to compile (with tests passing)

The zio-schema-json subproject is probably blocked until there is a release with zio/zio-json#463

And whilst they seem to not have introduced any issues are picking up still need to wait so we can update the dependencies for:

zio/zio-optics#77

I'll try keep this up to date with main until things can progress here.

@thinkharderdev
Copy link
Contributor

Here's a first attempt at upgrading to ZIO 2.x

So far I've gotten the main module, optics and protobuf modules to compile (with tests passing)

The zio-schema-json subproject is probably blocked until there is a release with zio/zio-json#463

And whilst they seem to not have introduced any issues are picking up still need to wait so we can update the dependencies for:

zio/zio-nio#422 zio/zio-optics#77

I'll try keep this up to date with main until things can progress here.

I'm not sure we need to zio-nio dependency at all.

# Conflicts:
#	zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala
#	zio-schema-protobuf/shared/src/test/scala/zio/schema/codec/ProtobufCodecSpec.scala
@alexvanolst alexvanolst mentioned this pull request Nov 23, 2021
# Conflicts:
#	project/BuildHelper.scala
#	tests/shared/src/test/scala/zio/schema/DiffSpec.scala
#	tests/shared/src/test/scala/zio/schema/SchemaMigrationSpec.scala
#	tests/shared/src/test/scala/zio/schema/StandardTypeGen.scala
#	zio-schema-json/shared/src/test/scala/zio/schema/codec/JsonCodecSpec.scala
#	zio-schema-protobuf/shared/src/test/scala/zio/schema/codec/ProtobufCodecSpec.scala
# Conflicts:
#	zio-schema-protobuf/shared/src/test/scala/zio/schema/codec/ProtobufCodecSpec.scala
@alexvanolst
Copy link
Contributor Author

This is now fully updated to RC-1. Working fine locally with a snapshot build of zio-json. As soon as there is a zio-json release will get CI green.

renovate bot and others added 4 commits December 18, 2021 19:00
Co-authored-by: Renovate Bot <bot@renovateapp.com>
* Capture annotations on Enums and all cases

* Linting
Co-authored-by: Renovate Bot <bot@renovateapp.com>
@adamgfraser
Copy link
Contributor

@alexvanolst zio-json is available now.

@alexvanolst alexvanolst marked this pull request as ready for review December 22, 2021 03:57
@alexvanolst alexvanolst requested a review from a team as a code owner December 22, 2021 03:57
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

Looks great! Most substantive thing is updating the ZIO Prelude and ZIO Optics dependencies. Other than that just minor cleanup comments.

adamgfraser
adamgfraser previously approved these changes Dec 23, 2021
Copy link
Contributor

@adamgfraser adamgfraser left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@thinkharderdev Do you want to give it a final review and do a release or you good?

@adamgfraser
Copy link
Contributor

Well other than formatting.

@alexvanolst
Copy link
Contributor Author

alexvanolst commented Dec 23, 2021

@adamgfraser Would you be able to change the target of this to it's own zio2 branch? I'm assuming we don't want this merged on top of main

@adamgfraser adamgfraser changed the base branch from main to zio2 December 23, 2021 09:20
@adamgfraser
Copy link
Contributor

@alexvanolst Changed now.

@alexvanolst
Copy link
Contributor Author

@thinkharderdev @adamgfraser Is anything else needed from me here?

@adamgfraser adamgfraser merged commit 4a5c9e7 into zio:zio2 Jan 10, 2022
jdegoes added a commit that referenced this pull request Aug 19, 2022
* Support ZIO 2.x (#149)

* Run scalafix ZIO 2 migration

* Get core project compiling

* Get Optics to compile and pass tests

* Get protobuf to compile and pass tests

* Run `sbt prepare`

* Remove unused reference to zio-nio in BuildHelper.scala

* Update to ZIO 2.0.0-RC1

* Update zio-schema-json and examples to ZIO 2

* Update dependency ch.epfl.scala:sbt-scalafix to v0.9.33 (#98)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Capture annotations on Enums and all cases (#167)

* Capture annotations on Enums and all cases

* Linting

* Update dependency com.github.ghik:silencer-lib to v1.7.7 (#123)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Upgrade zio-json to 0.3.0-RC1-1

* Update zio-prelude and zio-optics versions to ZIO-2 releases and address Adam's PR feedback

* Last bit of PR cleanup

* Fix linter error

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>

* Update ZIO2 branch to latest main (#216)

* Update dependency ch.epfl.scala:sbt-scalafix to v0.9.33 (#98)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Capture annotations on Enums and all cases (#167)

* Capture annotations on Enums and all cases

* Linting

* Update dependency com.github.ghik:silencer-lib to v1.7.7 (#123)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-scalafmt to v2.4.5 (#154)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Add schema for DynamicValue (#170)

* Add Schema for DynamicValue

* Rename some of StandardType values

* Fix type casting

* Fix linting issues

Run `prepare` on the whole project

* Support native schema for Set #139 (#173)

* Support native schema for Set

* added Diff support for SetSchema

* removed dead code

* attempt to fix scala 2.13 match may not be exhaustive compile error

* added SetSchema support

* updated docs to mention zio-dynamoDB as a client

* More property based tests for map and set (#178)

* added more property based tests for Map

* added more property based tests for Set

* Diff refactor (#176)

* Diff refactor

Refactor diff. There are two main goals:

1. Add type parameter to `Dff`. This solves an otherwise very nasty issue in the Scala 3 support.

2. Use Least Common Subsequence (LCS aka Myers Diff) for all sequence diffs. This simplifies things a lot of unifies all collection diffs under a single, principled algorithm.

* Linter fixes

* Fix 2.12 build issue

* Move LCSDiff to Differ companion object

* Make LCSDiff package private

* Linting

Co-authored-by: John A. De Goes <john@degoes.net>

* Update dependency org.scala-native:sbt-scala-native to v0.4.3 (#180)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-mdoc to v2.3.0 (#181)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Thrift (#163)

* thrift

* all tests passing

* uncommented benchmarks

* sets

* removed not implemented methods

* map

* fixes

* formatting

* small fixes

* fixes

* fixes

* failure decoding

* path as first param

* Fix compile errors for Scala 2.12

* code review

* thrift optionals

* scalafmt + compilation warnings

* removed JavaConverters

* removed JavaConverters

* scalafmt

* scalafix

* scalafix test

Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>

* Fix bug in enum schema derivation (#191)

* Unify schema of Either/Left/Right (#204)

* Update dependency org.xerial.sbt:sbt-sonatype to v3.9.12 (#186)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scala-js:sbt-scalajs to v1.9.0 (#190)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency com.eed3si9n:sbt-buildinfo to v0.11.0 (#199)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Equality implementation for Schema (#206)

* Equality implementation for Schema

* Import order fix

* Improve equality of Sequence

* Fix equality, recursion, migration

* Fix warning

* Run fix

* Manually fix scalafix result

* preserve annotations when calling toRecord on a Tuple: fixes #212 (#213)

* preserve annotations when calling toRecord on a Tuple: fixes #212

* apply scalafixAll

* Format

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>
Co-authored-by: Ivan Grebenik <1790371+igrebenik@users.noreply.github.com>
Co-authored-by: Avinder Bahra <abahra@equalexperts.com>
Co-authored-by: Avinder Bahra <avinder.bahra@gmail.com>
Co-authored-by: John A. De Goes <john@degoes.net>
Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Tobias Pfeifer <TobiasPfeifer@users.noreply.github.com>

* ZIO2 latest update from main (#222)

* Update dependency ch.epfl.scala:sbt-scalafix to v0.9.33 (#98)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Capture annotations on Enums and all cases (#167)

* Capture annotations on Enums and all cases

* Linting

* Update dependency com.github.ghik:silencer-lib to v1.7.7 (#123)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-scalafmt to v2.4.5 (#154)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Add schema for DynamicValue (#170)

* Add Schema for DynamicValue

* Rename some of StandardType values

* Fix type casting

* Fix linting issues

Run `prepare` on the whole project

* Support native schema for Set #139 (#173)

* Support native schema for Set

* added Diff support for SetSchema

* removed dead code

* attempt to fix scala 2.13 match may not be exhaustive compile error

* added SetSchema support

* updated docs to mention zio-dynamoDB as a client

* More property based tests for map and set (#178)

* added more property based tests for Map

* added more property based tests for Set

* Diff refactor (#176)

* Diff refactor

Refactor diff. There are two main goals:

1. Add type parameter to `Dff`. This solves an otherwise very nasty issue in the Scala 3 support.

2. Use Least Common Subsequence (LCS aka Myers Diff) for all sequence diffs. This simplifies things a lot of unifies all collection diffs under a single, principled algorithm.

* Linter fixes

* Fix 2.12 build issue

* Move LCSDiff to Differ companion object

* Make LCSDiff package private

* Linting

Co-authored-by: John A. De Goes <john@degoes.net>

* Update dependency org.scala-native:sbt-scala-native to v0.4.3 (#180)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-mdoc to v2.3.0 (#181)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Thrift (#163)

* thrift

* all tests passing

* uncommented benchmarks

* sets

* removed not implemented methods

* map

* fixes

* formatting

* small fixes

* fixes

* fixes

* failure decoding

* path as first param

* Fix compile errors for Scala 2.12

* code review

* thrift optionals

* scalafmt + compilation warnings

* removed JavaConverters

* removed JavaConverters

* scalafmt

* scalafix

* scalafix test

Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>

* Fix bug in enum schema derivation (#191)

* Unify schema of Either/Left/Right (#204)

* Update dependency org.xerial.sbt:sbt-sonatype to v3.9.12 (#186)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scala-js:sbt-scalajs to v1.9.0 (#190)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency com.eed3si9n:sbt-buildinfo to v0.11.0 (#199)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Equality implementation for Schema (#206)

* Equality implementation for Schema

* Import order fix

* Improve equality of Sequence

* Fix equality, recursion, migration

* Fix warning

* Run fix

* Manually fix scalafix result

* preserve annotations when calling toRecord on a Tuple: fixes #212 (#213)

* preserve annotations when calling toRecord on a Tuple: fixes #212

* apply scalafixAll

* Add special encoding for List and Map types in SchemaAst (#220)

* Add special encoding for List and Map types in SchemaAst

* revert build config chnage

* preserve optional flag

* Fix

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>
Co-authored-by: Ivan Grebenik <1790371+igrebenik@users.noreply.github.com>
Co-authored-by: Avinder Bahra <abahra@equalexperts.com>
Co-authored-by: Avinder Bahra <avinder.bahra@gmail.com>
Co-authored-by: John A. De Goes <john@degoes.net>
Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Tobias Pfeifer <TobiasPfeifer@users.noreply.github.com>

* Dynamic and SemiDynamic schemas ZIO 2 version (#219)

* Update dependency ch.epfl.scala:sbt-scalafix to v0.9.33 (#98)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Capture annotations on Enums and all cases (#167)

* Capture annotations on Enums and all cases

* Linting

* Update dependency com.github.ghik:silencer-lib to v1.7.7 (#123)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-scalafmt to v2.4.5 (#154)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Add schema for DynamicValue (#170)

* Add Schema for DynamicValue

* Rename some of StandardType values

* Fix type casting

* Fix linting issues

Run `prepare` on the whole project

* Support native schema for Set #139 (#173)

* Support native schema for Set

* added Diff support for SetSchema

* removed dead code

* attempt to fix scala 2.13 match may not be exhaustive compile error

* added SetSchema support

* updated docs to mention zio-dynamoDB as a client

* More property based tests for map and set (#178)

* added more property based tests for Map

* added more property based tests for Set

* Diff refactor (#176)

* Diff refactor

Refactor diff. There are two main goals:

1. Add type parameter to `Dff`. This solves an otherwise very nasty issue in the Scala 3 support.

2. Use Least Common Subsequence (LCS aka Myers Diff) for all sequence diffs. This simplifies things a lot of unifies all collection diffs under a single, principled algorithm.

* Linter fixes

* Fix 2.12 build issue

* Move LCSDiff to Differ companion object

* Make LCSDiff package private

* Linting

Co-authored-by: John A. De Goes <john@degoes.net>

* Update dependency org.scala-native:sbt-scala-native to v0.4.3 (#180)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scalameta:sbt-mdoc to v2.3.0 (#181)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Thrift (#163)

* thrift

* all tests passing

* uncommented benchmarks

* sets

* removed not implemented methods

* map

* fixes

* formatting

* small fixes

* fixes

* fixes

* failure decoding

* path as first param

* Fix compile errors for Scala 2.12

* code review

* thrift optionals

* scalafmt + compilation warnings

* removed JavaConverters

* removed JavaConverters

* scalafmt

* scalafix

* scalafix test

Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>

* Fix bug in enum schema derivation (#191)

* Dynamic and SemiDynamic schemas

* Unify schema of Either/Left/Right (#204)

* DeriveGen

* JsonCodec

* Fix semiDynamicEncoder

* Fixes

* Update dependency org.xerial.sbt:sbt-sonatype to v3.9.12 (#186)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency org.scala-js:sbt-scalajs to v1.9.0 (#190)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency com.eed3si9n:sbt-buildinfo to v0.11.0 (#199)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Equality implementation for Schema (#206)

* Equality implementation for Schema

* Import order fix

* Improve equality of Sequence

* Fix equality, recursion, migration

* Fix warning

* Run fix

* Manually fix scalafix result

* Json codec works

* BigInt, BigDecimal support for protobuf

* Fix protobuf semi dynamic record test

* Various thrift codec fixes

* SemiDynamic support for thrift

* Fix some warnings

* Fix more warnings

* Fix compilation on 2.12

* scalafix

* format

* preserve annotations when calling toRecord on a Tuple: fixes #212 (#213)

* preserve annotations when calling toRecord on a Tuple: fixes #212

* apply scalafixAll

* Reproducer for schema ast materialization problem

* Format

* Finish todo items

* Fix bug in AST (#223)

* Fix bug in AST

* Remove unused import

* Unused import

* deprecate testM abd checM

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>
Co-authored-by: Ivan Grebenik <1790371+igrebenik@users.noreply.github.com>
Co-authored-by: Avinder Bahra <abahra@equalexperts.com>
Co-authored-by: Avinder Bahra <avinder.bahra@gmail.com>
Co-authored-by: John A. De Goes <john@degoes.net>
Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Tobias Pfeifer <TobiasPfeifer@users.noreply.github.com>

* Remove DynamicValue.Transform (#227)

* Support for ZIO2-RC3 (#230)

* Upgrade to ZIO2 RC2

* Update to ZIO2 RC3

* Upgrade zio-json snapshot version for ZIO2-RC3

* Fix string encoding compilation error

* Try to get timeouts sorted

* Upgrade To ZIO 2.0.0-RC4 (#234)

* upgrade zio version

* remove unused import

* ZIO 2.0.0-RC5 (#238)

* Upgrade to ZIO 2.0.0-RC6 (#245)

* Upgrade to ZIO 2.0.0-RC6

* Convert error to string

* Fix schema derivation test

* Migrate test

* Switch to ZPipeline.utf8Decode

* Fix JSON decode

* fix and format

Co-authored-by: Daniel Vigovszky <daniel.vigovszky@gmail.com>

* Fix protobuf semidynamic encoding/decoding (#266)

* Remove Left/Right/None/Nil implicit schemas (#279)

* Fix for DynamicValue.Record field order mixed up by serialization  (#284)

* Reproducer for Dynamic Record field order issue

* Fix

* Update to ZIO 2.0.0 final (#290)

* feature: add `toTypedPrimitive` operator to `StandardType` (#300)

* feature: add `toTypedPrimitive` operator to StandardType

* chore: update style

* Fix

* Fixes

* Settings fix

* Fix build helper

* Scala 3 fixes

* Thrift codec Scala3 fixes

* Scala3 fix

* More Scala3 fix

* Copied memory settings from zio/zio

* Trying other memory settings

* More fixes

* Force rebuild

* Make AvroCodec Scala 2.12 compatible

* ScalaFix

* ZIO 2.0.1

* Disable parallel execution on CI

* Do not fork tests

Co-authored-by: Alexander van Olst <alexvanolst@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Dan Harris <1327726+thinkharderdev@users.noreply.github.com>
Co-authored-by: Ivan Grebenik <1790371+igrebenik@users.noreply.github.com>
Co-authored-by: Avinder Bahra <abahra@equalexperts.com>
Co-authored-by: Avinder Bahra <avinder.bahra@gmail.com>
Co-authored-by: John A. De Goes <john@degoes.net>
Co-authored-by: František Kocun <frantisek.kocun@gmail.com>
Co-authored-by: Dan Harris <dan@thinkharder.dev>
Co-authored-by: Tobias Pfeifer <TobiasPfeifer@users.noreply.github.com>
Co-authored-by: Adam Fraser <adam.fraser@gmail.com>
Co-authored-by: Denis <denisgarci@users.noreply.github.com>
Co-authored-by: Albert Pető <petoalbert32@gmail.com>
Co-authored-by: Tushar Mathur <tusharmath@gmail.com>
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