Skip to content

CI on the self-hosted Windows runners

ci.yml runs the full quality gate (build with 0 warnings, NUnit, Stryker on all lanes, Vitest + StrykerJS + e2e, Semgrep, gitleaks, dependency audit, ZAP DAST, cdktn synth + checkov/tfsec + invariants, quality matrix, ReleaseAudit via ValidateQualityTools.ps1) on the home fleet instead of GitHub-hosted runners. Every step is shell: pwsh; the bash pass-11 scripts are ported 1:1 to .github/workflows/*.ps1 (the .sh originals are still linted by the build job's shellcheck step).

Runner map

Live runners as of 2026-11-13 (org andrewjonesdev-tools, verified via the runners API during the proof run):

Runner Labels Jobs that land here Why
DESKTOP-SCDT9HI-org-1 (streaming) self-hosted, Windows, X64, home-ci, docker, streaming, bigram build, sast, gitleaks, dast, iac-scan, deps has docker AND a live daemon; all container steps pinned here (see below)
DESKTOP-SCDT9HI-org-3 (streaming) self-hosted, Windows, X64, home-ci, streaming, bigram deps no docker, so container jobs cannot land here
DESKTOP-D249KD4-org-1 (gaming) self-hosted, Windows, X64, home-ci, docker, gaming test, build-verify, dast-verify, iac, migration, mutation, web, deps only runner with both docker and gaming; its Docker daemon was DOWN on demo night (npipe missing), so container steps avoid it until revived
DESKTOP-D249KD4-org-2 (gaming) self-hosted, Windows, X64, home-ci, gaming build-verify, dast-verify, iac, migration, mutation, web, deps gaming but no docker
ANDREWBEDROOMTV self-hosted, Windows, X64, home-ci, ANDREWBEDROOMTV none while offline currently offline

Not matched by any job (no home-ci label): ANDYGREATROOMPC (self-hosted, Windows, X64, ANDYGREATROOMPC) and greatroom-tools (self-hosted, Windows, X64, greatroom), both online but outside this workflow's label sets.

Job label classes (each overridable, see below):

Class Labels Jobs
default self-hosted, Windows, home-ci deps
docker + docker, streaming build (compile+lint), sast (Semgrep), gitleaks, dast scan (ZAP), iac-scan (tfsec)
gaming + gaming build-verify, dast-verify, iac synth, migration, mutation, web
dotnet + docker, gaming test (HAPI/Aspire + Metabase surface, heavy .NET)

Why test and mutation ride gaming

Two reasons, both from the night of 2026-11-13:

  1. The streaming PC (DESKTOP-SCDT9HI) is busy with build workers; the gaming PC (DESKTOP-D249KD4) is idle. The .NET test job (30 min) and the mutation matrix (up to 360 min for core) are the longest jobs, so they go where there is headroom.
  2. Windows Application Control on the streaming PC blocks some freshly built DLLs. Test and mutation execute far more fresh test-host DLLs than any other job, so they are routed to the gaming runners where those DLLs are proven to run.

migration rides gaming too: it runs dotnet test plus two dotnet run passes, the same fresh-DLL profile as test. web joined gaming after proof: streaming's Application Control also blocks the downloaded Chromium binary (browserType.launch: spawn UNKNOWN), while gaming runs it.

No single runner does containers AND fresh DLLs on demo night (gaming's daemon is down; streaming blocks DLLs with 0x800711C7), so the three jobs needing both are split: build/dast/iac-scan run the container halves on streaming, while build-verify/dast-verify/iac run the execution halves on gaming with artifact handoff (dast-zap, iac-stacks). Every check is unchanged; only the scheduling moved. If either machine is fixed (start Docker Desktop on gaming, or allowlist the runner work dir in streaming's Application Control), the splits can come back out.

Label vars

Each class resolves through vars so the fleet can be re-pointed without editing the workflow. Precedence is specific var, then RUNNER_LABELS, then the built-in default:

Var Used by Default
RUNNER_LABELS web, deps (and every class as fallback) ["self-hosted","Windows","home-ci"]
DOCKER_RUNNER_LABELS build, sast, gitleaks, dast, iac ["self-hosted","Windows","home-ci","docker","streaming"]
GAMING_RUNNER_LABELS migration, mutation ["self-hosted","Windows","home-ci","gaming"]
DOTNET_RUNNER_LABELS test ["self-hosted","Windows","home-ci","docker","gaming"]

Porting notes (bash to pwsh)

  • Every job sets git config --global core.autocrlf false before checkout, so Windows checkouts are byte-identical to the old Ubuntu ones and the CRLF-sensitive contract hash holds. (.gitattributes already pins the fixtures to LF; this covers everything else.)
  • All native commands run through Invoke-Native in .github/workflows/Invoke-Native.ps1: under $ErrorActionPreference = 'Stop', any native stderr output throws NativeCommandError (verified on PS 5.1), so the wrapper scopes the preference to Continue and every call site checks $LASTEXITCODE, mirroring set -euo pipefail. Every .ps1 invocation (ours and repo-owned) goes through Invoke-Script, a nested -File call: only the exit code decides, so a trailing non-zero $LASTEXITCODE from an expected-failure probe inside a passing script cannot leak and fail the step (this bit ValidateQualityTools.ps1, whose last canary exits 2 by design).
  • The step shell is powershell (5.1), which exists on every Windows runner; pwsh 7 does not (the streaming runner lacks it). Scripts run nested via Invoke-Script, which prefers pwsh 7: repo-owned test scripts need PS 7 features, so jobs that run scripts first execute Ensure-Pwsh7.ps1, a no-op where pwsh exists and a pinned, hash-verified portable bootstrap (7.7.0) where it does not. Our own scripts stay 5.1-compatible (no ternary, ??, ?., &&).
  • Docker bind mounts convert C:\... to /c/... for the Linux containers. The gitleaks --user "$(id -u):$(id -g)" flag is dropped (no id on Windows; root-owned files are harmless on Windows bind mounts), as is the DAST chmod (bind mounts are already writable).
  • jq is replaced by ConvertFrom-Json with strict predicates (case- sensitive -ceq, -is [bool], numeric type checks) matching jq semantics.
  • npx playwright install --with-deps drops --with-deps on Windows (apt-only). The old graphviz install step is gone: likec4@1.60.0 lays out via @hpcc-js/wasm-graphviz, so no system dot is needed.
  • The viewer port is configurable via VIEWER_PORT (default 4010) in ehr-track/viewer/serve.mjs, its Playwright config, and its spec; the web job sets VIEWER_PORT: '4011' because a foreign process holds 127.0.0.1:4010 on the gaming PC (do not kill it). A pre-step kills stale node serve.mjs listeners from prior runs (port + process match only) and sets NO_PROXY for localhost; a failure-only step dumps the port state for diagnosis. Both steps read the same VIEWER_PORT.
  • The web e2e preview server (vite on 127.0.0.1:4175, reuseExistingServer: false) gets the same treatment: a pre-step kills stale node + vite holders of 4175 and warns on anything foreign.
  • Guard helper functions discard Tee-Object passthrough ($null = ...): uncaptured output joins the return value and makes every if (helper) truthy, which silently passed vulnerable fixtures.
  • The DAST readiness probe travels as a .mjs file mounted into the probe container instead of node -e; the assertions are byte-identical.

The final Innovare copy

The interview copy lives in the private repo andrewjonesdev/fhir-pipeline-demo, a different owner than this repo's andrewjonesdev-tools, and org runners do not cross that boundary. Two options, no workflow edit needed either way:

  1. Register runners at repo level: on each CI PC, install another runner agent pointed at andrewjonesdev/fhir-pipeline-demo (or its org) with the same labels (home-ci, plus docker / gaming / streaming / bigram as the machine warrants). The label expressions above then resolve unchanged.
  2. Fall back to GitHub-hosted runners: set the repo variable vars.RUNNER_LABELS to '["ubuntu-24.04"]'. Every job's expression falls through to it, so all jobs land on ubuntu-24.04. The scripts carry OS branches for this path (sh mock shims, apt graphviz, --with-deps); it is implemented but was not run on the demo night.

Proof run

Latest proof run on wt/WT-dc65/ci-main (2026-11-13 ~08:25 CT, tip e9793d8): https://github.com/andrewjonesdev-tools/fhir-pipeline-demo/actions/runs/43440159208

Runner names come from actions/runs/<id>/jobs (gh run view --json jobs omits them):

Job Runner Conclusion
build DESKTOP-SCDT9HI-org-1 success
build-verify DESKTOP-D249KD4-org-2 success
test DESKTOP-D249KD4-org-1 success
migration DESKTOP-D249KD4-org-2 success
web DESKTOP-D249KD4-org-1 failure (forge-studio ERESOLVE; PRODUCT, see NOT DONE)
mutation (12 lanes) — skipped (needs web)
sast — skipped
deps — skipped
gitleaks — skipped
dast — skipped
dast-verify — skipped
iac — skipped
iac-scan — skipped

Every executed job landed on a self-hosted runner; no GitHub-hosted run occurred on any branch during the session (polled every ~150 s).

Runs on wt/WT-dc65/ci-main today (each workflow-side failure fixed, then re-run):

Run Outcome Fix landed
43436892152 migration failed: DRY_RUN report (product now requires --apply); web failed: forge ERESOLVE --apply added to both migrate invocations
43438729103 migration success; web failed: http://127.0.0.1:4175 is already used on DESKTOP-D249KD4-org-2 stale vite-preview cleanup pre-step in web job
43440159208 build/build-verify/test/migration success; web failed only at forge ERESOLVE — (product blocker)

Earlier runs on the night branch (each failure fixed in the workflow, then re-run):

Run Outcome Fix landed
43387883836 build failed: setup-dotnet cannot write Program Files (runner user is not admin) SDK/tool installs redirected to per-job temp
43388170688 failed with zero jobs: runner context is illegal in job-level env install dirs set via a GITHUB_ENV step instead
43388358462 build failed: ValidateQualityTools.ps1 passes but its last canary exits 2, leaking $LASTEXITCODE through in-process & all script calls go through nested -File (Invoke-Script)
43389118828 build failed: pwsh: command not found on DESKTOP-SCDT9HI-org-1 step shell powershell (5.1) + pinned hash-verified pwsh 7.7.0 bootstrap
43389474207 build failed: Ensure step ran before checkout (stale workspace) Ensure moved after checkout
43389714772 build on streaming slow; cancelled at 31 min to inspect; logs unavailable none; later runs show streaming just needs ~20 min
43393971621 cancelled by an intervening docs push (concurrency group) batch doc pushes at the end
43397559047 build success on streaming; test failed: guard helper truthiness bug passed the direct fixture discard Tee passthrough in Invoke-AuditFixture
43399679707 build failed on gaming: Docker daemon down (npipe:////./pipe/docker_engine missing) docker class pinned to streaming + daemon preflight
43400667363, 43401609180 build failed on streaming: Application Control blocked QualityGate.dll (0x800711C7), twice, solid split build/dast/iac into streaming container halves + gaming execution halves
43403222046 build-verify/test/migration success; web failed on streaming: Chromium spawn UNKNOWN web routed to gaming
43404719353 web failed on gaming: no graphviz/choco there install step dropped (likec4 uses wasm-graphviz; forge build passed next run)
43406208538, 43407975803 web failed: viewer port 4010 busy stale-server cleanup + NO_PROXY + failure diagnostics
43409447257 build/build-verify/test/migration success; web failed: viewer 4010 held by foreign process VIEWER_PORT (default 4010, CI 4011) in serve.mjs, viewer config/spec, web job

NOT DONE:

  • web forge-studio npm ci ERESOLVE (PRODUCT, fails identically on ubuntu — not porting): main 341d31a added dev jsdom@^31.0.1 (+ vitest) while blockly@13.4.0 peers jsdom >=27.4.0 <31.0.0. No product code was changed on this lane. Excerpts: npm error code ERESOLVE, npm error While resolving: blockly@13.4.0, npm error Found: jsdom@31.0.1, npm error peer jsdom@">=27.4.0 <31.0.0" from blockly@13.4.0. Fix on the product lane (align jsdom/blockly in forge-studio/package.json), then re-run; the Vue/snapshot/e2e step ahead of it is green.
  • Viewer steps (VIEWER_PORT=4011 path) UNVERIFIED in CI: the forge failure runs before the viewer contracts, so the new port override has never executed on a runner. Re-run after the forge fix.
  • Downstream of web UNVERIFIED: mutation, sast, deps, gitleaks, dast, dast-verify, iac, iac-scan have never executed — the porting is complete but unproven, especially the new dast/iac artifact handoffs. They unblock the moment web is green; the full tail then needs hours (mutation core allows 360 min).
  • GitHub-hosted fallback (vars.RUNNER_LABELS='["ubuntu-24.04"]'): implemented via OS branches, not executed.