Provision infrastructure in pal-e-services #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone — scoped from westside-ai-assistant design spec (2026-03-28). Note: #2 (kustomize overlay) must also merge before ArgoCD can sync, but the two PRs are to different repos and can be developed in parallel.
Repo
forgejo_admin/pal-e-servicesUser Story
As Marcus (admin)
I want the AI assistant infrastructure provisioned
So that the service can be deployed to the cluster and authenticate to basketball-api
Context
The westside-ai-assistant is a new FastAPI service that needs a var.services entry in pal-e-services to create its namespace, Harbor project, ArgoCD application, and Tailscale funnel. It also needs a Keycloak confidential client (
westside-ai-bot) in thewestside-basketballrealm with a service account that has admin role. The current keycloak_clients variable type and keycloak.tf resource do NOT support service accounts — both need to be extended. Thevalid_redirect_urisfield is required by the variable type but a service-account-only client needs an empty list[].File Targets
Files the agent should modify:
terraform/k3s.tfvars— add westside-ai-assistant to services map; add westside-ai-bot to keycloak_clients withvalid_redirect_uris: []terraform/variables.tf— extend keycloak_clients type to includeservice_accounts_enabled = optional(bool, false)andservice_account_realm_roles = optional(list(string), [])terraform/keycloak.tf— addservice_accounts_enabledtokeycloak_openid_clientresource; add newkeycloak_openid_client_service_account_realm_roleresource to map roles to the service accountFiles the agent should NOT touch:
terraform/services.tf— the for_each loop handles new services automaticallyterraform/main.tf— shared infra, no changes neededterraform/cnpg.tf— no database needed for this serviceAcceptance Criteria
service_accounts_enabled = each.value.service_accounts_enabledtofu plan -lock=falseshows expected resources (namespace, Harbor project, ArgoCD app, funnel, Keycloak client with service account + role mapping)Test Expectations
tofu validatepassestofu plan -lock=falseoutput included in PR (no errors)cd terraform && tofu validate && tofu plan -lock=false -var-file=k3s.tfvarsConstraints
/apisuffix (FastAPI convention), NOT/app(SvelteKit convention)tofu apply— Lucas must approveChecklist
Related
project-westside-ai-assistant— parent projectservice-onboarding-sop— onboarding procedureScope Review: NEEDS_REFINEMENT
Review note:
review-593-2026-03-28The issue's file targets only list
k3s.tfvars, but the Keycloak service account and role mapping requirements demand changes tovariables.tfandkeycloak.tfas well — neither the variable type nor the resource currently supportsservice_accounts_enabledor service account role assignments.terraform/variables.tf(addservice_accounts_enabled+service_account_realm_rolesto keycloak_clients type) andterraform/keycloak.tf(wire attribute into resource + addkeycloak_openid_client_service_account_realm_roleresource)forgejo_repoandimage_repoare required by the services variable but not listed in acceptance criteriatofu apply— ArgoCD source_path doesn't exist yetScope refinement (review-593-2026-03-28):
terraform/variables.tfandterraform/keycloak.tfto file targets — service account support requires type extension and new resourceforgejo_repoandimage_repoto AC1 (required fields)Scope Re-Review: NEEDS_REFINEMENT
Review note:
review-593-2026-03-28-v2Previous review:
review-593-2026-03-28(5 findings — all 5 addressed in this update)Re-review found 2 new issues in acceptance criteria:
"westside-ai-assistant/app"should be"westside-ai-assistant/api"— all FastAPI services (port 8000) use/apisuffix per established convention (basketball-api/api, pal-e-docs/api, mcd-tracker/api, pal-e-mail/api). The/appsuffix is for SvelteKit frontends (port 80).keycloak_clientsvariable type requiresvalid_redirect_uris = list(string)with no default. The westside-ai-bot entry needsvalid_redirect_uris: []specified, or the variable type needsvalid_redirect_urismade optional. Without this, the agent will hit a validation error or guess.Both are
[BODY]fixes — quick issue body edits.Scope refinement v2 (review-593-2026-03-28-v2):
westside-ai-assistant/api—/apisuffix is the FastAPI convention,/appis for SvelteKit frontendsvalid_redirect_uris: []to AC2 and Context — required field in variable type, service-account-only clients need empty listScope Review: READY
Review note:
review-593-2026-03-28-v3Round 3 re-review — both v2 findings addressed:
westside-ai-assistant/api(FastAPI convention)valid_redirect_uris: []explicitly specified for service-account-only clientAll template sections complete, all 3 file targets verified against codebase, traceability triangle intact, 6 acceptance criteria testable. Ready for dispatch.