Skip to content

Commit 877416c

Browse files
test(release): refresh release-validation harness for v0.20.0 behavior changes
The release-validation shell harness carries its own copies of behavior assertions that duplicate the integration suite. Two of them went stale this cycle from the same PRs that broke the integration tests (#1757): - GH-AW compat (#1720): `apm pack --archive` now emits .zip by default; the archive check grepped only `build/*.tar.gz`. Accept either extension, testing each glob independently (a single `ls a b` exits non-zero when either pattern is unmatched, even if the other matches). - Hero scenario 2 / AGENTS.md (#1742): copilot `apm compile` omits the empty AGENTS.md shell when installed instructions already live under `.github/instructions/`. The check insisted AGENTS.md exist; now accept AGENTS.md OR a populated `.github/instructions/`, mirroring the merged pytest fix in test_guardrailing_hero_e2e.py. Same fixes applied to the Windows .ps1 (AGENTS.md only; it has no archive check). Predicates validated locally against apm v0.20.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b651dad commit 877416c

2 files changed

Lines changed: 25 additions & 10 deletions

File tree

scripts/test-release-validation.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,20 @@ test_hero_guardrailing() {
286286
return 1
287287
fi
288288

289-
if [[ ! -f "AGENTS.md" ]]; then
290-
log_error "AGENTS.md not created by compile"
289+
# Copilot compile suppresses empty AGENTS.md shells when installed
290+
# instructions already live under .github/instructions/ (the guardrail
291+
# surface Copilot reads directly). Validate that compiled guardrails
292+
# landed there rather than insisting on an AGENTS.md shell.
293+
if [[ -f "AGENTS.md" ]]; then
294+
log_success "Compiled to AGENTS.md (guardrails active)"
295+
elif ls .github/instructions/*.md 1>/dev/null 2>&1; then
296+
log_success "Compiled guardrails to .github/instructions/ (Copilot reads them directly)"
297+
else
298+
log_error "compile produced no guardrail surface (neither AGENTS.md nor .github/instructions/)"
291299
cd ..
292300
return 1
293301
fi
294302

295-
log_success "Compiled to AGENTS.md (guardrails active)"
296-
297303
# Step 5: apm run design-review (from installed package)
298304
# Gated by APM_RUN_INFERENCE_TESTS — live inference is decoupled from
299305
# the release pipeline and runs in ci-runtime.yml.
@@ -399,8 +405,11 @@ APMYML
399405
exit 1
400406
fi
401407

402-
# Verify a bundle was produced
403-
if ls build/*.tar.gz 1>/dev/null 2>&1; then
408+
# Verify a bundle was produced. 'apm pack --archive' now emits .zip by
409+
# default (legacy pipelines opt back in with --archive-format tar.gz),
410+
# so accept either extension. Test each glob independently: a single
411+
# `ls a b` exits non-zero when either pattern is unmatched.
412+
if ls build/*.zip 1>/dev/null 2>&1 || ls build/*.tar.gz 1>/dev/null 2>&1; then
404413
echo "Bundle archive produced successfully"
405414
else
406415
echo "No bundle archive found in build/"

scripts/windows/test-release-validation.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,19 @@ function Test-HeroGuardrailing {
327327
return $false
328328
}
329329

330-
if (-not (Test-Path "AGENTS.md")) {
331-
Write-ErrorText "AGENTS.md not created by compile"
330+
# Copilot compile suppresses empty AGENTS.md shells when installed
331+
# instructions already live under .github/instructions/ (the guardrail
332+
# surface Copilot reads directly). Validate that compiled guardrails
333+
# landed there rather than insisting on an AGENTS.md shell.
334+
if (Test-Path "AGENTS.md") {
335+
Write-Success "Compiled to AGENTS.md (guardrails active)"
336+
} elseif (Get-ChildItem -Path ".github/instructions" -Filter "*.md" -ErrorAction SilentlyContinue) {
337+
Write-Success "Compiled guardrails to .github/instructions/ (Copilot reads them directly)"
338+
} else {
339+
Write-ErrorText "compile produced no guardrail surface (neither AGENTS.md nor .github/instructions/)"
332340
return $false
333341
}
334342

335-
Write-Success "Compiled to AGENTS.md (guardrails active)"
336-
337343
# Step 5: apm run design-review (from installed package)
338344
Write-Host "Running: $script:BINARY_PATH run design-review (with 10s timeout)"
339345
Write-Host "--- Command Output Start ---"

0 commit comments

Comments
 (0)