80f6661ad5
Implements Phase A2 of plans/implementation-plan-A-B.md: - commands/wait.py -> wait-ready (replaces Wait-VMReady.ps1) - commands/vm.py -> vm remove + vm cleanup (replaces Remove-BuildVM.ps1, Cleanup-OrphanedBuildVMs.ps1); cleanup accepts injected VmBackend (Phase C ESXi hook preserved) - commands/monitor.py -> monitor disk + monitor runner (replaces Watch-DiskSpace.ps1, Watch-RunnerHealth.ps1) - commands/report.py -> report job (replaces Get-CIJobSummary.ps1) Each PS script reduced to a 3-line shim that delegates to the Python CLI and preserves \0. Tests: 69 pytest cases across new test_commands_*.py modules; ruff clean, mypy --strict clean, coverage 74.5% (>=70 gate).
24 lines
816 B
PowerShell
24 lines
816 B
PowerShell
#Requires -Version 5.1
|
|
Set-StrictMode -Version Latest
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# Shim: delegates to the Python ci_orchestrator CLI.
|
|
# Original PS implementation moved to git history; see plans/A2-closeout.md.
|
|
$pyArgs = @()
|
|
foreach ($a in $args) {
|
|
if ($a -is [string] -and $a.Length -gt 1 -and $a.StartsWith('-') -and -not $a.StartsWith('--')) {
|
|
$name = $a.Substring(1)
|
|
$kebab = [Regex]::Replace($name, '(?<=[a-z0-9])([A-Z])', '-$1')
|
|
$kebab = [Regex]::Replace($kebab, '([A-Z]+)([A-Z][a-z])', '$1-$2')
|
|
$pyArgs += '--' + $kebab.ToLower()
|
|
}
|
|
else {
|
|
$pyArgs += $a
|
|
}
|
|
}
|
|
|
|
$venvPython = $env:CI_VENV_PYTHON
|
|
if (-not $venvPython) { $venvPython = 'F:\CI\python\venv\Scripts\python.exe' }
|
|
& $venvPython -m ci_orchestrator monitor runner @pyArgs
|
|
exit $LASTEXITCODE
|