Skip to content

Add Pandoc update tooling: --skip-archive and smoke-test override - #15291

Merged
cderv merged 11 commits into
mainfrom
chore/pandoc-update-tooling
Nov 5, 2026
Merged

cderv merged 11 commits into
mainfrom
chore/pandoc-update-tooling

Conversation

@cderv

@cderv cderv commented Nov 4, 2026

Copy link
Copy Markdown
Member

Salvages the tooling and docs half of #14728, which prepared a Pandoc 3.10.1 bump that is now superseded by the upcoming 3.13 update. Its template resyncs and version bump are dropped, as 3.13 regenerates those files. The rest is useful for any Pandoc update and was never on main, since #14723 (the earlier merge of the same branch) was reverted.

Updating Pandoc needs S3 credentials for the archival step, and until now everything else depended on it: the template and format-extension.ts regeneration ran only as part of the archival command, and CI could smoke-test a new Pandoc only after the binary was archived. Most of the update work can now happen before archival, by anyone.

Changes

quarto-bld update-pandoc <version> --skip-archive regenerates the Pandoc reference templates and src/core/pandoc/format-extension.ts from the binary QUARTO_PANDOC points at, without archiving or touching configuration. It fails when QUARTO_PANDOC is unset or reports another version, because the tool lookup silently falls back to the bundled Pandoc and would regenerate format-extension.ts from the old one.

test-smokes.yml gets a pandoc-override-version dispatch input. A new composite action installs that Pandoc release from GitHub and sets QUARTO_PANDOC for the run.

dev-docs/update-pandoc-checklist.md splits the update into a prep phase and an archival phase, and lists for each format which files are Quarto's wired templates and which are verbatim copies of Pandoc's that no code reads (latex.common vs common.latex, html.styles vs styles.html, ...). The names differ only by segment order and the llm-docs described some reference copies as rendered, so fixes landed in the wrong file. The llm-docs and path-scoped rules get the same correction.

Test plan

  • QUARTO_PANDOC=/path/to/pandoc-3.13 ./package/src/quarto-bld update-pandoc 3.13 --skip-archive on main regenerates exactly the six reference copies changed by the 3.13 update commit, byte-identical, and no format-extension.ts change
  • Same command with version 3.12, and with QUARTO_PANDOC unset, fails with an error
  • Dispatch test-smokes.yml with pandoc-override-version: 3.13 and confirm the run reports Pandoc 3.13

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR

Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.

cderv added 3 commits November 4, 2026 15:05
Regenerating the Pandoc reference templates and format-extension.ts
needed the full update-pandoc run, which archives the binary to S3
first. Anyone without S3 credentials could not prepare or check a
Pandoc bump, so the template diff was always reviewed late, by
whoever did the archival.

With --skip-archive the command only regenerates templates and
format-extension.ts, from the binary QUARTO_PANDOC points at, and
leaves configuration untouched. QUARTO_PANDOC is required and its
reported version must match the requested one: pandocBinaryPath()
falls back to the bundled Pandoc when the override is missing or
invalid, and format-extension.ts would then be silently regenerated
from the old version.
A Pandoc bump could only be smoke-tested in CI once the new binary
was archived to S3 and configuration pointed at it. The new
pandoc-override-version dispatch input installs that release from
GitHub and points quarto at it through QUARTO_PANDOC for the run
only, so rendering changes can be checked before archival.

The steps live in a composite action, placed after quarto is
installed so the final `quarto pandoc --version` check works in
every quarto-install mode. README indexes list the composite
actions in both action directories.
Each format's pandoc/ directory holds both Quarto's real templates
(template.tex, common.latex, styles.html, ...) and verbatim copies
of Pandoc's own (latex.common, html.styles, typst.template, ...)
that no code reads. Their names differ only by segment order, and
the docs described some reference copies as if they were rendered.
Template fixes have landed in the reference copy instead of the
wired file because of this.

The checklist now splits the update into a prep phase anyone can do
(--skip-archive, the smoke-test override) and an archival phase for
the S3 credential holder, and lists the wired and reference files
per format. The llm-docs and path-scoped rules get the same
correction, and a rule points configuration bumps to the
dependency docs.
@posit-snyk-bot

posit-snyk-bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

cderv added 8 commits November 4, 2026 15:52
… override)

The new Deno.env.get("QUARTO_PANDOC") in package/src/common/update-pandoc.ts
raises the package/src count from 240 to 241. src/deno_ral has no env
accessor yet, and package/src already reads QUARTO_PANDOC the same way in
update-html-dependencies.ts, so there is nothing to migrate in this PR.
Bump the baseline so the runtime-boundary check accepts the count.
Describe the required Pandoc override and the next action directly. Keep the full update procedure in the checklist so command output stays concise.
Keep reference-copy maintenance in the update checklist and point related architecture notes to it. Split the Typst writer example into shorter explanations and scope the bundled-version statement to the configured version.
A test-smokes.yml dispatch with pandoc-override-version intentionally runs
the suite against a Pandoc newer than the bundled one, while check.ts's
strict constraint still names the archived version (Phase 1 keeps it
unchanged on purpose). check-versions-no-mismatch.test.ts then failed on
the expected "does not strictly match" note, turning a successful
full-suite override run red.

The pandoc-override action now exports the requested version as
QUARTO_TEST_EXPECTED_PANDOC (alongside QUARTO_PANDOC). The test requires
the Pandoc note to name exactly that version when set - proving the
override binary is live - and keeps the no-mismatch assertion for Dart
Sass, Deno, Typst, and for Pandoc on normal runs.

Also cover macOS in the action: the QUARTO_PANDOC export steps were
Linux/Windows-only, so an override dispatch with a macOS runner would
silently test the bundled Pandoc there while the version test (and any
rendering assertion) assumed the override.
Follow-up to f8a0a9d addressing its re-review:

- Dispatching with pandoc-override-version equal to the current release
  (e.g. 3.10) is a valid run - a plumbing check or a tag typed without
  the patch component - but check versions reports "Pandoc version
  3.10.0: OK" there, not a mismatch note, and requiring the note failed
  the run. The assertion now accepts either line, as long as it names
  exactly the requested version; a wrong binary still fails.
- The test's new Deno.env.get raises tests.denoCalls from 774 to 775
  (counted with the checker's own regex: 0 before, 1 after); accept the
  increase in the baseline, same as 5f0fc58 did for package/src.
Describe both accepted override outcomes and the normalized version comparison so the test comments match its assertions. Make the regeneration review instructions explicit and keep the template documentation focused on lasting guidance.
Keep the dependency rule focused on the detailed checklists and shorten the override descriptions. Remove the test comment that repeats the override contract above.
Keep the localization example next to its introduction and shorten the writer explanation. Remove a comment that repeats the adjacent version verifier.
@cderv
cderv merged commit cdc637f into main Nov 5, 2026
52 checks passed
@cderv
cderv deleted the chore/pandoc-update-tooling branch November 5, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants