Skip to content

build-lectures: an engine input, jb1 or myst #337

In review

Description

@mmcky

From the design note .qe/dev/log/2026-11-16-product-builds-design.md (#335), item 1. QuantEcon/lectures' product builds (QuantEcon/project-monorepo#77) need the engine as a matrix axis from the start: Jupyter Book 1 publishes until the engine switch, and a mystmd leg runs beside it, non-publishing and continue-on-error.

build-lectures runs only jb build, and its checks are Jupyter Book 1's: -n and -W, the warnings log of a jupyter build, and the error outputs read from the execution cache.

Proposed: an engine input, jb1 by default (today's behaviour). With myst, the action runs myst build with the builder's flag (--html, --pdf, --ipynb) from the folder that holds myst.yml, and its chapter says which of the action's checks apply on that engine. The input can ship before every check has a mystmd equivalent, as long as the chapter says which do. One pull request, with the chapter, a harness job, a CHANGELOG entry and a staged release.

🤖 Generated with Claude Code

Activity

  1. mmcky commented on Nov 19, 2026

    @mmcky
    ContributorAuthor

    A note for this issue's scope: #336 added comment-key and toc-file to the three preview actions (#345, merged), and left out the third input it proposed, link-style, by the maintainer's decision. A mystmd site serves a page at a slug made from its file name (mccall_model.md at /mccall-model/), not at the name itself, so a preview's links to a mystmd site's changed pages need their rule built and checked against a real mystmd build. That follows this issue: once build-lectures can build with engine: myst and a site needs mystmd previews, link-style comes as its own change. The decision is recorded in #336's check comment.

    Claude Code (on behalf of mmcky)

  2. mmcky commented on Nov 28, 2026

    @mmcky
    ContributorAuthor

    The engine values, the maintainer's ruling (2026-11-28). The input's values are jb1 and mystmd, not jb1 and myst: the engine is mystmd, and MyST is the markup it reads. Otherwise the proposal stands. engine: mystmd runs mystmd's own CLI, myst build, with the builder's flag, from the folder that holds myst.yml. The flags are --html and --pdf, and --ipynb, which is the QuantEcon/mystmd fork's.

    That is the command QuantEcon's mystmd builds run today. QuantEcon/test-lecture-theme-mystmd's CI builds mystmd from the QuantEcon/mystmd fork at a pinned commit, then runs myst build. Jupyter Book 2 is built on mystmd, but it has its own command line and bundles its own mystmd. It is to be supported later as an engine of its own: that is #361.

    One question for this issue's check before coding: how myst reaches the runner, whether from the caller, the images, or the action from a pin.

    Claude Code (on behalf of mmcky)

  3. mmcky commented on Nov 28, 2026

    @mmcky
    ContributorAuthor

    The check before coding (2026-11-28, against 3b70eda): revise. The shape holds: an engine input on build-lectures, jb1 by default, with mystmd running myst build with the builder's flag from the folder that holds myst.yml. But a myst build with only that flag passes where a jb1 build fails, so the input needs more than the command. I checked with upstream mystmd 1.13.0, the QuantEcon/mystmd fork's base: --html builds of a two-page project, and the CLI's source for the rest.

    Case --html --pdf, --ipynb
    No --execute executes nothing, and cells show no output the same
    A cell that raises exits 0, and 1 only with --strict exits 0, with or without --strict
    A Jupyter server that does not start exits 1 only with --strict exits 0
    An error raised while a result is displayed (#247) exits 0, even with --strict exits 0
    Nothing to build: no site:, or no exports exits 0 exits 0
    A page that fails to render logs Error fetching <url>, exits 0 —
    A LaTeX failure — exits 0
    jb's -W, today's extra-args default exits 1: unknown option '-W' the same

    --ipynb is the fork's: upstream exits 1 with unknown option '--ipynb'. A page that raised is never cached, so a later --html --strict build in the same job runs it again and fails.

    Proposed design. With engine: mystmd, the action runs myst build --html, --pdf or --ipynb (for html, pdflatex and jupyter) with --execute, from source-dir, which must hold myst.yml. An empty extra-args means the engine's own default: -W --keep-going on jb1, --strict on mystmd. After the build it fails the step if no site or export was written, or if a page failed to render. For the myst command alone it sets NODE_OPTIONS=--dns-result-order=ipv4first and, as root, Jupyter's allow_root: QuantEcon/test-lecture-theme-mystmd's CI found a container build needs both. It refuses any other builder, html-copy-pdf and html-copy-notebooks (mystmd links downloads from myst.yml), an output-dir (myst writes _build beside myst.yml), and jb1's flags in extra-args. nitpick and error-outputs are skipped on mystmd, with a line in the log. myst comes from the caller, as jb does: the fork has no release to install from, and the chapter shows its install at a pin. jb1 is unchanged.

    Which checks apply. The chapter gets a table per engine and builder. --strict stands in for -W on html only, and fails on errors only, so only an html build fails on a raising cell; the chapter says to build html in the same job as any export. A follow-up issue, needed before any site publishes from mystmd, covers execution errors on the export builders and error outputs on every builder, perhaps with #330. build-jupyter-cache stays on jb1.

    Tests. build-engine-inputs uses a stub myst to cover each builder's command, the output checks and each refusal. build-mystmd is a real html build with upstream mystmd from npm, in the lean image as root, showing an executed page and a failing cell. Both fail on today's code, which ignores engine and runs jb build. At release, the canary's jb1 builds should show the same "Build Command" as v0.22.0. No mystmd canary for now.

    The maintainer's decisions (2026-11-28), after a fresh review of this check. All seven are as recommended:

    • myst comes from the caller. The action fails early if myst is missing, and logs command -v myst and myst --version.
    • extra-args: an empty value means the engine's own default. jb1's flags are refused on mystmd, and the action always passes --execute.
    • Refused on mystmd: any other builder, html-copy-pdf and html-copy-notebooks, and an output-dir other than .. nitpick and error-outputs are skipped, with a line in the log.
    • What mystmd doesn't catch yet: execution errors in the export builders, and error outputs in every builder, go to build-lectures on mystmd: fail on execution errors in pdflatex and jupyter builds, and on error outputs in every build #364.
    • The two container settings: the action sets them for the myst command, keyed on a mystmd-based engine so that build-lectures: a Jupyter Book 2 engine, after #337 #361 can reuse them. A later issue moves them into the images.
    • No mystmd canary for now.
    • Not ⚠️ BREAKING. The CHANGELOG gets an ### Added entry for the engine and a ### Changed entry for extra-args' default. build-jupyter-cache's comment on that default is corrected in the same pull request.

    Claude Code (on behalf of mmcky)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions