You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci(showcase): harden aimock-e2e workflow; matrix pytest on 3.10+3.12
showcase_aimock-e2e.yml:
- workflow_dispatch slug is now a choice-type enum restricted to Python
packages that ship aimock_toggle.py; a TS (mastra) or Java (spring-ai)
slug would have skipped the Python agent start step and then failed with
a misleading Playwright timeout. For comment-trigger paths, the pkg-type
step short-circuits with a clear ::error:: when the slug does not ship
aimock_toggle.py.
- Slug parsing replaced PCRE grep -oP '\\K\\S+' with a POSIX-safe
grep -oE + sed pipeline so BSD/Alpine grep works too (future-proof
against runner image changes).
- aimock pinned to @copilotkit/aimock@^1.14.3 (was @latest) with
--ignore-scripts; unpinned @latest let a bad aimock publish silently
poison CI for everyone.
- pnpm install now runs with --ignore-scripts — trusted commenter triggers
/test-aimock on untrusted PR content, so postinstall scripts must not
run on the runner.
- OPENAI_BASE_URL is no longer pre-set for Python agent start on packages
that ship aimock_toggle.py — forcing the toggle itself to do the
redirection proves the toggle works rather than masking it with env
already set.
- Dead AIMOCK_URL export removed from the Next.js dev-server step (the
runtime only reads OPENAI_BASE_URL).
- Python agent health-check extended 60s -> 90s (45 iter * 2s) for CrewAI
cold imports.
- actions/setup-python caches pip keyed on requirements.txt.
- github-script Post-result step passes slug + job status via env rather
than ${{ }} interpolation — even though the slug is already whitelisted,
the env pattern is the defensive default for dynamic values.
showcase_validate.yml:
- python-unit-tests is now a matrix on Python 3.10 + 3.12 (fail-fast
disabled) so the typing_extensions fallback branch gets CI coverage;
previously only 3.12 ran.
- pip install per package is a HARD FAIL (was ::warning:: + continue);
hiding broken requirements.txt behind a warning let a package ship green
with unresolvable runtime deps. A missing requirements.txt is still
handled gracefully via the -f guard.
- pip caching added via actions/setup-python.
# and anything else that could escape `showcase/packages/$SLUG`.
111
+
case "$SLUG" in
112
+
''|*[!a-z0-9-]*)
113
+
echo "::error::Invalid slug '$SLUG' — must match ^[a-z0-9-]+$"
114
+
exit 1
115
+
;;
116
+
esac
117
+
# Belt-and-suspenders: the slug must correspond to an existing package
118
+
# directory. Rejects typos and anything that bypasses the regex.
119
+
if [ ! -d "showcase/packages/$SLUG" ]; then
120
+
echo "::error::Slug '$SLUG' does not map to showcase/packages/$SLUG"
121
+
exit 1
65
122
fi
123
+
echo "slug=$SLUG" >> "$GITHUB_OUTPUT"
66
124
67
125
- name: Detect package type
68
126
id: pkg-type
@@ -74,10 +132,26 @@ jobs:
74
132
else
75
133
echo "has_python=false" >> "$GITHUB_OUTPUT"
76
134
fi
135
+
# The workflow's downstream steps (dev-server + Playwright) assume
136
+
# a Python agent listening on :8000. Dispatching a TS (mastra) or
137
+
# Java (spring-ai) slug would skip the Python agent start step and
138
+
# then fail with a misleading Playwright timeout. Short-circuit
139
+
# with a clear error instead — the workflow_dispatch enum narrows
140
+
# this at the UI layer, but a comment-trigger slug bypasses that.
141
+
if [ -f "$PKG_DIR/src/aimock_toggle.py" ]; then
142
+
echo "ships_toggle=true" >> "$GITHUB_OUTPUT"
143
+
else
144
+
echo "::error::Slug '$SLUG' does not ship src/aimock_toggle.py — this workflow only exercises packages that wire AIMOCK_URL end-to-end. Add aimock_toggle.py (and requirements.txt) to the package first."
145
+
exit 1
146
+
fi
77
147
78
148
- name: Start aimock
79
149
run: |
80
-
npm install -g @copilotkit/aimock@latest
150
+
# Pin aimock to a known-good floor (caret = safe patch/minor).
151
+
# An unrestricted `@latest` means a bad aimock publish silently
152
+
# poisons CI for everyone; pinning makes the upgrade explicit and
0 commit comments