From 0b0d5486f03816943b32bb05355563b266c55a6b Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 8 Jun 2026 21:15:05 +0200 Subject: [PATCH] chore(scripts): archive PowerShell scripts superseded by the Python CLI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move 16 .ps1 files to scripts/archived/ — they have no live caller: - 10 pure shims (New-BuildVM, Remove-BuildVM, Cleanup-OrphanedBuildVMs, Wait-VMReady, Invoke-RemoteBuild, Get-BuildArtifacts, Watch-DiskSpace, Watch-RunnerHealth, Get-CIJobSummary, Invoke-CIJob) that only forwarded to `ci_orchestrator`; the live Gitea composite action now calls `python -m ci_orchestrator job` directly. - 6 Phase-C host tools reimplemented natively in Python (Start-BurnInTest [+ -Linux], Test-CapacityBurnIn → bench; Test-Smoke → smoke run; Validate-HostState → validate host; Set-CIGuestCredential → creds set). Add scripts/archived/README.md mapping each file to its `ci` replacement, and exempt scripts/archived/ from the PSScriptAnalyzer lint job. Kept (still used / not yet ported): Register-CIScheduledTasks, Backup-CITemplate, Invoke-RetentionPolicy, Set-TemplateSharedFolders, Test-CIGuestWinRM, the e2e build harnesses, and all template/ guest provisioning scripts. --- .gitea/workflows/lint.yml | 3 ++ .../Cleanup-OrphanedBuildVMs.ps1 | 0 scripts/{ => archived}/Get-BuildArtifacts.ps1 | 0 scripts/{ => archived}/Get-CIJobSummary.ps1 | 0 scripts/{ => archived}/Invoke-CIJob.ps1 | 0 scripts/{ => archived}/Invoke-RemoteBuild.ps1 | 0 scripts/{ => archived}/New-BuildVM.ps1 | 0 scripts/archived/README.md | 39 +++++++++++++++++++ scripts/{ => archived}/Remove-BuildVM.ps1 | 0 .../{ => archived}/Set-CIGuestCredential.ps1 | 0 .../{ => archived}/Start-BurnInTest-Linux.ps1 | 0 scripts/{ => archived}/Start-BurnInTest.ps1 | 0 .../{ => archived}/Test-CapacityBurnIn.ps1 | 0 scripts/{ => archived}/Test-Smoke.ps1 | 0 scripts/{ => archived}/Validate-HostState.ps1 | 0 scripts/{ => archived}/Wait-VMReady.ps1 | 0 scripts/{ => archived}/Watch-DiskSpace.ps1 | 0 scripts/{ => archived}/Watch-RunnerHealth.ps1 | 0 18 files changed, 42 insertions(+) rename scripts/{ => archived}/Cleanup-OrphanedBuildVMs.ps1 (100%) rename scripts/{ => archived}/Get-BuildArtifacts.ps1 (100%) rename scripts/{ => archived}/Get-CIJobSummary.ps1 (100%) rename scripts/{ => archived}/Invoke-CIJob.ps1 (100%) rename scripts/{ => archived}/Invoke-RemoteBuild.ps1 (100%) rename scripts/{ => archived}/New-BuildVM.ps1 (100%) create mode 100644 scripts/archived/README.md rename scripts/{ => archived}/Remove-BuildVM.ps1 (100%) rename scripts/{ => archived}/Set-CIGuestCredential.ps1 (100%) rename scripts/{ => archived}/Start-BurnInTest-Linux.ps1 (100%) rename scripts/{ => archived}/Start-BurnInTest.ps1 (100%) rename scripts/{ => archived}/Test-CapacityBurnIn.ps1 (100%) rename scripts/{ => archived}/Test-Smoke.ps1 (100%) rename scripts/{ => archived}/Validate-HostState.ps1 (100%) rename scripts/{ => archived}/Wait-VMReady.ps1 (100%) rename scripts/{ => archived}/Watch-DiskSpace.ps1 (100%) rename scripts/{ => archived}/Watch-RunnerHealth.ps1 (100%) diff --git a/.gitea/workflows/lint.yml b/.gitea/workflows/lint.yml index 955e39c..2a4c4e3 100644 --- a/.gitea/workflows/lint.yml +++ b/.gitea/workflows/lint.yml @@ -61,6 +61,9 @@ jobs: Invoke-ScriptAnalyzer -Path $_ -Recurse -Settings $settings -Severity Error,Warning } } + # scripts/archived/ holds frozen .ps1 superseded by the Python CLI + # (kept for history only) — exempt from lint. + $results = $results | Where-Object { $_.ScriptPath -notmatch '[\\/]archived[\\/]' } if ($results) { $results | Format-Table -AutoSize diff --git a/scripts/Cleanup-OrphanedBuildVMs.ps1 b/scripts/archived/Cleanup-OrphanedBuildVMs.ps1 similarity index 100% rename from scripts/Cleanup-OrphanedBuildVMs.ps1 rename to scripts/archived/Cleanup-OrphanedBuildVMs.ps1 diff --git a/scripts/Get-BuildArtifacts.ps1 b/scripts/archived/Get-BuildArtifacts.ps1 similarity index 100% rename from scripts/Get-BuildArtifacts.ps1 rename to scripts/archived/Get-BuildArtifacts.ps1 diff --git a/scripts/Get-CIJobSummary.ps1 b/scripts/archived/Get-CIJobSummary.ps1 similarity index 100% rename from scripts/Get-CIJobSummary.ps1 rename to scripts/archived/Get-CIJobSummary.ps1 diff --git a/scripts/Invoke-CIJob.ps1 b/scripts/archived/Invoke-CIJob.ps1 similarity index 100% rename from scripts/Invoke-CIJob.ps1 rename to scripts/archived/Invoke-CIJob.ps1 diff --git a/scripts/Invoke-RemoteBuild.ps1 b/scripts/archived/Invoke-RemoteBuild.ps1 similarity index 100% rename from scripts/Invoke-RemoteBuild.ps1 rename to scripts/archived/Invoke-RemoteBuild.ps1 diff --git a/scripts/New-BuildVM.ps1 b/scripts/archived/New-BuildVM.ps1 similarity index 100% rename from scripts/New-BuildVM.ps1 rename to scripts/archived/New-BuildVM.ps1 diff --git a/scripts/archived/README.md b/scripts/archived/README.md new file mode 100644 index 0000000..fdf17fb --- /dev/null +++ b/scripts/archived/README.md @@ -0,0 +1,39 @@ +# Archived PowerShell scripts + +These `.ps1` files are **frozen** and no longer part of the live pipeline. They +are kept for history and reference only. Do not call them and do not extend +them — the production entry point is the Python orchestrator (`ci ...` / +`python -m ci_orchestrator`). + +They are exempt from PSScriptAnalyzer lint (see `.gitea/workflows/lint.yml`). + +## Why archived + +**Pure shims** — these only forwarded their arguments to the Python CLI. The +live Gitea composite action (`.gitea/actions/local-ci-build/action.yml`) now +invokes `python -m ci_orchestrator job` directly, so the shims have no caller. + +| Archived shim | Python replacement | +|---------------|--------------------| +| `Invoke-CIJob.ps1` | `ci job` | +| `New-BuildVM.ps1` | `ci vm new` | +| `Remove-BuildVM.ps1` | `ci vm remove` | +| `Cleanup-OrphanedBuildVMs.ps1` | `ci vm cleanup` | +| `Wait-VMReady.ps1` | `ci wait-ready` | +| `Invoke-RemoteBuild.ps1` | `ci build run` | +| `Get-BuildArtifacts.ps1` | `ci artifacts collect` | +| `Watch-DiskSpace.ps1` | `ci monitor disk` | +| `Watch-RunnerHealth.ps1` | `ci monitor runner` | +| `Get-CIJobSummary.ps1` | `ci report job` | + +**Phase C host tooling** — real PowerShell logic that ran on the Linux host via +`pwsh`, now reimplemented natively in Python so the Linux host needs no pwsh. + +| Archived script | Python replacement | +|-----------------|--------------------| +| `Start-BurnInTest.ps1` | `ci bench run` | +| `Start-BurnInTest-Linux.ps1` | `ci bench run` | +| `Test-CapacityBurnIn.ps1` | `ci bench run` / `ci bench measure` | +| `Test-Smoke.ps1` | `ci smoke run` | +| `Validate-HostState.ps1` | `ci validate host` | +| `Set-CIGuestCredential.ps1` | `ci creds set` | diff --git a/scripts/Remove-BuildVM.ps1 b/scripts/archived/Remove-BuildVM.ps1 similarity index 100% rename from scripts/Remove-BuildVM.ps1 rename to scripts/archived/Remove-BuildVM.ps1 diff --git a/scripts/Set-CIGuestCredential.ps1 b/scripts/archived/Set-CIGuestCredential.ps1 similarity index 100% rename from scripts/Set-CIGuestCredential.ps1 rename to scripts/archived/Set-CIGuestCredential.ps1 diff --git a/scripts/Start-BurnInTest-Linux.ps1 b/scripts/archived/Start-BurnInTest-Linux.ps1 similarity index 100% rename from scripts/Start-BurnInTest-Linux.ps1 rename to scripts/archived/Start-BurnInTest-Linux.ps1 diff --git a/scripts/Start-BurnInTest.ps1 b/scripts/archived/Start-BurnInTest.ps1 similarity index 100% rename from scripts/Start-BurnInTest.ps1 rename to scripts/archived/Start-BurnInTest.ps1 diff --git a/scripts/Test-CapacityBurnIn.ps1 b/scripts/archived/Test-CapacityBurnIn.ps1 similarity index 100% rename from scripts/Test-CapacityBurnIn.ps1 rename to scripts/archived/Test-CapacityBurnIn.ps1 diff --git a/scripts/Test-Smoke.ps1 b/scripts/archived/Test-Smoke.ps1 similarity index 100% rename from scripts/Test-Smoke.ps1 rename to scripts/archived/Test-Smoke.ps1 diff --git a/scripts/Validate-HostState.ps1 b/scripts/archived/Validate-HostState.ps1 similarity index 100% rename from scripts/Validate-HostState.ps1 rename to scripts/archived/Validate-HostState.ps1 diff --git a/scripts/Wait-VMReady.ps1 b/scripts/archived/Wait-VMReady.ps1 similarity index 100% rename from scripts/Wait-VMReady.ps1 rename to scripts/archived/Wait-VMReady.ps1 diff --git a/scripts/Watch-DiskSpace.ps1 b/scripts/archived/Watch-DiskSpace.ps1 similarity index 100% rename from scripts/Watch-DiskSpace.ps1 rename to scripts/archived/Watch-DiskSpace.ps1 diff --git a/scripts/Watch-RunnerHealth.ps1 b/scripts/archived/Watch-RunnerHealth.ps1 similarity index 100% rename from scripts/Watch-RunnerHealth.ps1 rename to scripts/archived/Watch-RunnerHealth.ps1