Generate test conf.xml/controller-config.xml fixtures from canonical at build time#6531
Open
duncdrum wants to merge 9 commits into
Open
Generate test conf.xml/controller-config.xml fixtures from canonical at build time#6531duncdrum wants to merge 9 commits into
duncdrum wants to merge 9 commits into
Conversation
3e5a0d4 to
d836374
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
d836374 to
e063e63
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
…generate SchemaVersion constants Extend the Maven validate phase to check every schema/*.xsd against the W3C XSD 1.1 meta-schema (upgrading the bundled XMLSchema.xsd/dtd to the 2009 XSD 1.1 revision); caught and removed five xsi:type="dcterms:W3CDTF" appinfo annotations with no backing schema, bumping the affected schema @Version values. Wire a generate-sources execution that reads each governed XSD's xs:schema/@Version and emits SchemaVersion.java constants so they can never drift from the schemas. Closes eXist-db#5541
e063e63 to
3cd74e0
Compare
…line Wire the XML Catalog API into Saxon's XsltCompiler so xsl:import, xsl:include, and document() URIs resolve via the eXist-db entity catalog (Closes eXist-db#350). Generalize MutableCollection's at-store-time validation to route through a JAXP 1.1 SchemaFactory when the schema or its catalog- resolved meta-schema requires XSD 1.1; extract the detection logic into Xsd11SchemaDetection so validation:jaxp() and org.exist.validation.Validator share the same probe-compile path. Suppress the spurious xmlresolver WARNING for the non-existent "default" catalog entry. Closes eXist-db#5541
Set a Jetty stop timeout so shutdown does not block indefinitely on active connections; move ShutdownListenerImpl.shutdown() to a daemon thread so it does not deadlock the Jetty shutdown-hook thread that also holds the BrokerPool write lock.
…nical at build time Add a Maven exec plugin execution that transforms the canonical exist-distribution conf.xml through module-specific XSLT strip-sheets, writing per-module fixture conf.xml and controller-config.xml files into src/test/resources-filtered at process-test-resources time. Eliminates ~35 hand-maintained fixture copies that drift from canonical on every schema edit.
…o URN imports Register the repo-root schema/catalog.xml in the Maven xml-maven-plugin catalog chain so XSD-against-XSD validation resolves locally without network access. Migrate all 35 XSLT strip-sheets from bare http:// imports to URN-mapped imports via the catalog. Document the new-native-schema checklist and fix the profile location note in the README.
3cd74e0 to
ecf2cc5
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.
Summary
Replaces ~35 hand-maintained
conf.xmlandcontroller-config.xmltest fixture copies with XSLT codegen from the canonicalexist-distributionsources atgenerate-test-resourcestime. The generated fixtures stay in sync with the canonical automatically; no more manual updates when conf.xml changes.schemaVersion, standardises whitespace/comments — one-time cleanup before switching to codegenschema/generate-conf-fixture.xsl,schema/generate-controller-config-fixture.xsl) + per-fixtureconf-fixture.xsl/controller-config-fixture.xsloverride +xml-maven-pluginexecution ingenerate-test-resourcesphase. Per-fixture stylesheets redeclarexsl:paramdefaults coveringkeep-modules,keep-indexes,data-path,catalog-uri, and moreschema/catalog.xmlmaps stable URNs for both base stylesheets; all 35 fixture XSLs usexsl:import href="urn:exist-db:codegen:generate-conf-fixture"instead of fragile depth-relative hrefs — works identically in Maven build and IDE toolingconf-fixture-codegenprofile inexist-parent/pom.xmlauto-activates for any module withsrc/test/resources-filtered/conf-fixture.xsl, removing boilerplatexml-maven-pluginconfig from 19 modulesWhat changed
schema/generate-conf-fixture.xsl,schema/generate-controller-config-fixture.xslschema/catalog.xmlconf-fixture.xsl(new), 7×controller-config-fixture.xsl(new)conf.xml, 7×controller-config.xml(generated at build time now)exist-parent/pom.xmlpom.xmlfiles (simplifications)schema/README.md(new "Adding a new native schema" and "Test fixture codegen" sections),AGENTS.mdXMLReaderExpansionTestineffective runtime feature overrideDependency
Requires #6528 and #6530 merged first.
Transform.javain #6530 introduces asetResourceResolverlambda that this PR edits a comment inside — cherry-picking this branch ontodevelopwithout #6530 fails.Test plan
exist-coresuite: 7046/7046, 0 failures, 0 errorsSchemaVersionFixtureAuditTest— all generated fixtures carry correctschemaVersionexpathrepotests —skip.conf.fixture.profileoverride works correctlyNotes
This is PR-D of a 5-PR split from #6505. Merge order: #6528 → #6530 → this PR → #6550 → #6551. The diff is large by file count (~120 files) but highly mechanical: 35
conf.xmldeletions, 35conf-fixture.xsladditions, andpom.xmlsimplifications. Reviewers can validate structurally rather than line-by-line.Closes #6505 (superseded by this 5-PR split).
🤖 Generated with Claude Code