Skip to content

🧪 TEST: demonstrate file-list mode (files) in the example project#15

Merged
ubmarco merged 1 commit into
mainfrom
files-mode-example
Jul 23, 2026
Merged

🧪 TEST: demonstrate file-list mode (files) in the example project#15
ubmarco merged 1 commit into
mainfrom
files-mode-example

Conversation

@ubmarco

@ubmarco ubmarco commented Jul 22, 2026

Copy link
Copy Markdown
Member

What

The tests/example reference project previously demonstrated only directory mode (dir) mounts. This adds a checked-in "release notes" bundle mounted via file-list mode (files), so the example now covers both mount modes side by side.

Changes

  • New bundle tests/example/release-notes/index.rst + notes/{2026-q1,2026-q2,2026-q3-draft}.rst.
  • docs/ubproject.toml — a files = [...] mount at _generated/release-notes, wired via attach_to like the existing mounts.
  • build_docs_sandbox.sh — stages the release-notes/ tree next to docs/ in the temp working tree (mirroring the existing showcase/ staging) so the sandboxed bazel build //:docs_html build resolves the mount. The in-workspace bazel run //:build_docs path needs no change (it runs in the real source tree).
  • test_example.py — asserts the three picked files render at a flat namespace (_generated/release-notes/2026-q1, not .../notes/2026-q1), that the unlisted 2026-q3-draft.rst is never mounted (the behaviour that distinguishes file-list from directory mode), and that attach_to wires the entry doc into the host toctree.
  • README — documents directory-mode vs file-list-mode.

Verification

  • uv run pytest -m bazel tests/test_example.py — passes (Bazel build + sphinx-build -nW).
  • Both README build entry points: bazel build //:docs_html (sandboxed) and bazel run //:build_docs (in-workspace) — both render the release-notes pages, no 2026-q3-draft.html.
  • Full suite: 157 passed.
  • Pinned ruff@0.12.2 format/check clean; prek run --all-files all hooks pass (incl. taplo).

Note: test_example.py copies the whole example (shutil.copytree) and runs sphinx-build directly, so it does not exercise the curated //:docs_html staging — that's why the initial version passed the test but broke the README's Bazel build. Fixed here; a dedicated //:docs_html regression test is a reasonable follow-up (happy to add if you want it).

Deliberately skipped (flagging for review)

  • Changelog — example/test-only, and files mode already shipped in 0.1.0, so there's no user-facing behavior change. Mirrors PR ✨ NEW: reference a pre-built HTML report from a mounted bundle (html_extra_path) #6 (the html_extra_path example), which also added no changelog entry. Happy to add one under a new unreleased section if you'd prefer.
  • docs/source/ — file-list mode is already fully documented in configuration.rst; nothing behavioural changed.

The tests/example project only exercised directory mode (``dir``); add a
checked-in "release notes" bundle mounted via file-list mode (``files``)
so the example covers both mount modes side by side.

- New tests/example/release-notes/ bundle: index.rst + notes/{2026-q1,
  2026-q2, 2026-q3-draft}.rst.
- docs/ubproject.toml gains a ``files = [...]`` mount at
  _generated/release-notes, wired via attach_to like the other bundles.
  The draft note is intentionally left out of the list.
- build_docs_sandbox.sh stages the release-notes/ tree next to docs/ in
  the temp working tree (mirroring the showcase/ staging), so the
  sandboxed ``bazel build //:docs_html`` build resolves the mount. The
  in-workspace ``bazel run //:build_docs`` path needs no change.
- test_example.py asserts the picked files render at a FLAT namespace
  (the notes/ subdir is dropped from the docname), the unlisted draft is
  never mounted, and attach_to wires the entry doc into the host toctree.
- README documents the directory-mode vs file-list-mode distinction.
@ubmarco
ubmarco force-pushed the files-mode-example branch from cf856ac to 0548af3 Compare July 23, 2026 17:29
@ubmarco
ubmarco marked this pull request as ready for review July 23, 2026 20:33
@ubmarco
ubmarco merged commit d4782bc into main Jul 23, 2026
12 checks passed
@ubmarco
ubmarco deleted the files-mode-example branch July 23, 2026 20:33
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.

1 participant