Ship versioned native XSD schemas with governance CI#6528
Conversation
| </xs:annotation> | ||
| </xs:attribute> | ||
| <xs:attribute name="abrev" type="xs:NCName" use="required"/> | ||
| <xs:attribute name="abbrev" type="xs:NCName" use="required"/> |
|
|
||
| phase=none is deliberate: this must NOT run on an ordinary `mvn install`/ | ||
| `mvn test` (no context.xml will exist outside CI). It only runs when | ||
| invoked directly: `mvn xml:transform@schema-governance`. |
There was a problem hiding this comment.
Can we extend the documentation to explain what one has to do in order to create the context file in order to run this outside CI?
There was a problem hiding this comment.
there is a readme inside schema later on which goes into greater detail. To generate the context file, you run the shell script on nix. The idea is that you shouldn't have to ever do this. If you edit a schema file, you should know that you are editing a schema, this is only there to catch version drift, i.e. you edit a schema or instance without changing its version.
Validation will always run as part of normal builds now.
There was a problem hiding this comment.
I would like to be able to check that locally and could not find the infrormation.\
can I call .github/scripts/prepare-governance-context.sh on my local machine?
There was a problem hiding this comment.
You can call the script locally
line-o
left a comment
There was a problem hiding this comment.
Generally looks good and comprehensive.
I would like two things documented answering these questions:
- What needs to be done when a new schema is added?
- How can I check the schema governance on my local machine?
|
The canonical location for schema and instance pairs is the pom's both are picked up automatically. No further edits are necessary, CI will do its thing. If the instance (or the schema) live outside these paths, you need to add the paths in these locations, to I will add these steps to the readme inside schema. |
5984222 to
ab032c1
Compare
|
Can you also address the codacy warnings about assert in Junit tests? |
04e5431 to
8fd2efd
Compare
…antic changes Add a mvn validate execution (xml:transform@schema-governance) that catches semantic edits to the seven native XSD schemas without a matching @Version bump; bump all seven XSDs to reflect post-2023 semantic changes. Closes eXist-db#6190
8fd2efd to
290acfa
Compare
…consolidate governance CI Add schemaVersion="x.y.z" to all five canonical config instances so administrators can see at a glance which XSD version a config file targets, and so startup code can log a DEBUG or WARN when it doesn't match. Consolidate the four separate governance shell scripts into a single governance.xsl, making the version-bump check fully Maven-native. Add SchemaVersionSyncTest to guard the generated constants against drift.
Include schema/ (conf.xsd, collection.xconf.xsd, descriptor.xsd, controller-config.xsd, mime-types.xsd, users.xsd, server.xsd, security-manager.xsd, expath-pkg.xsd and its extensions) in the tarball, zip, Docker image, IzPack installer, and macOS .app bundle as $EXIST_HOME/schema/. Also fix the "abrev" -> "abbrev" typo in expath-pkg.xsd. Closes eXist-db#6189 Partially addresses eXist-db#6008
290acfa to
b867e64
Compare
|
@line-o done also squashed commits and did another round of rebasing based on other review comments. |
Summary
mvn validatechecks that canonical config instances (5 files) stay valid against their XSDs, and that any semantic XSD edit is accompanied by a version bump onxs:schema/@version(enforced by.github/workflows/ci-schema-checks.yml)xs:schema/@versionon all 9 native XSDs for post-2023 semantic changesschemaVersionattribute to each canonical config instance, mirroring the XSD version — lets tooling detect schema/instance drift at a glanceschema/in every distribution layout (tarball,zip, Docker image, IzPack installer) as$EXIST_HOME/schema/, a stable location for external tools (eXide, IDE plugins) to resolve native config grammarsWhat changed
.github/workflows/ci-schema-checks.yml,.github/scripts/prepare-governance-context.sh,schema/governance.xsl,schema/schema-version-type.xsdschema/*.xsd(9 files)schemaVersionattributeexist-distribution/src/main/config/SchemaVersion.javaexist-distribution,exist-docker,exist-installerpom changesschema/README.md,AGENTS.mdSpec references
xs:schema/@version)schema/README.mdTest plan
mvn -N xml:transform@schema-governancepasses on this branch (CI green)mvn validate(canonical instance checks) passesSchemaVersionSyncTest— constants match XSD@versionattributesSchemaVersionTest— constant format/parsingRelated issues
Closes #6189 — ships native XSD schemas in every distribution layout as
$EXIST_HOME/schema/.Closes #6190 — bumps
xs:schema/@versionon all 9 native XSDs; governance CI enforces version bumps on future semantic edits.Partially addresses #6008 — fixes the
abrev→abbrevtypo inexpath-pkg.xsd; thenamespaceattribute/element discrepancy is not addressed in this PR.Notes
This is PR-A of a 5-PR split from #6505. Merge order: this PR → #6530 → #6531 → #6550 → #6551.
🤖 Generated with Claude Code