Skip to content

Commit ca778c6

Browse files
Darshan M Uclaude
andcommitted
Throwaway: check the 2.1.2 PythonMonkey probe on CI runners
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXRqenV27WmHS3PtveCubG
1 parent aaeac68 commit ca778c6

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

‎.github/workflows/probe-check.yml‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Throwaway: check the 2.1.2 PythonMonkey probe on real runners. A crash or a wrong
2+
# parser choice turns the job red.
3+
name: Probe check
4+
5+
on:
6+
push:
7+
branches: [probe-check-2.1.2]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
check:
14+
name: ${{ matrix.os }} / py${{ matrix.python }} (expect ${{ matrix.expect }})
15+
runs-on: ${{ matrix.os }}
16+
timeout-minutes: 30
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-latest, macos-15-intel]
21+
python: ["3.14.3", "3.14"]
22+
include:
23+
- python: "3.14.3"
24+
expect: node
25+
- python: "3.14"
26+
expect: pythonmonkey
27+
steps:
28+
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
29+
with:
30+
persist-credentials: false
31+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
32+
with:
33+
python-version: ${{ matrix.python }}
34+
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
35+
with:
36+
node-version: "24"
37+
- name: Install CodeWiki from this branch
38+
run: python -m pip install --only-binary pythonmonkey .
39+
- name: Validate Mermaid as CodeWiki does
40+
run: python scripts/check_mermaid_fallback.py ${{ matrix.expect }}

‎scripts/check_mermaid_fallback.py‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""CI check for the 2.1.2 PythonMonkey probe: run CodeWiki's real Mermaid validation.
2+
3+
Usage: python scripts/check_mermaid_fallback.py node|pythonmonkey
4+
On Python 3.14.0-3.14.3 PythonMonkey crashes the process (PythonMonkey #515); the
5+
probe must catch that in a child and validate with Node instead. Elsewhere
6+
PythonMonkey must still be used. Either way both diagrams must really be checked.
7+
"""
8+
9+
import asyncio
10+
import logging
11+
import platform
12+
import sys
13+
14+
from codewiki.src.be import utils
15+
16+
logging.basicConfig(level=logging.WARNING, format="%(levelname)s %(message)s")
17+
expected = sys.argv[1]
18+
doc = (
19+
"```mermaid\nflowchart TD\n A[Start] --> B[End]\n```\n\n"
20+
"```mermaid\nflowchart TD\n A[Start] --> --> B(\n```\n"
21+
)
22+
report = asyncio.run(utils.validate_mermaid_content(doc))
23+
used = "node" if utils._PYTHONMONKEY_BROKEN else "pythonmonkey"
24+
print(f"Python {platform.python_version()}: parser={used}, diagrams={report.diagrams}, "
25+
f"errors={len(report.errors)}, unavailable={report.unavailable}")
26+
assert used == expected, f"expected {expected}, used {used}"
27+
assert report.diagrams == 2 and len(report.errors) == 1 and not report.unavailable, report
28+
print("OK")

0 commit comments

Comments
 (0)