Add RequiredIdOptionReaction and RequiredIdPatternCreation from Validation#67
Add RequiredIdOptionReaction and RequiredIdPatternCreation from Validation#67alexander-yevsyukov merged 40 commits intomasterfrom
RequiredIdOptionReaction and RequiredIdPatternCreation from Validation#67Conversation
... because corresponding compilation is done by CoreJvm Compiler internally.
There was a problem hiding this comment.
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
RequiredIdReactionthat provides common functionality for marking ID fields as required - Adds
RequiredIdOptionReactionto the Entity plugin for discovering entity states via options - Adds
RequiredIdPatternReactionto 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.
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/RequiredIdPatternReaction.kt
Outdated
Show resolved
Hide resolved
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/RequiredIdPatternReaction.kt
Outdated
Show resolved
Hide resolved
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/RequiredIdPatternReaction.kt
Outdated
Show resolved
Hide resolved
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/CommandTargetReaction.kt
Show resolved
Hide resolved
Also: * Improve wording of violation of missing target entity ID in a command message.
There was a problem hiding this comment.
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.
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/CommandTargetReaction.kt
Outdated
Show resolved
Hide resolved
signal-tests/src/test/kotlin/io/spine/tools/core/jvm/signal/FirstRejectionFieldSpec.kt
Outdated
Show resolved
Hide resolved
base/src/main/kotlin/io/spine/tools/core/jvm/field/RequiredIdReaction.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
💡 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".
signal/src/main/kotlin/io/spine/tools/core/jvm/signal/CommandTargetReaction.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
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.
This PR adds classes that were named
RequiredIdOptionReactionandRequiredIdPatternReactionin the Validation Compiler to CoreJvm Compiler.The classes were renamed and put into corresponding modules:
RequiredIdOptionReaction->EntityStateIdReaction, placed into theentitiesmodule.RequiredIdPatternReaction->CommandTargetReaction, placed into thesignalsmodule.The added classes now use settings of CoreJvm Compiler plugins instead of
MessageMarkersfrom 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
PluginTestSetuptest fixture now addsJavaValidationPluginbefore a plugin under the test in the code generation pipeline. This is needed for custom validation rules to work correctly in CoreJvm Compiler tests.