MCR-3773 Fix XEditor validation failures sharing the same XPath#3054
Open
yagee-de wants to merge 1 commit into
Open
MCR-3773 Fix XEditor validation failures sharing the same XPath#3054yagee-de wants to merge 1 commit into
yagee-de wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses XEditor validation result handling when multiple xed:validate declarations target the same absolute XPath, ensuring distinct failed rules can be reported in declaration/validation order while keeping the validation marker semantics stable.
Changes:
- Reworked validation result storage to track failed rules by
(absolute XPath, rule element identity)instead of just XPath. - Removed “skip if XPath already has error” short-circuiting from multiple validators so later rules can still be evaluated and recorded.
- Added a focused JUnit 5 test suite covering distinct-rule reporting, continued evaluation after failure, and de-duplication for multiple validators originating from one rule element.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| mycore-xeditor/src/test/java/org/mycore/frontend/xeditor/validation/MCRXEditorValidatorValidationResultsTest.java | Adds regression tests validating ordering and distinct failure reporting for shared XPaths. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRXPathTestValidator.java | Removes early-exit on existing errors so later rules can still contribute failures. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRXEditorValidator.java | Documents and exposes failed-rule lookup and ordered failed-rules access. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRValidator.java | Removes early-exit on existing errors to allow multiple distinct rule failures per XPath. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRValidationResults.java | Implements new failed-rule tracking keyed by XPath + rule element identity; keeps marker behavior stable. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRRequiredValidator.java | Removes early-exit on existing errors for consistent evaluation behavior. |
| mycore-xeditor/src/main/java/org/mycore/frontend/xeditor/validation/MCRExternalValidator.java | Removes early-exit on existing errors so distinct external validations can still be recorded. |
| mycore-xeditor/pom.xml | Adds junit-jupiter-api test dependency needed for the new JUnit 5 tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
83
to
90
| public MCRValidator getFailedRule(String xPath) { | ||
| return xPath2FailedRule.get(xPath); | ||
| for (Map.Entry<FailedRuleKey, MCRValidator> failedRule : failedRules.entrySet()) { | ||
| if (xPath.equals(failedRule.getKey().xPath())) { | ||
| return failedRule.getValue(); | ||
| } | ||
| } | ||
| return null; | ||
| } |
yagee-de
force-pushed
the
issues/MCR-3773-x-editor-displays-only-one-message-per-xpath
branch
from
July 21, 2026 11:28
5c45f2d to
22048d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to jira.
Pull Request Checklist (Author)
Please go through the following checklist before assigning the PR for review:
Ticket & Documentation
fixed-versionis correctly set in the ticket and matches the PR's target branch (main).Feature & Improvement Specific Checks
Bugfix-Specific Checks
Testing
MCR Conventions & Metadata
mycore.properties.mycore.properties.Multi-Repo Considerations
MIRrequired?