fix(convert): fail --strict on Asciidoctor errors - #1045
Merged
Merged
Conversation
The playbook's runtime.log.failure_level never took effect: the pipeline drives Antora as a library and never configured @antora/logger, so an unresolved include was published with exit 0. convert.ts now configures the logger from the playbook and fails --strict on any ERROR except xrefs into the external components the converter rewrites, and the generated appendix the Boot synthesized eras declare as lost (ADR-0004, ADR-0006). Closes #1044
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
This comment has been minimized.
This comment has been minimized.
|
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.



Closes #1044
Summary
convert.ts --strictnow fails when Antora or Asciidoctor logs an ERROR. Until now it gated on the converter's own warnings only, sodata-relational-3.2.9published a page with a literal "Unresolved include directive" and exit 0.The generated playbook already declared
runtime.log.failure_level: error. Nothing applied it: this pipeline drives Antora as a library (ADR-0002), and it is the site generator that configures@antora/logger. Every conversion log started withlogger not configured; creating logger with default settings, whose default failure level issilent.What changes
convert.tsconfigures@antora/loggerfrom the built playbook'sruntime.logbefore aggregating content, so the YAML is the single source of truth.format: prettyis pinned, because Antora'sautoformat switches to JSON whenever stdout is not a TTY.failOnExit. Two kinds of ERROR are exempt from that count. They are still printed, and summarised at the end.externalComponents. For Boot these areapi,gradle-pluginandmaven-plugin. The converter already rewrites these links to docs.spring.io, so no content is lost; Boot 4.1.1 alone logs 805 of them. A versioned id (4.1.1@maven-plugin:…) is not exempt, because the converter doesn't rewrite it.SynthesisSources.acceptedMissinglists the exact include targets and the twoappendix:xrefs, taken from the release logs. An undeclared sibling of a declared file still fails.--strict: the run still exits 0 and prints the count.@antora/logger3.2.0 was a transitive dependency. It is now a direct one, at the same version as the other@antora/*packages.Scan of the 899 catalogued versions
Every version's
release.ymllog was scanned for ERROR lines. All 899 logs were still available.These 15 versions would fail if their tags were re-run. Each is a real upstream defect, and their published archives don't change:
data-relational3.2.9target of include not found: 3.2.9@data-commons::page$value-expressions.adocdata-redis3.2.0–3.2.8, 3.3.0–3.3.2dropping cells from incomplete rowincluster.adocsecurity7.0.7+rebuild.1, 7.1.1+rebuild.1target of xref not found: attachment$api/java/index.htmlVerification
--strict, exit 0. Their output is byte-identical tomarkdown/boot/<version>/, apart fromLICENSE/NOTICE, whichpackage-release.tsadds.data-relational3.2.9 anddata-redis3.2.0 exit 1 locally, with the ERROR counts the scan predicted.data-jpa4.1.1 exits 0, byte-identical tomarkdown/data-jpa/4.1.1/.logger not configuredno longer appears.Tests
tests/integration/pipeline.test.ts:--strictand exits 0 without it;--strictand is rewritten to docs.spring.io;tests/unit/convert.test.ts:externalXrefComponentcovers id forms, versioned ids and non-external components.isAcceptedLosscovers directory prefixes, exact files, siblings, lookalike prefixes and message kinds.tests/unit/upstream-sources.test.ts: both Boot synthesized eras declare their losses; archive, overlay and template eras declare none.tscand lint pass. The full suite passes 531/531.Summary by cubic
convert.ts --strictnow fails when Antora or Asciidoctor logs an ERROR. Previously the playbook'sruntime.log.failure_level: errornever took effect because the pipeline drives Antora as a library and never configured@antora/logger, so a page with an unresolved include was published with exit 0 (#1044).Details
convert.tsconfigures@antora/loggerfrom the built playbook and counts ERROR messages directly instead of relying on Antora'sfailOnExit.--strictthrows, so a failing run still reports both warning and ERROR totals.--strictthe run still exits 0 and prints the count.@antora/loggeris now a direct dependency at the same 3.2.0 version as the other@antora/*packages.Exemptions
api,gradle-plugin,maven-plugin) are exempt only when the converter actually rewrote that reference to docs.spring.io; a versioned id (4.1.1@maven-plugin:...) or a reference emitted verbatim (e.g. inside a[literal]block) still fails.AcceptedMissing; any undeclared missing target still fails.Written for commit a34867c. Summary will update on new commits.