Skip to content

Commit cd28248

Browse files
committed
fix(ci): supply complete app metadata in the Windows integration tests
The script set only APP_FULL_NAME, APP_SHORT_NAME, and APP_GIT_HASH, leaving the identifier, version, and build time to fall back to placeholders. That partial set is a trap now that saluki-metadata rejects placeholder metadata on release builds: the job would fail the moment anyone forwarded APP_DEV_BUILD into its container. Fill in the rest, taking the version from ADP's manifest the same way the Makefile does.
1 parent 03247a3 commit cd28248

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

ci/tooling/windows-integration-tests.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,21 @@ Invoke-Native docker version
5959
Write-Host "[*] Building Panoramic and Agent Data Plane for Windows..."
6060
# saluki-metadata reads these at build time. They must match the values that
6161
# the Linux Makefile passes through, otherwise ADP's log subagent prefix
62-
# renders as "UNKNOWN" instead of "DATAPLANE".
62+
# renders as "UNKNOWN" instead of "DATAPLANE". Keep the set complete: saluki-metadata
63+
# rejects partial metadata on release builds, so a gap here would break this job if it
64+
# were ever handed APP_DEV_BUILD=false.
6365
$env:APP_FULL_NAME = "Agent Data Plane"
6466
$env:APP_SHORT_NAME = "data-plane"
67+
$env:APP_IDENTIFIER = "adp"
68+
# Mirrors ADP_APP_VERSION_AUTO in the Makefile: the version comes from ADP's manifest.
69+
$AdpManifest = Join-Path $RepoRoot "bin\agent-data-plane\Cargo.toml"
70+
$AdpVersionMatch = Select-String -Path $AdpManifest -Pattern '^version = "(.+)"' | Select-Object -First 1
71+
if (-not $AdpVersionMatch) {
72+
throw "Could not read the ADP version from ${AdpManifest}"
73+
}
74+
$env:APP_VERSION = $AdpVersionMatch.Matches[0].Groups[1].Value
75+
# Windows PowerShell 5.1 doesn't have Get-Date's -AsUTC switch (added in PS 7.1).
76+
$env:APP_BUILD_TIME = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
6577
if (-not $env:APP_GIT_HASH) {
6678
$env:APP_GIT_HASH = if ($env:CI_COMMIT_SHA) {
6779
$env:CI_COMMIT_SHA.Substring(0, [Math]::Min(7, $env:CI_COMMIT_SHA.Length))

0 commit comments

Comments
 (0)