-
Notifications
You must be signed in to change notification settings - Fork 0
Compile using the new package of ValidatingBuilder
#257
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
Compile using the new package of ValidatingBuilder
#257
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR partially updates the Validation Compiler to use the new io.spine.validation package instead of the deprecated io.spine.validate package. The changes include version bumps for the validation library and related dependencies, along with one code update to use the new package for extracting placeholders.
- Updates validation version from 2.0.0-SNAPSHOT.383 to 2.0.0-SNAPSHOT.390
- Changes import in ErrorPlaceholders.kt to use
io.spine.validation.extractPlaceholders - Bumps several related dependency versions (Protobuf, Base, Compiler, etc.)
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| version.gradle.kts | Updates validation version to 2.0.0-SNAPSHOT.390 |
| pom.xml | Updates project version and multiple dependency versions including protobuf (4.33.1 → 4.33.2), spine-annotations/base (2.0.0-SNAPSHOT.383 → .384), and compiler-related dependencies |
| dependencies.md | Auto-generated dependency report reflecting version updates and new generation timestamp |
| context/src/main/kotlin/io/spine/tools/validation/ErrorPlaceholders.kt | Updates import from io.spine.validate.extractPlaceholders to io.spine.validation.extractPlaceholders |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt | Updates Validation library version from 2.0.0-SNAPSHOT.378 to .383 |
| buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt | Minor documentation improvement: changes "mc-java" link text to "CoreJvm Compiler" |
| buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvm.kt | Updates CoreJvm version from 2.0.0-SNAPSHOT.358 to .370 |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt | Updates Compiler fallback versions from 2.0.0-SNAPSHOT.035 to .037 |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Change.kt | Updates Change version from 2.0.0-SNAPSHOT.200 to .205 |
| buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt | Updates BaseTypes version from 2.0.0-SNAPSHOT.212 to .222 |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt | Updates Base version from 2.0.0-SNAPSHOT.383 to .384 |
| buildSrc/src/main/kotlin/io/spine/dependency/lib/Protobuf.kt | Updates Protobuf version from 4.33.1 to 4.33.2 |
| build.gradle.kts | Adds import for Validation dependency and adds Validation.javaBundle to forceVersions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private fun BuilderPsiClass.implementValidatingBuilder(message: PsiClass) { | ||
| // We use `ValidatingBuilder` at the old package to maintain backward compatibility | ||
| // for CoreJvm runtime. Once CoreJvm migrates to the new Validation Runtime, this | ||
| // line should be updated to use `io.spine.validation.ValidatingBuilder`. | ||
| @Suppress("DEPRECATION") | ||
| val qualifiedName = io.spine.validate.ValidatingBuilder::class.java.canonicalName | ||
| val qualifiedName = ValidatingBuilder::class.java.canonicalName | ||
| val genericParameter = message.qualifiedName!! | ||
| val reference = elementFactory.createInterfaceReference(qualifiedName, genericParameter) | ||
| implement(reference) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve deprecated ValidatingBuilder compatibility
The generator now makes builders implement only io.spine.validation.ValidatingBuilder. Because the deprecated io.spine.validate.ValidatingBuilder is a subtype of the new interface (not a supertype), code that still references the deprecated interface will no longer compile or pass instanceof checks after regenerating sources, even though the deprecated type still exists. If backward compatibility is still expected during the deprecation window, consider having generated builders implement the deprecated interface (or both) until it is removed.
Useful? React with 👍 / 👎.
This PR updates the Validation Compiler so that
io.spine.validation.ValidatingBuilderis used instead of the deprecated interface fromio.spine.validate.Other notable changes
nullFieldPathpassed to the generatedvalidate()method was migrated to Java to avoid awkward suppressions of warnings in the Kotlin code.