Skip to content

Commit 3fc93d1

Browse files
committed
ci: unify smoke/soak/test venues onto canonical leg entries
The staged venue-unification bundle: _smoke.yml onto the shared wrappers with an extracted-artifact input (CBM_SMOKE_ARTIFACT_DIR), soak-legs.sh as the one canonical soak entry (quick + query-leak legs across all venues), protected per-user TEMP roots shared across venues, clean-disk preflights before every VM/Docker run, win.sh and run.sh routed through the canonical scripts, soak.yml retired, and the venue-parity contract (whitelist walker: workflows may provision or call canonical entries, nothing else). Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 4fda0d9 commit 3fc93d1

31 files changed

Lines changed: 1948 additions & 500 deletions

‎.github/workflows/_smoke.yml‎

Lines changed: 75 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -100,58 +100,40 @@ jobs:
100100
with:
101101
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
102102

103-
- name: Extract binary
103+
- name: Extract release artifact
104104
run: |
105105
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
106-
tar -xzf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
107-
chmod +x codebase-memory-mcp
106+
mkdir -p "$RUNNER_TEMP/cbm-artifact"
107+
tar -xzf codebase-memory-mcp${SUFFIX}-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz \
108+
-C "$RUNNER_TEMP/cbm-artifact"
109+
chmod +x "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
108110
109-
- name: Start artifact server
111+
# ONE harness for every venue. This is the same wrapper local CI and PR CI
112+
# run, handed the DOWNLOADED artifact instead of a local build: it stages
113+
# the release fixture, serves it on a kernel-assigned port, and runs
114+
# smoke-test.sh under the isolated profile/TEMP the other venues use.
115+
# It replaces an inline copy of that staging logic which had drifted from
116+
# the wrapper (no env isolation, no user-PATH guard, fixed port).
117+
- name: Smoke test (shared wrapper)
110118
run: |
111-
mkdir -p /tmp/smoke-server
112-
cp codebase-memory-mcp /tmp/smoke-server/
113-
OS=${{ matrix.goos }}; ARCH=${{ matrix.goarch }}
114-
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
115-
tar -czf "/tmp/smoke-server/codebase-memory-mcp${SUFFIX}-${OS}-${ARCH}.tar.gz" \
116-
-C /tmp/smoke-server codebase-memory-mcp
117-
if [ -n "$SUFFIX" ]; then
118-
cp "/tmp/smoke-server/codebase-memory-mcp${SUFFIX}-${OS}-${ARCH}.tar.gz" \
119-
"/tmp/smoke-server/codebase-memory-mcp-${OS}-${ARCH}.tar.gz"
120-
fi
121-
# The linux binary self-updates from the fully-static "-portable" asset
122-
# (build_update_url in src/cli/cli.c appends -portable on linux; _build.yml's
123-
# build-linux-portable job ships it), so the smoke server must serve that name
124-
# too -- otherwise `update` 404s and Phase 14 fails. Mirror the tarball(s) under
125-
# the -portable name on linux only.
126-
if [ "$OS" = "linux" ]; then
127-
cp "/tmp/smoke-server/codebase-memory-mcp${SUFFIX}-${OS}-${ARCH}.tar.gz" \
128-
"/tmp/smoke-server/codebase-memory-mcp${SUFFIX}-${OS}-${ARCH}-portable.tar.gz"
129-
if [ -n "$SUFFIX" ]; then
130-
cp "/tmp/smoke-server/codebase-memory-mcp${SUFFIX}-${OS}-${ARCH}-portable.tar.gz" \
131-
"/tmp/smoke-server/codebase-memory-mcp-${OS}-${ARCH}-portable.tar.gz"
132-
fi
133-
fi
134-
cd /tmp/smoke-server
135-
sha256sum *.tar.gz > checksums.txt 2>/dev/null || shasum -a 256 *.tar.gz > checksums.txt
136-
python3 -m http.server 18080 -d /tmp/smoke-server &
137-
138-
- name: Smoke test
139-
run: scripts/smoke-test.sh ./codebase-memory-mcp
119+
scripts/smoke-local.sh \
120+
"$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp" ${{ matrix.variant }}
140121
env:
141-
SMOKE_DOWNLOAD_URL: http://localhost:18080
142-
SMOKE_UPDATE_FIXTURE_DIR: /tmp/smoke-server
122+
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
143123

144124
- name: Security audits
145125
run: |
146-
scripts/security-strings.sh ./codebase-memory-mcp
147-
scripts/security-install.sh ./codebase-memory-mcp
148-
scripts/security-network.sh ./codebase-memory-mcp
126+
BIN="$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
127+
scripts/security-strings.sh "$BIN"
128+
scripts/security-install.sh "$BIN"
129+
scripts/security-network.sh "$BIN"
149130
150131
- name: MCP robustness test (linux-amd64 standard only)
151132
if: matrix.variant == 'standard' && matrix.goos == 'linux' && matrix.goarch == 'amd64'
152133
run: |
153-
scripts/security-fuzz.sh ./codebase-memory-mcp
154-
scripts/security-fuzz-random.sh ./codebase-memory-mcp 60
134+
BIN="$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
135+
scripts/security-fuzz.sh "$BIN"
136+
scripts/security-fuzz-random.sh "$BIN" 60
155137
156138
- name: ClamAV scan (Linux)
157139
if: startsWith(matrix.os, 'ubuntu')
@@ -165,7 +147,7 @@ jobs:
165147
grep -q "DatabaseMirror" /etc/clamav/freshclam.conf 2>/dev/null || \
166148
echo "DatabaseMirror database.clamav.net" | sudo tee -a /etc/clamav/freshclam.conf > /dev/null
167149
sudo freshclam --quiet
168-
clamscan --no-summary ./codebase-memory-mcp
150+
clamscan --no-summary "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
169151
170152
- name: ClamAV scan (macOS)
171153
if: startsWith(matrix.os, 'macos')
@@ -178,7 +160,7 @@ jobs:
178160
echo "DatabaseMirror database.clamav.net" >> "$CLAMAV_ETC/freshclam.conf"
179161
fi
180162
freshclam --quiet --no-warnings 2>/dev/null || freshclam --quiet 2>/dev/null || echo "WARNING: freshclam update failed"
181-
clamscan --no-summary ./codebase-memory-mcp
163+
clamscan --no-summary "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
182164
183165
smoke-windows:
184166
needs: setup-matrix
@@ -205,75 +187,63 @@ jobs:
205187
with:
206188
name: binaries-windows-${{ matrix.arch }}
207189

208-
- name: Extract binary
190+
- name: Extract release artifact
209191
shell: msys2 {0}
210192
run: |
211193
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
212194
ARCH=${{ matrix.arch }}
213-
unzip -o "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip"
214-
test -s codebase-memory-mcp.exe
215-
test -s codebase-memory-mcp.payload.exe
195+
ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
196+
mkdir -p "$ARTIFACT_DIR"
197+
unzip -o "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" -d "$ARTIFACT_DIR"
198+
test -s "$ARTIFACT_DIR/codebase-memory-mcp.exe"
199+
test -s "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe"
200+
# Pre-flight both images from a profile-rooted directory: the shared
201+
# runner workspace is deliberately not a valid launcher bundle root.
216202
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
217203
LAUNCH_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-version.XXXXXX")"
218204
trap 'rm -rf "$LAUNCH_DIR"' EXIT
219-
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$LAUNCH_DIR/"
205+
cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \
206+
"$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$LAUNCH_DIR/"
220207
"$LAUNCH_DIR/codebase-memory-mcp.payload.exe" --version
221208
"$LAUNCH_DIR/codebase-memory-mcp.exe" --version
222209
223-
- name: Start artifact server
224-
shell: msys2 {0}
225-
run: |
226-
mkdir -p /tmp/smoke-server
227-
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
228-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md /tmp/smoke-server/
229-
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
230-
ARCH=${{ matrix.arch }}
231-
cd /tmp/smoke-server
232-
zip -q "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" \
233-
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
234-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
235-
if [ -n "$SUFFIX" ]; then
236-
cp "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" "codebase-memory-mcp-windows-${ARCH}.zip"
237-
fi
238-
sha256sum *.zip > checksums.txt
239-
# Pin to explicit IPv4: on windows-11-arm, `localhost` resolves to ::1 (IPv6)
240-
# for msys2 curl while python's http.server is IPv4-only -> instant connect
241-
# failure in smoke Phase 12a. --bind 127.0.0.1 + a 127.0.0.1 URL pin both ends.
242-
python3 -m http.server 18080 --bind 127.0.0.1 -d /tmp/smoke-server &
243-
244-
- name: Smoke test
210+
# ONE harness for every venue: the same script win.sh smoke-install and
211+
# pr.yml run, handed the DOWNLOADED artifact instead of a local build. It
212+
# stages the release fixture under a disposable profile root, serves it on
213+
# a kernel-assigned port, guards AND verifies the user-PATH registry
214+
# mutation, and neutralizes every agent-config destination before running
215+
# smoke-test.sh. It replaces an inline copy of that staging which had none
216+
# of the isolation and never verified the PATH mutation it performed.
217+
- name: Smoke test (shared wrapper)
245218
shell: msys2 {0}
246-
run: |
247-
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
248-
SMOKE_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-smoke.XXXXXX")"
249-
trap 'rm -rf "$SMOKE_DIR"' EXIT
250-
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$SMOKE_DIR/"
251-
CBM_CACHE_DIR="$(cygpath -m "$SMOKE_DIR/cache")" \
252-
SMOKE_TEMP_ROOT="$SMOKE_DIR" \
253-
scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe"
254219
env:
255-
SMOKE_DOWNLOAD_URL: http://127.0.0.1:18080
256-
SMOKE_UPDATE_FIXTURE_DIR: /tmp/smoke-server
257220
SMOKE_ARCH: ${{ matrix.arch }}
221+
SMOKE_VARIANT: ${{ matrix.variant }}
222+
run: |
223+
export CBM_SMOKE_ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
224+
bash test-infrastructure/vm/vm-smoke.sh
258225
259226
- name: Security audits
260227
shell: msys2 {0}
261228
run: |
262-
scripts/security-strings.sh ./codebase-memory-mcp.exe
263-
scripts/security-strings.sh ./codebase-memory-mcp.payload.exe
229+
ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"
230+
scripts/security-strings.sh "$ARTIFACT_DIR/codebase-memory-mcp.exe"
231+
scripts/security-strings.sh "$ARTIFACT_DIR/codebase-memory-mcp.payload.exe"
264232
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
265233
SECURITY_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-security.XXXXXX")"
266234
trap 'rm -rf "$SECURITY_DIR"' EXIT
267-
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$SECURITY_DIR/"
235+
cp "$ARTIFACT_DIR/codebase-memory-mcp.exe" \
236+
"$ARTIFACT_DIR/codebase-memory-mcp.payload.exe" "$SECURITY_DIR/"
268237
TMPDIR="$SECURITY_DIR" \
269238
scripts/security-install.sh "$SECURITY_DIR/codebase-memory-mcp.exe"
270239
271240
- name: Windows Defender scan
272241
shell: pwsh
273242
run: |
274243
& "C:\Program Files\Windows Defender\MpCmdRun.exe" -SignatureUpdate 2>$null
244+
$artifactDir = Join-Path $env:RUNNER_TEMP "cbm-artifact"
275245
foreach ($binary in @("codebase-memory-mcp.exe", "codebase-memory-mcp.payload.exe")) {
276-
$result = & "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "$PWD\$binary" -DisableRemediation
246+
$result = & "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File (Join-Path $artifactDir $binary) -DisableRemediation
277247
$code = $LASTEXITCODE
278248
Write-Host $result
279249
# MpCmdRun -Scan exit codes: 0 = clean, 2 = threat found. Any OTHER non-zero
@@ -304,25 +274,39 @@ jobs:
304274
with:
305275
name: binaries-linux-${{ matrix.arch }}-portable
306276

307-
- name: Extract and smoke test
277+
- name: Extract release artifact
308278
run: |
309279
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
310-
tar -xzf codebase-memory-mcp${SUFFIX}-linux-${{ matrix.arch }}-portable.tar.gz
311-
chmod +x codebase-memory-mcp
312-
scripts/smoke-test.sh ./codebase-memory-mcp
280+
mkdir -p "$RUNNER_TEMP/cbm-artifact"
281+
tar -xzf codebase-memory-mcp${SUFFIX}-linux-${{ matrix.arch }}-portable.tar.gz \
282+
-C "$RUNNER_TEMP/cbm-artifact"
283+
chmod +x "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
284+
285+
# Same wrapper as every other venue. This leg previously called
286+
# smoke-test.sh with no fixture server, which silently SKIPPED the
287+
# download/checksum/install-script phases (12-13) — the portable binary is
288+
# what every linux install and update actually delivers, so those are
289+
# exactly the phases it most needs to run.
290+
- name: Smoke test (shared wrapper)
291+
run: |
292+
scripts/smoke-local.sh \
293+
"$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp" ${{ matrix.variant }}
294+
env:
295+
CBM_SMOKE_ARTIFACT_DIR: ${{ runner.temp }}/cbm-artifact
313296

314297
# The -portable binary is what all linux install/update paths now deliver;
315298
# it MUST start on old glibc (Debian 11 / RHEL 8 / Ubuntu 20.04). Runs it
316299
# in debian:bullseye (glibc 2.31) — the standard dynamic binary would fail
317300
# here with `GLIBC_2.38 not found`.
318301
- name: Old-glibc compatibility
319-
run: scripts/ci/check-glibc-compat.sh ./codebase-memory-mcp
302+
run: scripts/ci/check-glibc-compat.sh "$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
320303

321304
- name: Security audits
322305
run: |
323-
scripts/security-strings.sh ./codebase-memory-mcp
324-
scripts/security-install.sh ./codebase-memory-mcp
325-
scripts/security-network.sh ./codebase-memory-mcp
306+
BIN="$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
307+
scripts/security-strings.sh "$BIN"
308+
scripts/security-install.sh "$BIN"
309+
scripts/security-network.sh "$BIN"
326310
327311
# ── Packaging check (non-gating) ──────────────────────────────────
328312
# Builds pkg/glama/Dockerfile — the image Glama builds to score the

0 commit comments

Comments
 (0)