test(docs): cover the READMEs, the backend packages, and the showcase register - #480
Merged
Conversation
… register The snippet guard read only docs/, so the pages a reader copies from first were free to name a method the library no longer has. The package map was a hand-kept list, and the fixed-layout PPTX backend shipped a release with neither document naming it. A showcase entry keyed on a document the runner never writes is never read, so it drifts without a symptom. - Snippet compilation includes the root README and every module README, found by their pom.xml. A marker can supply the imports a short taste block would otherwise be doubled in length by; docs/private/ is skipped. - Backend packages are derived by scanning for *Backend types, and each must be named in CONTRIBUTING.md and the package map in its own right — an ancestor covers no child. The fixed-layout SPI is named for the first time. - Every ShowcaseMetadata entry must match a generated document, and its source link must resolve to a file in the tree.
… every module Each of the three guards could stay green while the thing it names went wrong. - The example tree is emptied before it is rebuilt. The runner only writes, so a document deleted from it survived in target/ and answered for the showcase entry that no longer had one — green locally, red only on a clean CI checkout. - A Java fence in a README must now compile or carry the reason it cannot. Marking was opt-in, so an unmarked fence was indistinguishable from a covered one: seven compile, forty-five are exempt on the record, none are silent. - Backend packages are scanned in every module the root pom builds, not in four named ones — a backend arriving in a new module was invisible to the guard. - Both documentation guards resolve the published pages through one helper; they were two hand-kept lists and had already drifted. The package that was undocumented was the backend-neutral fixed-layout SPI, missing from the contributing guide; the wording that named the PPTX backend was wrong.
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.
Why
Three documented surfaces had no build behind them.
The snippet guard compiled
docs/only. The pages a reader reaches first — the root README and each module's — were free to name a method the library no longer has.The package map was a hand-kept list. The backend-neutral fixed-layout SPI was missing from the contributing guide, which is the one document a reader consults before adding an output format: a contributor registers a fragment kind with the backend they can find, and a kind registered with only one fixed-layout backend renders in one output and vanishes from the other.
The showcase register falls back to a filename-derived card, so an entry keyed on a document the runner never writes is simply never read — no card, no warning, no failure.
What
Every Java fence in a README is accounted for. The scan adds the root README and every module README, taken from the root pom's
<modules>so "a module" means what it means to Maven. Marking stays opt-in underdocs/, where pages teach with deliberate fragments; in a README it is mandatory — a fence carries eitherdoc-exampleor<!-- doc-example-ignore: reason -->, and the reason is required. Seven compile against the current API on every build; forty-five are exempt on the record. Nothing is silent.A module README opens with a three-line taste of the API, which the imports it needs would double in length, so a snippet can take them from the marker instead:
imports=a.b.C,d.e.F, verified by the compile like any other name. Two marker mistakes are reported where they happen rather than as an unresolved symbol inside a snippet: an unknown attribute and a stray token from a space after a comma.docs/private/leaves the scan, and both guards that read the published documentation now resolve the page set through one helper — they were two hand-kept lists and had already drifted.The package map is derived from the source tree. Packages qualify by containing a
*Backendtype, in every module the reactor builds, so a backend arriving in a new module is covered the day it lands. Each must be named inCONTRIBUTING.mdanddocs/architecture/package-map.mdin its own right: accepting an ancestor reads as reasonable and guts the guard, because adding the missing parent would make every package beneath it uncheckable. Matching is boundary-aware and takes either the fully-qualified name or thedocument.backend.…tail the docs also use.The showcase register is checked against the catalogue. Every entry must match a generated document, and its source link must resolve to a file in the tree — a renamed example fails the build instead of leaving a 404 behind the card. The tree is emptied before it is rebuilt: the runner only writes, so a document deleted from it survived in
target/and answered for the entry that no longer had one. That made the guard green locally and red only on a clean checkout. Generation is shared between the example suites and runs once per JVM.The reverse direction is deliberately not asserted: a generated document without an entry still reaches the site through the fallback, which is what the fallback is for.
render-docxjoins theqatest classpath, so its README compiles against the realDocxSemanticBackend.Tests
Reactor gate green (
clean verifyover the ten CI modules),qaalone at 684 tests,examplesat 52,javadoc:javadocclean.Each rule was run in both directions:
CONTRIBUTING.mdbuildPdf()incore/README.mdimport=instead ofimports=docs/private/codeUrlpoints atclean