-
Notifications
You must be signed in to change notification settings - Fork 308
feat: Implement XSD Schema Compatibility Checking #6679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Enhanced the XSDCompatibilityChecker to detect removal of any elements/attributes (not just required ones) and addition of new required elements/attributes as backward incompatible. Improved parsing of elements and attributes from complex types. Updated test cases for clarity and added XsdCompatibilityManualTest for manual verification. Added documentation describing the implementation and rules.
Added IMPLEMENTATION_SUMMARY.md summarizing the XSD compatibility checker implementation and test results. Expanded XSD_COMPATIBILITY_IMPLEMENTATION.md with more details on compatibility modes, rules, and test coverage. Added new and improved tests for forward, full, and transitive compatibility in XsdCompatibilityCheckerTest.java to ensure comprehensive validation of XSD schema evolution scenarios.
Deleted IMPLEMENTATION_SUMMARY.md, XSD_COMPATIBILITY_IMPLEMENTATION.md, and XsdCompatibilityManualTest.java, consolidating documentation into a new comprehensive README.md for the XSD compatibility checker. This streamlines documentation and removes the standalone manual test, as all relevant information and usage details are now included in README.md.
Changed the XSD mapping support from 'None' to 'Full' in the assembly rule reference documentation to accurately reflect current capabilities.
There was a problem hiding this 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 implements comprehensive XSD compatibility checking for the Apicurio Registry, enabling validation of schema evolution according to industry-standard compatibility rules.
- Adds full XSD compatibility checker supporting all compatibility modes (BACKWARD, FORWARD, FULL, and TRANSITIVE variants)
- Implements DOM-based XSD parsing with comprehensive element/attribute/type extraction and validation
- Provides 20 comprehensive unit tests covering all compatibility scenarios with 100% pass rate
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| XsdCompatibilityChecker.java | New ~715 line implementation with DOM-based parsing and compatibility validation logic |
| XsdCompatibilityCheckerTest.java | New comprehensive test suite with 20 tests covering all compatibility modes |
| XsdArtifactTypeUtilProvider.java | Modified to use new XsdCompatibilityChecker instead of NoopCompatibilityChecker |
| pom.xml | Added JUnit 5 dependency for testing |
| README.md | New comprehensive documentation of implementation and usage |
| assembly-rule-reference.adoc | Updated documentation to reflect XSD compatibility support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...util/xsd/src/main/java/io/apicurio/registry/rules/compatibility/XsdCompatibilityChecker.java
Show resolved
Hide resolved
...util/xsd/src/main/java/io/apicurio/registry/rules/compatibility/XsdCompatibilityChecker.java
Show resolved
Hide resolved
.../xsd/src/test/java/io/apicurio/registry/rules/compatibility/XsdCompatibilityCheckerTest.java
Show resolved
Hide resolved
|
Thanks for the contribution @stn1slv 👍 |
Summary
This PR implements comprehensive XSD (XML Schema Definition) compatibility checking for the Apicurio Registry, enabling validation of schema evolution according to industry-standard compatibility rules.
Changes
New Features
BACKWARD- Old data readable by new schemaFORWARD- New data readable by old schemaFULL- Both backward and forward compatibleBACKWARD_TRANSITIVE,FORWARD_TRANSITIVE,FULL_TRANSITIVE- Historical version validationNONE- No compatibility checkingImplementation Details
Core Implementation:
XsdCompatibilityChecker(~715 lines) - Main compatibility checker extendingAbstractCompatibilityCheckerKey Capabilities:
Modified Files
schema-util/xsd/src/main/java/io/apicurio/registry/rules/compatibility/XsdCompatibilityChecker.java(NEW)schema-util/xsd/src/test/java/io/apicurio/registry/rules/compatibility/XsdCompatibilityCheckerTest.java(NEW)schema-util/util-provider/src/main/java/io/apicurio/registry/types/provider/XsdArtifactTypeUtilProvider.java(Modified - 1 method)schema-util/xsd/pom.xml(Added JUnit 5 dependency)schema-util/xsd/README.md(NEW - Comprehensive documentation)Testing
Test Coverage
Test Categories:
Test Scenarios Include:
minOccurs,maxOccurs)Build Status