Skip to content

Implement lazy message conversion for protovalidate#402

Draft
andrewparmet wants to merge 9 commits intoopen-toast:mainfrom
andrewparmet:protovalidate-lazy
Draft

Implement lazy message conversion for protovalidate#402
andrewparmet wants to merge 9 commits intoopen-toast:mainfrom
andrewparmet:protovalidate-lazy

Conversation

@andrewparmet
Copy link
Copy Markdown
Collaborator

Run conformance tests using the existing eager implementation with:

./gradlew testing:protovalidate-conformance:conformance -PlazyBufImpl=false

and the new lazy implementation with:

./gradlew testing:protovalidate-conformance:conformance -PlazyBufImpl=true

…tovalidate

- Replace PackageHacks.kt / ProtoktEvaluator / ProtoktEvaluatorBuilder with
  direct use of protovalidate-java's new public validate(MessageReflector,
  Descriptor) entrypoint.
- ProtoktMessageReflector implements MessageReflector; ProtoktObjectValue
  implements Value. Both live in the public protokt.v1.buf.validate package.
- Validator.validate(message) looks up the descriptor by @GeneratedMessage's
  fullTypeName.
- Make RuntimeContext incremental: descriptor registry is a PersistentMap
  and a new operator plus(descriptor) returns a copy with the descriptor
  registered. Avoids O(N²) rebuild when loading descriptors one at a time.
- protokt-reflect now depends on kotlinx-collections-immutable.
- Wire mavenLocal into the Java project convention so the protovalidate-java
  SNAPSHOT resolves during local development.
# Conflicts:
#	gradle/libs.versions.toml
#	protokt-protovalidate/src/main/kotlin/build/buf/protovalidate/PackageHacks.kt
#	protokt-protovalidate/src/main/kotlin/protokt/v1/buf/validate/Validator.kt
#	testing/protovalidate-conformance/build.gradle.kts
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.

1 participant