Skip to content

Add documentation validation#119

Open
MylesJP wants to merge 4 commits intocanonical:mainfrom
MylesJP:docs-validation
Open

Add documentation validation#119
MylesJP wants to merge 4 commits intocanonical:mainfrom
MylesJP:docs-validation

Conversation

@MylesJP
Copy link
Copy Markdown
Contributor

@MylesJP MylesJP commented Oct 15, 2025

This commit introduces documentation validation system that ensures our published CLI examples remain executable and up to date with the product available to users. Note this initial PR is set to dry run only. See the Follow Up section below for a description of future work.

Summary of Changes:

  • ci/select-doc-pages.py: builds an ordered execution plan from changed snippet files and their declared dependencies (# @Depends:).
  • ci/run-doc-pages.py: extracts and runs (or dry-runs) [docs-exec:*] blocks from snippet files in sequential order.
  • [docs-view:*] blocks: used for display in documentation via literalinclude, ensuring examples in the docs match what CI validates.
  • Unit tests for both selector and runner using pytest.
  • Updated GitHub Actions workflow for automatic snippet validation.
  • Added ci/README.md explaining the framework, usage, and conventions.

Follow-up:

  • Turn off DOCS_DRY_RUN to enable CI execution of documentation snippets. This is recommended as a subsequent PR to limit the testing footprint of snippet files and ease troubleshooting any issues.

This commit introduces documentation validation system that ensures
our published CLI examples remain executable and up to date.

Summary of Changes:
- `ci/select-doc-pages.py`: builds an ordered execution plan from changed
  snippet files and their declared dependencies (`# @Depends:`).
- `ci/run-doc-pages.py`: extracts and runs (or dry-runs) `[docs-exec:*]`
  blocks from snippet files in sequential order.
- `[docs-view:*]` blocks: used for display in documentation via
  `literalinclude`, ensuring examples in the docs match what CI validates.
- Unit tests for both selector and runner using pytest.
- Updated GitHub Actions workflow for automatic snippet validation.
- Added `ci/README.md` explaining the framework, usage, and conventions.
@MylesJP MylesJP marked this pull request as ready for review October 20, 2025 17:01
Comment thread .github/workflows/docs-validation-unit-tests.yml Outdated
Comment thread .github/workflows/docs-validation-unit-tests.yml Outdated
Comment thread .github/workflows/docs-validation.yml Outdated
Comment thread .github/workflows/docs-validation.yml Outdated

defaults:
run:
shell: bash
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, you can achieve the same with something like this:

- name: Foo
  run: |
    #!/bin/bash
    for FOO in $(ls *.txt); do
    ...

note: I won't block the PR on this, it's more a personal preference that allows to keep the interpreter that will be used and the code together

Comment thread ci/README.md
Comment thread ci/README.md Outdated
Comment thread ci/run-doc-pages.py Outdated
Comment thread ci/run-doc-pages.py Outdated
Comment thread ci/run-doc-pages.py Outdated
@MylesJP MylesJP force-pushed the docs-validation branch 2 times, most recently from 175bb07 to f414cd7 Compare October 22, 2025 22:20
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