Skip to content

Conversation

@alexander-yevsyukov
Copy link
Collaborator

@alexander-yevsyukov alexander-yevsyukov commented Dec 24, 2025

This PR updates the Validation Compiler so that io.spine.validation.ValidatingBuilder is used instead of the deprecated interface from io.spine.validate.

Other notable changes

  • The test for handling null FieldPath passed to the generated validate() method was migrated to Java to avoid awkward suppressions of warnings in the Kotlin code.
  • Local dependencies and Protobuf were bumped.

Copilot AI review requested due to automatic review settings December 24, 2025 15:20
@alexander-yevsyukov alexander-yevsyukov self-assigned this Dec 24, 2025
Copy link
Contributor

Copilot AI left a 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.

Copilot AI review requested due to automatic review settings December 24, 2025 15:42
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review December 24, 2025 15:45
Copy link
Contributor

Copilot AI left a 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.

@alexander-yevsyukov alexander-yevsyukov merged commit d00504c into master Dec 24, 2025
11 of 12 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the new-package-for-validating-builder branch December 24, 2025 15:50
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines 191 to 195
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)

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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