Template Naming Migration Plan (Game* -> Template*)
Status (February 25, 2026): Implemented directly (no backward-compat alias/deprecation phase). This document is now historical context and parts of the staged strategy below are superseded.
Context
The product now supports a broader set of workload templates (gaming, web apps, databases, DevOps). At the time this plan was written, core planner APIs and internal types still used Game* naming (GameSpec, /planner/games, /game-config/...).
This plan defines a gradual, backward-compatible migration toward template-oriented naming.
Goals
- Introduce template-oriented names in API and code without breaking existing clients.
- Allow frontend and docs to adopt new terminology incrementally.
- Preserve stable JSON schema/behavior during the transition.
Non-Goals (for this phase)
- Removing existing
Game*routes/types. - Refactoring all internal variables/state names immediately.
- Breaking changes in public or authenticated planner APIs.
Hotspots (confirmed)
- Backend planner model/types:
internal/controlplane/planner/game_specs.gointernal/controlplane/planner/game_config.go
- Backend planner API routes/handlers:
internal/controlplane/api/planner_handler.gointernal/controlplane/api/public_catalog_handler.gointernal/controlplane/api/router.go
- Web API client/types:
web/src/api/types.tsweb/src/api/planner.tsweb/src/api/client.ts
- UI flows with game-centric state names:
web/src/components/ProvisionCloudFlow.tsxweb/src/components/GameConfigStep.tsx
Migration Strategy
Phase 1: Alias Layer (non-breaking) [in progress]
Introduce aliases so new code can use template terminology immediately:
- Backend type aliases:
TemplateSpec = GameSpecTemplateConfigVariable = GameConfigVariableTemplateConfigSpec = GameConfigSpec
- Backend route aliases:
GET /v1/planner/templates-> same behavior as/v1/planner/gamesGET /v1/planner/template-config/{templateID}-> same behavior as/v1/planner/game-config/{gameID}GET /v1/public/planner/templates-> same behavior as/v1/public/planner/games
- Frontend API aliases:
TemplateSpec,TemplateConfigVariable,TemplateConfigSpecplannerApi.getTemplates(),plannerApi.getPublicTemplates(),plannerApi.getTemplateConfig()
Phase 2: New Call Sites Prefer Template Naming
Switch new/edited frontend code to aliases first:
- Prefer
TemplateSpecin new UI components and hooks. - Prefer
getTemplates/getTemplateConfigin new integrations. - Keep legacy
getGames/getGameConfigfor existing paths until churn is worth it.
This reduces semantic drift without forcing a large refactor.
Phase 3: UI Internal State and Component Naming
Refactor UI internals gradually (file-by-file), maintaining behavior:
ProvisionCloudFlowstep: 'game'->step: 'template'(with local alias map if needed)gameConfig->templateConfig
GameConfigStep.tsx- eventual rename to
TemplateConfigStep.tsx - export compatibility alias during transition
- eventual rename to
Rule: avoid mixing API renames and visual/UX changes in the same PR when possible.
Phase 4: Documentation and Deprecation Messaging
- Update
docs/api.mdanddocs/openapi.yamlto document both route families (gamesandtemplates). - Mark
gamesandgame-configroutes as backward-compatible legacy aliases. - Optionally add deprecation logging/metrics for legacy route usage.
Phase 5: Retirement (future major/minor decision)
Only after telemetry confirms no important usage:
- Deprecate and eventually remove legacy route names.
- Remove
Game*aliases if no longer used internally.
Compatibility Rules
- JSON payload field names remain unchanged in early phases (
game_id, etc.) unless an explicit migration is planned. - Route aliases must return identical payloads and status codes.
- New aliases should not duplicate logic; they should delegate to existing handlers/functions.
Suggested Execution Order (small PRs)
- Alias types + alias routes (done / current PR scope)
- Frontend API aliases and new call sites on touched files
ProvisionCloudFlowlocal state rename (UI internals only)GameConfigSteprename/export alias- Docs/OpenAPI dual-route documentation + deprecation notes
Risks / Trade-offs
- Short-term duplication (
Game*+Template*) increases surface area. - Mixed naming in codebase persists temporarily.
- This is intentional to avoid breaking clients and to ship the repositioning safely.