Skip to content

Eliminate duplicated error placeholders#300

Merged
alexander-yevsyukov merged 18 commits into
masterfrom
eliminate-duplicated-error-placeholders
May 14, 2026
Merged

Eliminate duplicated error placeholders#300
alexander-yevsyukov merged 18 commits into
masterfrom
eliminate-duplicated-error-placeholders

Conversation

@alexander-yevsyukov
Copy link
Copy Markdown
Collaborator

@alexander-yevsyukov alexander-yevsyukov commented May 13, 2026

This PR addresses #294 by moving the ErrorPlaceholder type into the jvm-runtime module.

We need this enumeration in JVM validation runtime because message validators (e.g. io.spine.time.validation.LocalDateValidator) may need the placeholders for their work.

The RuntimeErrorPlaceholder was transformed into the deprecated type alias for backward compatibility.

Other notable changes

  • Documentation was updated to remove the mentioning of the duplication of error placeholders.
  • config was updated.

Copilot AI review requested due to automatic review settings May 13, 2026 19:07
@alexander-yevsyukov alexander-yevsyukov self-assigned this May 13, 2026
Copy link
Copy Markdown
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 addresses issue #294 by consolidating placeholder definitions: it removes the duplicated RuntimeErrorPlaceholder enum and moves/standardizes placeholder usage around a single ErrorPlaceholder in the JVM runtime, updating compiler/context, generators, tests, and documentation accordingly. It also includes additional build/tooling updates (dependency report output relocation, Gradle wrapper bump, agent docs/skills updates, and version bump).

Changes:

  • Moved/renamed ErrorPlaceholder into :jvm-runtime (io.spine.validation) and removed the duplicated RuntimeErrorPlaceholder enum (replaced with a deprecated alias).
  • Updated compiler/context and Java generators to use the new io.spine.validation.ErrorPlaceholder.
  • Updated docs and dependency-report generation paths; bumped project version and Gradle wrapper.

Reviewed changes

Copilot reviewed 50 out of 52 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
version.gradle.kts Bumps Validation snapshot version.
tests/validating/src/test/kotlin/io/spine/test/options/setonce/SetOnceViolationITest.kt Updates placeholder key usage in (set_once) integration test.
tests/validating/src/test/kotlin/io/spine/test/options/goes/GoesViolationITest.kt Switches test imports from RuntimeErrorPlaceholder to ErrorPlaceholder.
jvm-runtime/src/main/kotlin/io/spine/validation/TimestampValidator.kt Updates imports to use ErrorPlaceholder.
jvm-runtime/src/main/kotlin/io/spine/validation/TemplateStringExts.kt Updates imports to use ErrorPlaceholder.
jvm-runtime/src/main/kotlin/io/spine/validation/RuntimeErrorPlaceholder.kt Removes duplicated enum.
jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt Moves/renames placeholder enum into runtime package and introduces deprecated alias.
java/src/main/kotlin/io/spine/tools/validation/java/setonce/SetOnceConstraintViolation.kt Updates placeholder imports to io.spine.validation.ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/RequireOptionGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/RequiredGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/PatternGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/GoesGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/DistinctGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/ChoiceGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/bound/RangeGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/bound/MinGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/bound/MaxGenerator.kt Updates placeholder imports to runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/generate/option/bound/BoundedFieldGenerator.kt Adjusts imports to use runtime ErrorPlaceholder.
java/src/main/kotlin/io/spine/tools/validation/java/expression/TemplateStrings.kt Points placeholder enum import to io.spine.validation.ErrorPlaceholder.
gradle/wrapper/gradle-wrapper.properties Bumps Gradle wrapper distribution URL.
docs/dependencies/pom.xml Adds generated dependency POM under docs/dependencies.
docs/content/docs/validation/user/04-validators/implement-a-validator.md Updates validator docs placeholder usage.
docs/content/docs/validation/developer/validation-model.md Updates docs about placeholder enumeration/duplication.
docs/content/docs/validation/developer/runtime-library.md Updates runtime library docs to remove RuntimeErrorPlaceholder mention.
docs/content/docs/validation/developer/adding-a-built-in-option.md Updates contributor docs about placeholders/runtime needs.
context/src/main/kotlin/io/spine/tools/validation/option/SetOnceOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/RequireOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/required/RequiredOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/PatternOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/GoesOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/DistinctOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/option/ChoiceOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/ErrorPlaceholders.kt Imports runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/bound/RangeOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/bound/MinOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/src/main/kotlin/io/spine/tools/validation/bound/MaxOption.kt Updates placeholder imports to runtime ErrorPlaceholder.
context/build.gradle.kts Adds dependency on :jvm-runtime for placeholder enum.
CLAUDE.md Updates internal agent-doc path reference.
buildSrc/src/test/kotlin/io/spine/gradle/report/license/DependencyReportOutputTest.kt Adds tests for new dependency report output locations.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt Writes generated POM under docs/dependencies.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt Centralizes output directory and adds outputFile() helper.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt Writes merged license report under docs/dependencies.
buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt Adjusts Core-JVM compiler/plugin version for tests.
.gitignore Removes ignore rule for .claude/worktrees.
.github/workflows/ensure-reports-updated.yml Renames workflow step label for dependency report checks.
.agents/version-policy.md Updates version policy docs to reference a skill doc.
.agents/skills/bump-version/SKILL.md Adds “bump-version” skill documentation.
.agents/skills/bump-version/agents/openai.yaml Adds agent interface metadata for bump-version.
.agents/skills/bump-gradle/SKILL.md Adds “bump-gradle” skill documentation.
.agents/skills/bump-gradle/agents/openai.yaml Adds agent interface metadata for bump-gradle.
Comments suppressed due to low confidence (1)

jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt:74

  • Replacing RuntimeErrorPlaceholder with a Kotlin typealias is only source-level compatibility for Kotlin. It will break (1) binary compatibility for already-compiled clients expecting io.spine.validation.RuntimeErrorPlaceholder as a real enum class, and (2) all Java source usage since typealiases are not visible from Java. If backward compatibility is required, keep a real deprecated RuntimeErrorPlaceholder type (e.g., a deprecated enum delegating to ErrorPlaceholder values, or a deprecated wrapper exposing the old API) and migrate callers gradually.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread context/build.gradle.kts Outdated
Comment thread docs/content/docs/validation/developer/runtime-library.md Outdated
Comment thread docs/content/docs/validation/developer/validation-model.md
Comment thread docs/content/docs/validation/developer/adding-a-built-in-option.md Outdated
Comment thread docs/content/docs/validation/user/04-validators/implement-a-validator.md Outdated
Comment thread buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt
Comment thread CLAUDE.md Outdated
Comment thread gradle/wrapper/gradle-wrapper.properties
Copilot AI review requested due to automatic review settings May 13, 2026 19:23
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review May 13, 2026 19:28
@alexander-yevsyukov alexander-yevsyukov requested review from armiol and removed request for Copilot May 13, 2026 19:28
Copy link
Copy Markdown

@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.

Reviewed commit: 167d3e5e76

ℹ️ 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 thread jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt
Copilot AI review requested due to automatic review settings May 13, 2026 19:45
Copy link
Copy Markdown
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 47 out of 49 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt:74

  • The deprecated typealias RuntimeErrorPlaceholder = ErrorPlaceholder does not preserve binary compatibility (already-compiled Kotlin/Java code will still reference the removed RuntimeErrorPlaceholder enum class) and it is not visible from Java sources at all. If backward compatibility is required, consider keeping a deprecated RuntimeErrorPlaceholder declaration (e.g., an enum delegating to ErrorPlaceholder values or a class/object exposing the same constants) for at least one release line.

Comment thread docs/content/docs/validation/developer/adding-a-built-in-option.md Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 13, 2026 19:52
Copy link
Copy Markdown
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 47 out of 49 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt:74

  • RuntimeErrorPlaceholder is now a Kotlin typealias, which is source-compatible only. It does not generate a JVM type, so any already-compiled Kotlin/Java code that referenced io.spine.validation.RuntimeErrorPlaceholder will fail at runtime (binary incompatible). If backward binary compatibility is required, keep a deprecated enum class RuntimeErrorPlaceholder with the same FQCN and constants (you can delegate each constant’s value to the corresponding ErrorPlaceholder constant to avoid duplicating the strings).

Comment thread buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt
Comment on lines 531 to 534
[validation-plugin]: https://github.com/SpineEventEngine/validation/blob/master/context/src/main/kotlin/io/spine/tools/validation/ValidationPlugin.kt
[default-message]: https://github.com/SpineEventEngine/validation/blob/master/context/src/main/kotlin/io/spine/tools/validation/DefaultErrorMessage.kt
[error-placeholder]: https://github.com/SpineEventEngine/validation/blob/master/context/src/main/kotlin/io/spine/tools/validation/ErrorPlaceholder.kt
[option-generator-pkg]: https://github.com/SpineEventEngine/validation/tree/master/java/src/main/kotlin/io/spine/tools/validation/java/generate/option
Copilot AI review requested due to automatic review settings May 13, 2026 20:25
Copy link
Copy Markdown
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 50 out of 52 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt:74

  • RuntimeErrorPlaceholder is now a Kotlin typealias, which does not produce a JVM type. This breaks Java source compatibility (io.spine.validation.RuntimeErrorPlaceholder no longer exists) and also breaks binary compatibility for already-compiled clients. If backward compatibility is required, keep a real deprecated enum class RuntimeErrorPlaceholder (or another JVM-visible type) and map its entries to ErrorPlaceholder values.
    jvm-runtime/src/main/kotlin/io/spine/validation/ErrorPlaceholder.kt:28
  • Changing the package from io.spine.tools.validation to io.spine.validation is a breaking change for existing consumers (both source and binary). If this type was previously published under the old package, consider providing a deprecated shim in io.spine.tools.validation (e.g., a delegating enum or other JVM-visible wrapper) to preserve compatibility, or explicitly treat this as a breaking release.

@alexander-yevsyukov alexander-yevsyukov merged commit 7180f67 into master May 14, 2026
10 of 11 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the eliminate-duplicated-error-placeholders branch May 14, 2026 13:51
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