From 5d8b30cb6959be0587adcc0002d27c3dbb1c56ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Sun, 11 Oct 2026 17:59:45 +0200 Subject: [PATCH] ci: upgrade from 0.32.0-beta.1 in the installer test (#2683) Co-authored-by: Claude Signed-off-by: Claude --- .github/workflows/ci.yml | 9 ++++++++- AGENTS.md | 5 ++++- tools/test-installer.ps1 | 16 +++++++--------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19958de7..a86080b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -254,12 +254,19 @@ jobs: throw "Could not determine the latest release" } + # Packages up to 0.31.x stop the exporter with taskkill /T. It follows + # stale parent process IDs and can kill the runner agent, so upgrade + # from the first package without it until a newer release exists. + if ([Version]($PreviousVersion -replace '^([0-9\.]+).*$','$1') -lt [Version]'0.32.0') { + $PreviousVersion = '0.32.0-beta.1' + } + # Builds between tags carry the version of an older tag, so installing # them over the latest release would be a downgrade. Package the same # executable with a higher version for the upgrade test. $UpgradeMsi = $Msi $MsiVersion = $Version -replace '^v?([0-9\.]+).*$','$1' - if ([Version]$MsiVersion -le [Version]$PreviousVersion) { + if ([Version]$MsiVersion -le [Version]($PreviousVersion -replace '^([0-9\.]+).*$','$1')) { .\installer\build.ps1 -PathToExecutable $Executable -Version 99.0.0 -Arch amd64 $UpgradeMsi = Join-Path $env:RUNNER_TEMP 'windows_exporter-99.0.0-amd64.msi' Move-Item installer\windows_exporter-99.0.0-amd64.msi $UpgradeMsi diff --git a/AGENTS.md b/AGENTS.md index 08d1e1cb..4f0e5176 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,7 +33,10 @@ their runtime behavior. packaging, deployment examples, CI fixtures and end-to-end helpers. The CI package job validates installer changes with [`tools/test-installer.ps1`](tools/test-installer.ps1), which installs the - service for real. Never run it on a developer machine. + service for real. Never run it on a developer machine. Never upgrade from a + 0.31.x package there: its `taskkill /T` follows stale parent process IDs and + can kill the runner agent, which fails the job with "The hosted runner lost + communication with the server" and no logs. New collectors need discussion with maintainers first. Prefer the configurable `performancecounter` collector where it can provide the requested metrics, as diff --git a/tools/test-installer.ps1 b/tools/test-installer.ps1 index 8ea10498..215fb297 100644 --- a/tools/test-installer.ps1 +++ b/tools/test-installer.ps1 @@ -16,7 +16,10 @@ Param ( # Executable packaged in $Msi and $UpgradeMsi. [Parameter(Mandatory = $true)] [String] $Executable, - # Release to upgrade from, for example 0.31.8. + # Release to upgrade from, for example 0.32.0-beta.1. Packages up to 0.31.x + # stop every windows_exporter.exe with taskkill /T, which also ends + # unrelated processes whose stale parent process ID matches, like the + # runner agent of a CI job. [Parameter(Mandatory = $true)] [String] $PreviousVersion, [Parameter(Mandatory = $false)] @@ -194,14 +197,9 @@ try { throw 'the upgraded service does not use the kept configuration' } - # The previous package removes itself with its own logic. Up to 0.31.x that - # stops every windows_exporter.exe, as documented in UPGRADE.md. - if (Test-ForeignAlive) { - Write-Host 'the independent windows_exporter.exe survived the upgrade' - } else { - Write-Host "::notice::the $PreviousVersion package stopped the independent windows_exporter.exe during the upgrade" - Start-Foreign - } + # The previous package removes itself with its own logic, so it must be + # 0.32.0-beta.0 or newer to leave the independent instance running. + Assert-ForeignAlive -Operation 'upgrade' Write-Host '::endgroup::' Write-Step 'Repair this build'