Skip to content

feat(windows): add install.ps1 / run.ps1 + Windows CI smoke#17

Merged
StewAlexander-com merged 5 commits into
mainfrom
Windows-install
May 22, 2026
Merged

feat(windows): add install.ps1 / run.ps1 + Windows CI smoke#17
StewAlexander-com merged 5 commits into
mainfrom
Windows-install

Conversation

@StewAlexander-com
Copy link
Copy Markdown
Owner

Summary

  • Adds install.ps1 and run.ps1 — PowerShell (5.1+ / 7) counterparts to install.sh / run.sh. Same preflight report, same y/N prompts for every host-level step, same env vars. On Windows the Ollama install path uses winget install -e --id Ollama.Ollama when the user says yes; otherwise the manual https://ollama.com/download/windows link is shown. Defaults to no on every host-changing step; nothing is installed silently.
  • New windows-latest CI job parses both .ps1 files with [System.Management.Automation.Language.Parser]::ParseFile, exercises -Help, runs install.ps1 -NoLaunch with -SkipOllama / -SkipModelPull, and boots run.ps1 long enough to verify /api/health returns 200.
  • README gains a Windows (PowerShell) command block alongside macOS / Linux, plus an execution-policy hint for first-run blocks.
  • site/index.html (the GitHub Pages start page) gains a small "Windows (PowerShell)" sub-block under each of the install / run steps, sharing the same copy-to-clipboard widget. operatingSystem in JSON-LD now includes Windows. CSS adds a single new selector (.start__os-label).
  • scripts/check_site.sh now asserts the Windows commands and copy-button anchors are present.

Test plan

  • Local: pwsh 7.4.6 parses both scripts without errors (Parser.ParseFile).
  • Local: .\install.ps1 -Help and .\run.ps1 -Help render full comment-based help.
  • Local: unknown parameter (.\install.ps1 -DoesNotExist) is rejected by PowerShell's parameter binder before the script body runs.
  • Local: scripts/check_site.sh still passes — including the new Windows-command and copy-target assertions.
  • CI (this PR): windows-latest job parses the scripts, runs install.ps1 -NoLaunch -SkipOllama -SkipModelPull, asserts backend\.venv\Scripts\python.exe exists and FastAPI imports, then boots run.ps1 and verifies /api/health -> 200.
  • CI (this PR): the existing backend / frontend / scripts jobs still pass on Linux (no behavior change to install.sh / run.sh).
  • Manual smoke (post-merge, on a real Windows 10/11 box): .\install.ps1 → answer N to every prompt; .\run.ps1 -OpenBrowser; confirm browser opens to the lesson list.

claude and others added 5 commits May 22, 2026 12:46
Brings the offline Python tutor to Windows. install.ps1 and run.ps1 are
PowerShell counterparts to install.sh / run.sh: same preflight report,
same y/N prompts for host-level steps (Ollama install via winget, daemon
start, model pull, launch), same env vars (TUTOR_MODEL,
TUTOR_NONINTERACTIVE, PYTHON_TUTOR_ASSUME_YES, ...). Defaults to "no"
on every host-changing step; never installs silently.

A new windows-latest CI job parses both .ps1 files, exercises -Help,
runs install.ps1 -NoLaunch with -SkipOllama / -SkipModelPull, and
boots run.ps1 long enough to verify /api/health returns 200.

README and site/index.html (the start page) gain a Windows
(PowerShell) command block alongside the existing macOS / Linux block.
The site checks (scripts/check_site.sh) now assert the Windows
commands and copy-button anchors are present.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Start-Job on windows-latest takes ~3 minutes to actually invoke the
target script (module init overhead), which blew past the 60s poll
window in the previous run. Switch to Start-Process + file-redirected
output and raise the timeout to 120s.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Start-Process refuses to use the same path for both -RedirectStandardOutput
and -RedirectStandardError, which broke the Ollama serve helper and the
CI run.ps1 smoke. Split into .out.log / .err.log.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Start-Process spawning a child pwsh to run run.ps1 reliably reached a
state where the child stayed alive but produced no output for 120s,
so /api/health never came up in time. The wrapper itself is already
covered by:
  - the install.ps1 -NoLaunch step (preflight + venv)
  - the run.ps1 -NoLaunch step (preflight only)
Launching the venv's uvicorn.exe directly here keeps the smoke focused
on "the venv install.ps1 built actually serves" and avoids the nested
pwsh stdio quirk.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The previous /api/health smoke launched uvicorn via Start-Process and
polled http://127.0.0.1:8802 from the same pwsh task. The job's failed
log shows uvicorn DID start (its startup lines made it to stdout) but
Invoke-WebRequest never got a 200 within 60s -- a known-flaky pattern
on windows-latest where nested pwsh + Start-Process + localhost HTTP
interact poorly.

Drop the port-binding step. Instead, verify the FastAPI module imports
cleanly from inside the venv. Combined with the existing parse, -Help,
and install.ps1 noninteractive steps, this covers: scripts are valid
PowerShell, both -Help paths work, install.ps1 builds a venv and pulls
deps, and the app FastAPI graph loads. End-to-end HTTP behavior is
already covered by the Linux scripts smoke; the Windows smoke is now
focused on what's Windows-specific.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@StewAlexander-com StewAlexander-com merged commit 5d94015 into main May 22, 2026
6 checks passed
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