refactor(templates): remove the classic cover-letter family - #276
Merged
Merged
Conversation
The Gen-2 cover-letter stack (coverletter.{presets,builder,spec,layouts} +
data.coverletter) is superseded by the layered coverletter.v2 surface. It is
removed before the classic CV family because each classic cover-letter preset
cross-references its paired cv.presets preset in Javadoc, which the javadoc
gate would reject once cv.presets is gone; CV does not reference cover-letter.
Delete the classic cover-letter packages, their tests, and the CoverLetterMock
fixture; repoint the cover-letter package-info at the v2 stack. Strip the
classic cover-letter helpers from TemplateTestSupport and ExampleDataFactory
(the v2 sample and sampleHeader stay) and the data.coverletter entry from the
data package-info. Also drop an orphaned classic cover-letter layout snapshot
that no test loads.
Tests: ./mvnw verify javadoc:javadoc -pl . — 1553 tests, 0 failures, javadoc
clean; examples + benchmarks compile; examples-generation smoke (85) green,
including the v2 cover-letter gallery.
DemchaAV
added a commit
that referenced
this pull request
Sep 13, 2026
…#686) * test(templates): restore CV and cover-letter layout snapshot coverage Sixteen layered CV presets and all fifteen cover letters shipped with a pixel gate and no layout snapshot. The suites that pinned them were deleted with the classic families in #276 and #277; their baselines stayed behind, and no test has read them since. The pixel gates tolerate 50 000 mismatched pixels, so a shift of a few points in any of these presets passes unseen. - CvPresetFixtures and CoverLetterPresetFixtures hold each family's roster and canonical document, moved verbatim out of the two pixel gates, so the pixel gate and the snapshot gate render the same presets on the same document. The only text change is a javadoc pointer that named the old location. - CvPresetLayoutSnapshotTest and CoverLetterPresetLayoutSnapshotTest snapshot every preset on the roster, as <pixel slug>_layout. - CoverLetterTextLayerGateTest reads the letter from its new home. The 31 baselines were recorded by these gates on this tree, after every difference from the renders these presets last had a snapshot of was explained. Against their v2.2.0 renders 18 are identical and 13 moved, and each move traces to a develop commit rendered on either side of it: - #676, spaced caps set with tracking instead of padded strings: heading and name widths only, no coordinate, height or page change. classic_serif, sidebar_portrait, mint_editorial, timeline_minimal (CV and letter), and part of minimal_underlined, centered_headline and monogram_sidebar. - d0c946a (in #633), stacked rows drawn as lists: bullet paragraphs become ListNodes, four fewer nodes on each of boxed_sections, minimal_underlined, modern_professional, executive and panel, and the list half of blue_banner and centered_headline. - #577, the employer drawn in Monogram Sidebar's experience entries: two added nodes. Page counts are unchanged in all 31, and every node that moved still sits inside its parent and inside the page's content band. * test(templates): restore proposal and invoice layout snapshot coverage ModernProposal and ModernInvoice had no layout snapshot either; every other proposal and invoice preset carries a suite of its own. - ProposalPresetLayoutSnapshotTest snapshots ModernProposal on the canonical proposal its pixel gate already renders. - InvoicePresetFixtures gains layoutSnapshotPresets(), read by InvoicePresetLayoutSnapshotTest. It lists ModernInvoice only: ClassicInvoice takes the same spec, but ClassicInvoiceLayoutSnapshotTest already pins it on the same invoice at the same margin, so listing it would record that page twice. canonicalInvoice() and stressInvoice() are unchanged. modern_invoice_layout is identical to its v2.2.0 render. modern_proposal_layout differs from its v2.2.0 render in one node: ProposalV2ModernFooter[6], a bare page-flow wrapper around the footer note, moves from y 20.24 on pages 0..1 to y 790.64 on page 1. The paragraph inside it, the only thing it draws, is at y 790.64 on page 1 in both. The note needs 23.25pt and 15.49pt were left under the acceptance terms, so it went to page 1 and the empty wrapper stayed behind claiming page 0 - the defect 361ff83 (in #633) fixed, and the commit this node changes at when rendered on either side of it. Page count 2 and node count 43 are unchanged, and nothing drawn moved. * test(templates): hold every shipped preset to a layout snapshot The thirty-three presets restored in the previous two commits went two months without a layout snapshot and nothing said so. Their suites were deleted along with another family, their baselines stayed on disk, and every gate that remained only checked the presets it listed. ShippedPresetLayoutSnapshotCoverageTest derives the two sets independently and compares them: - shipped: every class under a templates presets package that declares a public ID, read from the templates sources; - covered: every preset an active layout-snapshot suite renders, read from the qa sources. A suite is a test that calls assertCanonicalSnapshot and is not disabled; it covers a preset of its own family it creates directly, or through a Stream<Arguments> roster it reads from a fixture. A fixture read only for its document covers nothing, and comments and strings are stripped before any of this is matched. Neither side is a hand-kept list and no count is asserted, so a preset added without a suite fails it by name. An allow-list takes a reviewed exemption with its reason and is empty; a second test rejects an entry that does not ship, or that a suite already covers. Sabotaged, each change confirmed on disk before the run and reverted after: - the four gates added in this branch removed: fails naming exactly the 33 - mint_editorial dropped from the CV roster: names cv/MintEditorial - a new preset class with an ID and no suite: names it - CobaltRota's suite disabled by a fully qualified @disabled, or no longer calling assertCanonicalSnapshot: names rota/CobaltRota - ClassicInvoice's suite rendering another preset while still reading InvoicePresetFixtures for its document: names invoice/ClassicInvoice - an exemption for a covered preset, and one for a preset that does not ship: the second test fails, naming each * test(templates): remove the orphaned snapshots and dead fixture helpers Thirty-eight baselines under layout-snapshots/canonical-templates had no reader. Thirty-two lost their suites when the classic families went: the template_v2_cv and cv-v2/regression files in #277, the template_v2_letter files in #276. The invoice_standard, proposal_long and four weekly-schedule layouts were last read by tests removed in the v1.6 cleanup, 47241c8. Nine TemplateTestSupport helpers that fed those tests had no callers left. Both removals were proven on this tree immediately before deleting: - no tracked file names any of the 38 outside the snapshot folders, except docs/operations/layout-snapshot-testing.md, whose naming section lists two of them as examples beside two names that never existed as files; - nothing builds their names from parts (template_v2_, regression, weekly_schedule), and no test or tool walks the snapshot folders; - the nine helpers have no qualified call, static import, wildcard import, method reference, or string or reflective use; the only calls to them were from one another. TemplateTestSupport now says what the canonical root is for, that a baseline belongs to the suite that writes it, and that ShippedPresetLayoutSnapshotCoverageTest holds every shipped preset to it. Every *LayoutSnapshotTest in qa and the coverage test stay green after the removal: 34 classes, 74 tests.
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
The Gen-2 cover-letter stack (
coverletter.{presets,builder,spec,layouts}+data.coverletter) is superseded by the layeredcoverletter.v2surface.Removed before the classic CV family: each classic cover-letter preset has a
{@link …cv.presets.X}"paired CV preset" Javadoc cross-ref that the javadoc gate would reject oncecv.presetsis deleted. CV does not reference cover-letter, so cover-letter-first leaves CV removal clean. (Cover-letter also needs no benchmark repoint — the benchmarks render CV/invoice/proposal.)What
mock/CoverLetterMock. Keep + repointcoverletter/package-infoat the v2 stack (dropped@Deprecated). All ofcoverletter.v2is untouched (its presets are name-twins of the classic ones in a different package).TemplateTestSupport(coverLetter()/jobDetails(), only the deleted test called them) andExampleDataFactory(sampleCoverLetter()/sampleCoverLetterDocument(); the v2 sample +sampleHeader()stay). Dropdata.coverletterfrom the datapackage-info.cover_letter_standard.json) that no test loads.Tests
./mvnw verify javadoc:javadoc -pl .— 1553 tests, 0 failures, javadoc clean. Examples + benchmarks compile; examples-generation smoke (85) green, including the v2 cover-letter gallery. japicmp report-only on this line.