Repository navigation
fix(docplan): warn, not fail, when a markup converter is missing - #1622
Merged
Merged
Conversation
A rep language "asciidoc" body whose converter is not installed made sysml -validate exit 2 over the model, so a host without the doc toolchain could not validate examples/. The document pass now plans documents leniently: a missing converter leaves the bodies unchecked under one document-plan-markup-tool-missing warning per language, naming the converter, whether OPENSYSML_ASCIIDOCTOR named it or PATH was searched, and the remedy; -warnings-as-errors makes it a failure. A converter that is found but fails stays an error, and a rendering, which needs the body, still fails on a missing converter. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…erter A missing or failing converter answers to the host, not the document, so the interface record cache held the verdict of one host for another: a document validated without the converter kept its warning after the converter was installed. Such a document is now unrecordable and is analyzed again wherever it is next opened. Co-Authored-By: jason.han <hanhuijun@gmail.com>
HuiJun
marked this pull request as ready for review
October 28, 2026 04:11
…dies loaded A document plan in another document evaluates a query definition's result expression from its tree and reads a prose body through the host's converter, neither of which an interface record answers: with document.sysml held as its record, the self-model's AsciiDoc note failed to plan OpenSysMLDocument::MarkupLanguages, and a clean record written with the converter installed would have stood on a host without it. The record writer now refuses both, in place of refusing only a document reported on its converter. The missing-converter warning is scoped to the document whose bodies are scanned: a plan reading another document's outline leaves that document's unchecked bodies to its own plan. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…he record writer The record writer in workspace/libs cannot read queryplan: its tests and lower's import libs, which closes an import cycle in test builds. Co-Authored-By: jason.han <hanhuijun@gmail.com>
A converted body on an ordinary part is read by no plan, so its document stays recordable; docplan.ReadsBody says whose bodies are. Comments trimmed to the repository's two lines. Co-Authored-By: jason.han <hanhuijun@gmail.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.
What and why
Since #1562,
examples/self-model/asciidoc/markup.sysmlcarriesrep language "asciidoc"bodies, which the document planner parses through the external Asciidoctor.js converter (OPENSYSML_ASCIIDOCTOR, elseasciidoctor-jsononPATH). On a host without that converter,sysml -validate examplesexited 2:planDiagnosticmade every*docplan.Erroran error, a missing converter included. TheValidate action / From the treejob builds a baresysmland validatesexamples/with no doc toolchain, so it went red on every PR that triggered it.A missing converter is now a validation warning that leaves the bodies unchecked; a converter that is found but fails stays an error; and a rendering, which needs the parsed body, still fails on a missing converter.
docplan.ErrorKind.Severity()is the one place that decides the severity of a planning error kind (markup-tool-missing→ warning, everything else → error).planDiagnostichonours it, and the codes registry derivesdocument-plan's per-member severities from it (Entry.KindSeverities/MemberSeverity), so-explain, the listings and the generated catalogue showdocument-plan-markup-tool-missingas a warning. No language is special-cased: any markup language's missing tool follows the rule.docplan.Validateplans a document leniently: a body whose converter is missing is left unchecked and the rest of the document is still planned and checked (a paragraph whose only text is such a body is not reported as missing its text). One warning per language is reported at the first such body, counting the bodies it covers.docplan.Compile, which every renderer uses, is unchanged and stops at the body.markup.ToolErrornow records whetherOPENSYSML_ASCIIDOCTORnamed the converter or the default was looked up onPATH, and says so; the js/wasip1 variant says truthfully that the host starts no process.Docs (
docs/manual/authoring.md,docs/reference/environment.md, the self-model README) describe the warning, the unchecked bodies,-warnings-as-errorsand the strict rendering; catalogue regenerated; changelog fragment added.A document holding what a document plan in another document reads of it is no longer written to the interface-record cache (
Workspace.plannedElsewhereLocked): a document query definition, whose result expression the plan evaluates from the tree, and a prose body an external converter checks, whose verdict is the host's. Two defects fall out of this:sysml -validate examplesreporteddocument-plan-query-planning … query OpenSysMLDocument::MarkupLanguages has no result expression, because the workspace demotesdocument.sysmlto its record within the run and the record carries no result expression.tests/model TestInterfaceRecordDifferential/examples/self-modelfails the same way on origin/develop withOPENSYSML_ASCIIDOCTORset. The example and the library query are correct; the record was.The missing-converter warning is scoped to the document whose bodies are scanned: a plan that reads another document's outline leaves that document's unchecked bodies to its own plan.
.github/workflows/validate-action.ymland the example model are untouched.Before (origin/develop, no converter)
After
How it was verified
internal/ir/docplan:TestValidateLeavesBodiesOfMissingConverterUnchecked(one warning over three bodies,Severity()warning, the missing-text error after them still found,Compilestill stops at the body withcould not be parsed),TestValidateReportsOneWarningPerBody.internal/ir/docplan/markup: theOPENSYSML_ASCIIDOCTOR names it/not found on PATH (OPENSYSML_ASCIIDOCTOR is unset)wording, the detail and failed forms.internal/check/passes/document:TestDocumentPlanPassWarnsOfMissingMarkupConverterAndGoesOn(a warning with the code at the body, then thedocument-plan-missing-texterror of the next paragraph).internal/check/codes:KindSeveritieswell-formedness;Rows/Explainreportdocument-plan-markup-tool-missingas a warning and…-failedas an error.cmd/sysml:TestValidateWithoutMarkupConverterWarns—-validateoverexamples/self-modelwith the variable unset and an emptyPATHexits 0 with exactly one warning carrying the code and the PATH wording; exits 2 under-warnings-as-errors; SARIF levelwarning;-render-documentexits 2 with the same message.TestValidateWithMarkupConverterChecksBodiesruns with the converter the environment names and wants no warning (skips without one, fails underOPENSYSML_REQUIRE_PDF_TOOLCHAIN).internal/workspace/modelTestExamplesAnalyseCleanlyno longer skips over the unchecked bodies; it logs them, and fails underOPENSYSML_REQUIRE_PDF_TOOLCHAIN.TestInterfaceRecordRefusesExternallyCheckedBodies(converter missing and found) andTestInterfaceRecordRefusesQueryDefinitionspin the record refusals;tests/model TestInterfaceRecordDifferentialpasses over the self-model again.internal/ir/docplanTestValidateWarnsOfItsOwnBodiesOnly: a Report whose Markdown body referencesAppendix::tables.detailwarns of its own AsciiDoc body only; Appendix of its own.examples/(the ignored downloaded corpora excluded) with a fresh record cache:sysml -validate -format sarifexits 0 without the converter (onedocument-plan-markup-tool-missingwarning) and exits 0 with it (no such warning);-format junitrenders the warning as<failure type="warning">, as the JUnit writer renders every warning (pinned byvalidate_report_test) — unchanged here.Gate on head
8ae69c1cd(this VM), then on3553ede81go vet ./...,internal/workspace/model,internal/ir/docplan,tests/model(plain and-race, with and without the converter) re-run green:gofmt -l .empty;go build ./...clean;go vet ./...clean;go test ./...exit 0 (every packageok, no failures);make lint(staticcheck + gosec) ✓ Lint passed;python3 scripts/changelog.py checkclean;make diagnostics-catalogueregenerateddocs/reference/diagnostics.md. With the toolchain installed (./scripts/download-doc-pdf-toolchain.sh,OPENSYSML_ASCIIDOCTOR=build/doc-pdf/asciidoctor/asciidoctor-json.js,OPENSYSML_REQUIRE_PDF_TOOLCHAIN=1):cmd/sysml TestValidateWith(out)MarkupConverter…andinternal/workspace/model TestExamplesAnalyseCleanly/self-model/asciidoc/markup.sysmlpass,sysml -validate -warnings-as-errors examples/self-modelexits 0 with no warning.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/da63d131020142d0aaf4c5ea0aac8fc9
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/da63d131020142d0aaf4c5ea0aac8fc9?variant=devin
Requested by: @HuiJun