Skip to content

Add RequiredIdOptionReaction and RequiredIdPatternCreation from Validation#67

Merged
alexander-yevsyukov merged 40 commits intomasterfrom
new-validaation-settings
Dec 18, 2025
Merged

Add RequiredIdOptionReaction and RequiredIdPatternCreation from Validation#67
alexander-yevsyukov merged 40 commits intomasterfrom
new-validaation-settings

Conversation

@alexander-yevsyukov
Copy link
Contributor

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

This PR adds classes that were named RequiredIdOptionReaction and RequiredIdPatternReaction in the Validation Compiler to CoreJvm Compiler.

The classes were renamed and put into corresponding modules:

  • RequiredIdOptionReaction -> EntityStateIdReaction, placed into the entities module.
  • RequiredIdPatternReaction -> CommandTargetReaction, placed into the signals module.

The added classes now use settings of CoreJvm Compiler plugins instead of MessageMarkers from Validation. Correspondingly, the code of wring settings for the Validation Plugin was removed.

The PR also updates the code to make only target entity ID of command messages to be assumed as (required). Previously, all signal messages had the first message assumed (required), which is too far-fetched.

Other notable changes

  • PluginTestSetup test fixture now adds JavaValidationPlugin before a plugin under the test in the code generation pipeline. This is needed for custom validation rules to work correctly in CoreJvm Compiler tests.

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 migrates RequiredIdOptionReaction and RequiredIdPatternReaction classes from the Validation Compiler to the CoreJvm Compiler plugins. The key change is that these reactions now use settings from CoreJvm Compiler plugins instead of MessageMarkers from the Validation module.

  • Introduces a base class RequiredIdReaction that provides common functionality for marking ID fields as required
  • Adds RequiredIdOptionReaction to the Entity plugin for discovering entity states via options
  • Adds RequiredIdPatternReaction to the Signal plugin for discovering signals via file patterns
  • Removes the now-obsolete code for writing Validation plugin settings in WriteCompilerPluginsSettings

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
version.gradle.kts Bumps the CoreJvm Compiler version from 041 to 042
pom.xml Updates Validation library dependencies to version 376 and adds validation-context dependency
base/src/main/kotlin/io/spine/tools/core/jvm/field/RequiredIdReaction.kt Adds abstract base class for reactions that mark ID fields as required
base/build.gradle.kts Adds validation-context dependency
entity/src/main/kotlin/io/spine/tools/core/jvm/entity/RequiredIdOptionReaction.kt Adds reaction for marking entity state ID fields as required based on entity options
entity/src/main/kotlin/io/spine/tools/core/jvm/entity/EntityPlugin.kt Registers the new RequiredIdOptionReaction in the Entity plugin
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/RequiredIdPatternReaction.kt Adds reaction for marking signal ID fields as required based on file patterns
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/SignalPlugin.kt Registers the new RequiredIdPatternReaction in the Signal plugin
gradle-plugins/src/main/kotlin/io/spine/tools/core/jvm/gradle/plugins/WriteCompilerPluginsSettings.kt Removes obsolete code for writing Validation plugin settings
buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingExts.kt Changes visibility of jar-related functions to public and adds utility function for Maven publications
buildSrc/src/main/kotlin/io/spine/gradle/publish/ProtoExts.kt Improves hasProto() check to verify directories are non-empty
buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt Updates Validation version to 376 and adds context module constant
dependencies.md Updates generated timestamp from Dec 15 to Dec 16

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

@alexander-yevsyukov alexander-yevsyukov self-assigned this Dec 17, 2025
Copilot AI review requested due to automatic review settings December 17, 2025 21:03
Copilot AI review requested due to automatic review settings December 18, 2025 17:14
@alexander-yevsyukov alexander-yevsyukov marked this pull request as ready for review December 18, 2025 17:15
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 29 out of 30 changed files in this pull request and generated 3 comments.


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

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

Copilot AI review requested due to automatic review settings December 18, 2025 17:37
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 29 out of 30 changed files in this pull request and generated 2 comments.


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

@alexander-yevsyukov alexander-yevsyukov merged commit 8d1831e into master Dec 18, 2025
7 checks passed
@alexander-yevsyukov alexander-yevsyukov deleted the new-validaation-settings branch December 18, 2025 18:13
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