Generate test conf.xml/controller-config.xml fixtures from canonical at build time - #6531
Merged
Conversation
This was referenced Jun 26, 2026
duncdrum
marked this pull request as draft
June 26, 2026 16:09
duncdrum
marked this pull request as ready for review
June 26, 2026 16:09
duncdrum
force-pushed
the
dp-fixture-codegen
branch
4 times, most recently
from
July 7, 2026 13:57
3cd74e0 to
ecf2cc5
Compare
reinhapa
approved these changes
Jul 9, 2026
duncdrum
force-pushed
the
dp-fixture-codegen
branch
from
July 13, 2026 13:18
ecf2cc5 to
b899894
Compare
…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
…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
… XML_SCHEMA_NS XML_SCHEMA_NS was never read — callers already used XMLConstants directly. XSD_1_1_NS is promoted to Namespaces.XSD_1_1_NS so it is available codebase-wide without duplication. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
duncdrum
force-pushed
the
dp-fixture-codegen
branch
from
July 13, 2026 14:25
b899894 to
a9c9428
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
duncdrum
force-pushed
the
dp-fixture-codegen
branch
from
July 13, 2026 15:07
a9c9428 to
b38ca7a
Compare
…f MutableCollection MutableCollection carried a schema cache (plain ConcurrentHashMap) plus the namespace-resolution/validation logic that uses it -- neither is Collection state. Splits this into two package-private classes: - Xsd11SchemaCache: the per-namespace "needs XSD 1.1?" cache, now backed by Caffeine for consistency with the codebase's other caches (no eviction policy, since the namespace set is finite and admin-controlled -- this was never a correctness concern, just a style/testability one). - Xsd11ValidationHelper: resolveXsd11SchemaForNamespace, the dynamic-discovery schema holder, parseOrValidateXmlSource, validateWithXsd11Schema, and the Xsd11LexicalHandlerForwarder record -- store-time XSD 1.1 validation, not Collection bookkeeping. MutableCollection keeps only its public clearXsd11SchemaByNamespaceCache() facade (GrammarTooling.java's external call site) and a single delegating call from storeXmlDocument(); 9 imports that only the moved code needed are dropped. Behavior-preserving: all 63 tests across the validation/XSD11 suite pass unchanged. Addresses dizzzz's review comments on eXist-db#6530/eXist-db#6551.
duncdrum
force-pushed
the
dp-fixture-codegen
branch
from
July 26, 2026 15:01
b38ca7a to
9602881
Compare
…reated edit 4e949b4 dropped xsi:type="dcterms:W3CDTF" from the dcterms:created annotation in 5 sibling schema files and correctly bumped @Version on 4 of them (collection.xconf.xsd, cxan.xsd, exist.xsd, repo.xsd) -- this one was missed, leaving expath-pkg.xsd's content changed but @Version still 1.1.0. CI's schema governance check (ci-schema-checks.yml, added in PR-A) catches exactly this. Bumps to 1.1.1, a documentation/non-semantic patch per schema/README.md's policy, matching the sibling files' bumps. Verified locally against the real merge-base with upstream/develop: mvn -N xml:transform@schema-governance passes, SchemaVersionSyncTest passes unaffected (expath-pkg.xsd isn't one of the 5 SchemaVersion.java-tracked schemas).
…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.
… stylesheets conf-fixture.xsl and controller-config-fixture.xsl are new eXist-db-authored XSLT codegen tooling, not modifications of Adam Retter's original BSD-3 conf.xml/controller-config.xml. They fell outside the module's existing conf.xml/log4j2.xml excludes and so wrongly inherited the module-wide BSD-3 header. Excludes them from the BSD-3 licenseSet and adds a second licenseSet applying eXist-db's default LGPL-21 header to just these two files instead. Addresses review discussion between dizzzz, adamretter, and reinhapa on eXist-db#6551.
duncdrum
force-pushed
the
dp-fixture-codegen
branch
from
July 26, 2026 15:18
9602881 to
8f2740e
Compare
duncdrum
added a commit
to duncdrum/exist
that referenced
this pull request
Aug 18, 2026
exist-indexes-jmh generated its conf.xml by transforming extensions/indexes/indexes-integration-tests/src/test/resources-filtered/conf.xml via its own src/main/xslt/conf-jmh.xslt. That source file was never a real static file, only the *input* to indexes-integration-tests' own Maven-time fixture codegen - and once that module switched to the canonical-fixture mechanism (PR eXist-db#6531), its resources-filtered directory holds only a conf-fixture.xsl, no static conf.xml. Result: xml-maven-plugin's transform matched zero input files ("[WARNING] No files found for transformation"), succeeded anyway (empty transformation sets aren't a build failure), and produced no conf.xml at all - the shaded benchmarks jar shipped with none. Every benchmark method across all 5 classes failed instantly on setUp(): `DatabaseConfigurationException: Unable to read configuration file at .../exist-indexes-jmh/etc/conf.xml`. No CI run had exercised this module's benchmarks since eXist-db#6531 merged (the ci-benchmarks.yml run that would have hit it was independently cancelled by the 90-minute job timeout during exist-core-jmh's step first). Fixed by sourcing directly from canonical (exist-distribution/src/main/config/conf.xml) via a new src/main/resources-filtered/conf-fixture.xsl, using the same schema/generate-conf-fixture.xsl mechanism as ~35 other fixtures in the repo (and the one exist-core-jmh now also uses), instead of depending on another module's private fixture input a second time. Removes the now-obsolete conf-jmh.xslt. Verified all 5 benchmark classes (Ngram/RangeEq/RangeFieldEq/Lucene/ GeneralComparisonWhereClauseBenchmark) run clean via `mvn exec:exec`. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.xml/controller-config.xmltest fixture copies with XSLT codegen from the canonicalexist-distributionsources atgenerate-test-resourcestime, so fixtures can't drift from canonical.schema/generate-conf-fixture.xsl,schema/generate-controller-config-fixture.xsl) + a per-module override stylesheet + anxml-maven-pluginexecutionschema/catalog.xmlmaps stable URNs for both base stylesheets, so all fixture XSLs import viaurn:exist-db:codegen:...instead of fragile depth-relative pathsconf-fixture-codegeninexist-parent/pom.xmlauto-activates per module, removing boilerplate from 19 modulepom.xmlfilesWhat changed
schema/generate-conf-fixture.xsl,schema/generate-controller-config-fixture.xsl,schema/catalog.xmlconf-fixture.xsl(new), 7×controller-config-fixture.xsl(new), replacing the equivalent staticconf.xml/controller-config.xmlcopiesexist-parent/pom.xml, ~25 modulepom.xmlsimplificationsschema/README.md— new "Adding a new native schema" and "Test fixture codegen" sectionsextensions/exquery/restxq/pom.xml—conf-fixture.xsl/controller-config-fixture.xslare new eXist-authored tooling, not modifications of the module's original BSD-3 files, so they get the default LGPL-21 header instead of inheriting the module's BSD-3 defaultDependency
Stacked on #6530 (open) —
Transform.javathere introduces asetResourceResolverlambda that this PR edits a comment inside; cherry-picking this branch alone fails. #6528 is merged.Test plan
exist-coresuite: 7046/7046, 0 failuresSchemaVersionFixtureAuditTest— all generated fixtures carry correctschemaVersionlicense:checkacross all 25 affected modulesNotes
PR-D of a 5-PR split from #6505 (superseded — needs closing separately, "Closes" keyword doesn't apply across PRs). Diff is large by file count (~120 files) but mechanical: fixture deletions/additions and pom simplifications — reviewable structurally rather than line-by-line. Merge order: #6528 (merged) → #6530 → this PR → #6550 → #6551.
🤖 Generated with Claude Code