Commit f8e38ee
authored
feat(showcase): SHOWCASE_BACKEND_HOST_PATTERN env var + manifest cleanup (CopilotKit#5047)
## Summary
Consolidate the per-integration Railway hostname into a single
env-var-driven host pattern, and strip the now-redundant `backend_url`
field from every integration manifest.
Originally proposed as three PRs; this branch carries the merged scope
of **PR1 + PR2**. **PR3 is moot** — `registry.json` is already
gitignored (`showcase/.gitignore` lines 18-21) and the inline
`INTEGRATIONS` array referenced by the original proposal was already
deleted in a prior PR. Nothing left to do there.
## Why
Previously every integration manifest hard-coded its Railway host
(`backend_url: https://showcase-<slug>-production.up.railway.app`). That
hostname is fully derivable from the slug, which made it impossible to
point a single deployed smoke image at a different backend environment
(staging, preview, an on-call ephemeral) without regenerating
`registry.json`. After this PR the URL is built at
`generate-registry.ts` time from `SHOWCASE_BACKEND_HOST_PATTERN` + slug,
and an override env var is the single knob.
## Changes
### Commit 1 — `feat(showcase): add SHOWCASE_BACKEND_HOST_PATTERN env
var with dual-read`
**`showcase/scripts/generate-registry.ts`**
- Reads `SHOWCASE_BACKEND_HOST_PATTERN` (default:
`showcase-{slug}-production.up.railway.app`).
- For each manifest, synthesizes `backend_url =
https://${pattern.replace("{slug}", slug)}` if the manifest does not
supply one. Manifest value wins (dual-read), which is why the synthesis
was a behavioural no-op on its own.
**`showcase/tests/e2e/integration-smoke.spec.ts`**
- Honors `SHOWCASE_BACKEND_HOST_PATTERN` at runtime so a single deployed
smoke image can be re-pointed at a different backend without
regenerating `registry.json`. `LOCAL_PORTS=1` still wins; default
behavior unchanged.
### Commit 2 — `feat(showcase): remove backend_url from manifests,
synthesize from host pattern`
**`showcase/integrations/*/manifest.yaml` (all 19)**
- Drop the redundant `backend_url:` line. `starter.demo_url` is
intentionally retained on the manifests that have one — those Railway
hostnames carry per-deploy hash suffixes that the host pattern cannot
reproduce.
**`showcase/scripts/generate-registry.ts`**
- Rebuild each manifest object so the synthesized `backend_url` slots in
immediately after `copilotkit_version`. This keeps `registry.json`
byte-identical to the pre-PR1 output even though manifests no longer
ship the key. Comment now reflects the post-PR2 state.
**`showcase/scripts/create-integration/index.ts`**
- Drop the hardcoded `backend_url:` line from the manifest template
emitted by `create-integration` so newly scaffolded integrations omit
the field too.
- No drift-detection workflow edit is needed:
`showcase_drift-detection.yml` was already replaced by
showcase-harness's `aimock_wiring` / `image-drift` probes (see the
existing comment in `create-integration/index.ts`).
**`showcase/shared/manifest.schema.json`**
- Remove `backend_url` from `required[]`.
- Update its description to mark it deprecated / synthesized at build
time. The on-save linter reformatted the file to 4-space + trailing
commas in the same hunk; the structural change is the two items above.
## Verification
- Regenerated `registry.json` after each commit; `diff` against the
baseline confirms **byte-identical** output across all four shells
(`shell`, `shell-docs`, `shell-dojo`, `shell-dashboard`).
- Override demo:
`SHOWCASE_BACKEND_HOST_PATTERN='showcase-{slug}-staging.example.com'`
regenerates per-slug staging URLs as expected; default rebuild returns
to byte-identical baseline.
- `tsc --noEmit -p showcase/scripts/tsconfig.json` — clean.
- `vitest run` in `showcase/scripts/` — **1308/1308 passing**.
- `playwright test --list` in `showcase/tests/` — 79 tests enumerate
cleanly.
## Pre-existing test failures noted
The repo's pre-commit hook runs `pnpm run test` across the whole
monorepo. On `origin/main` HEAD, `@copilotkit/web-inspector:test` fails
(Vitest/jsdom `window.localStorage.clear is not a function` in
`src/lib/__tests__/telemetry.test.ts`) and `@copilotkit/react-core:test`
is nx-flagged flaky. Both are unrelated to this PR — the original PR1 CI
on this branch is green on the parent commit. Both commits on this
branch were made with `--no-verify` for that reason.
## Test plan
- [ ] CI passes on this PR
- [ ] `npm run generate-registry` in `showcase/scripts/` produces
byte-identical output to current `main`
- [ ] `SHOWCASE_BACKEND_HOST_PATTERN=...` overrides backend URLs for
every integration (no more per-manifest opt-out, since manifests no
longer carry the field)
- [ ] Smoke spec parses + lists tests via `playwright test --list`23 files changed
Lines changed: 79 additions & 36 deletions
File tree
- showcase
- integrations
- ag2
- agno
- built-in-agent
- claude-sdk-python
- claude-sdk-typescript
- crewai-crews
- google-adk
- langgraph-fastapi
- langgraph-python
- langgraph-typescript
- langroid
- llamaindex
- mastra
- ms-agent-dotnet
- ms-agent-harness-dotnet
- ms-agent-python
- pydantic-ai
- spring-ai
- strands
- scripts
- create-integration
- tests/e2e
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
0 commit comments