Skip to content

Feat/1759 doc codeblocks ci#1884

Open
bogwi wants to merge 17 commits intodimensionalOS:devfrom
bogwi:feat/1759-doc-codeblocks-ci
Open

Feat/1759 doc codeblocks ci#1884
bogwi wants to merge 17 commits intodimensionalOS:devfrom
bogwi:feat/1759-doc-codeblocks-ci

Conversation

@bogwi
Copy link
Copy Markdown
Collaborator

@bogwi bogwi commented Apr 20, 2026

Problem

Hi, everyone.

This closes Execute documentation codeblocks in CI #1759 opened by @leshy .

Solution

Two strategies. First introduced the mechanism, workflow and a script. The second - improves present doc codeblocks for: missing imports, modules resolution, some blocks are wrapped to be run-able, those that did not mean to be run are skipped like illustrative one-liners or very heavy blocks, etc. This workflow is disabled for macos. This is a version 1 of the #1759 solution.

Breaking Changes

None

Contributor License Agreement

  • I have read and approved the CLA.

@greptile-apps

This comment was marked as spam.

Comment thread .github/workflows/doc-codeblocks.yml
Comment thread .github/workflows/doc-codeblocks.yml Outdated
Comment thread bin/run-doc-codeblocks
Comment thread bin/run-doc-codeblocks Outdated
@bogwi
Copy link
Copy Markdown
Collaborator Author

bogwi commented Apr 21, 2026

The last commit, 3be2ad5, addresses two previous minor ci run failures:
(a) trailing-whitespace, and
(b) astral's new "No more major and minor tags" policy from 8.0.0, use only immutable tags as versions.

The full ci should be green now and is safe to re-run.

If @paul-nechifor insists on "if" change - please say a word.

@leshy
Copy link
Copy Markdown
Contributor

leshy commented Apr 21, 2026

https://github.com/dimensionalOS/dimos/actions/runs/24695981801/job/72277385519?pr=1884

didn't investigate in detail, approved workflow run, currently fails in some weird way, is this related to it being an external PR?

@bogwi
Copy link
Copy Markdown
Collaborator Author

bogwi commented Apr 21, 2026

Tracing this: https://github.com/dimensionalOS/dimos/actions/runs/24711607201/job/72278865724?pr=1884.

What is actually failing

The job name is md-babel but the failure happens before ./bin/run-doc-codeblocks even runs. It fails on:

uv sync --extra dev --frozen --no-extra dds

That installs the project in editable mode which runs setuptools -> build_ext for the pybind11 extensions in setup.py. Pybind11’s auto_cpp_level() compiles a tiny probe (flagcheck.cpp) with c++ and -std=c++17 / 14 / 11. When all of those probes fail it gets:

RuntimeError: Unsupported compiler -- at least C++11 support is needed!

So this looks as a native C++ build environment problem on the runner not md-babel or markdown execution at all.

Two plausible ways to fix it:

  1. use an environment known to compile dimos (as in ci.yml), or
  2. to fix c++ / build tools on the self-hosted host.

The above last commit uses the same ci as in ci.yml. Also updated some docs to have no manipulation imports in CI.

@bogwi
Copy link
Copy Markdown
Collaborator Author

bogwi commented Apr 21, 2026

Updated workflow compiles dimos OK.

New commit addresses these that erred:
a) Marked the YOLO snippet as ```python skip.

b) Marked all replay and asset-dependent session=qb blocks in both quality_filter.md files as skip session=qb (left the two synthetic rx / quality_barrier examples runnable).

c) Marked all session=align Python blocks in both temporal_alignment.md files as skip session=align (embedded stays as documentation).

@bogwi bogwi force-pushed the feat/1759-doc-codeblocks-ci branch from cd334bf to addb6c9 Compare April 24, 2026 12:44
Comment thread .github/workflows/doc-codeblocks.yml
@bogwi
Copy link
Copy Markdown
Collaborator Author

bogwi commented Apr 24, 2026

md-babel-py is 1.1.4 now, supports --execution-timeout flag which I authored exactly for the purpose: https://github.com/leshy/md-babel-py/releases/tag/v1.1.4. Giving the recent > 60s (md-babe-py default) runs, timeout was increased to 120s. Done in 0707499

On the local machine, the current state of the docs fluctuates between 8 and 33 seconds, and not every block runs. The Golden Rule in codeblocks.md, as stated now, is: "All code blocks must be executable. Never write illustrative/pseudo code blocks. If you're showing an API usage pattern, create a minimal working example that actually runs. This ensures the documentation stays correct as the codebase evolves." However, this might not be possible to achieve.

Update in: 30a12a3

Greptile might flag this as Arbitrary code execution from fork PRs on self-hosted runner: github.event_name != 'pull_request' || github.event.pull_request.draft == false. To silence the bot - 0707499 was created, but it will not run on forks. @leshy, this needs your clarification as per #1759.

@bogwi bogwi force-pushed the feat/1759-doc-codeblocks-ci branch from d4bb976 to 1655268 Compare May 3, 2026 10:07
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 3, 2026

Want your agent to iterate on Greptile's feedback? Try greploops.

@bogwi bogwi marked this pull request as draft May 3, 2026 17:14
@bogwi bogwi marked this pull request as ready for review May 4, 2026 07:22
@leshy leshy added the PlzReview label May 5, 2026
Comment thread bin/run-doc-codeblocks
Comment thread .github/workflows/doc-codeblocks.yml
Comment thread docs/usage/transports/index.md Outdated
Comment thread docs/agents/style.md
Comment thread docs/agents/testing.md Outdated
Comment thread .github/workflows/doc-codeblocks.yml
Comment thread docs/usage/transports/index.md Outdated
Comment thread docs/agents/testing.md Outdated
- name: Install Python dependencies
run: |
uv sync --all-extras --no-extra dds --no-extra unitree-dds --frozen
uv pip install matplotlib httpx
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's create an issue to figure out why this is missing from our dev image

- name: Install TurboJPEG and pull Git LFS for doc examples
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y git-lfs libturbojpeg
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's create an issue to figure out why this is missing from our dev image

bogwi added 7 commits May 7, 2026 17:34
The runner is a no-op on Darwin so local work does not require Linux/GPU deps; set RUN_DOC_CODEBLOCKS_FORCE=1 or call md-babel-py directly to run on a Mac. Documented in the script --help.

Also: doc-codeblocks workflow sync excludes unitree-dds; fix modules and python-api examples for md-babel (session/skip and runnable fragments).
@bogwi bogwi force-pushed the feat/1759-doc-codeblocks-ci branch from 1f28685 to 8db0e17 Compare May 7, 2026 08:39
@codecov
Copy link
Copy Markdown

codecov Bot commented May 7, 2026

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants