Problem
-
The codebase uses SUPABASE_SERVICE_KEY which follows Supabase's legacy naming. Supabase is migrating from service_role key to secret key (late 2026 deadline).
-
The secret key was never passed to Cloud Run via Terraform or the deploy pipeline, so production couldn't perform admin operations (e.g., dataset uploads during seeding).
-
The secret key was also missing from the Modal secrets sync script, so Modal functions fell back to the anon key.
Changes
- Rename
SUPABASE_SERVICE_KEY → SUPABASE_SECRET_KEY across all 18 files (Python, Terraform, workflows, docs, configs)
- Rename
supabase_service_key → supabase_secret_key (Python settings field)
- Rename
get_service_role_client() → get_secret_client() (Python function)
- Add
SUPABASE_SECRET_KEY to Terraform (variables.tf + main.tf) — was missing entirely
- Add
TF_VAR_supabase_secret_key to deploy.yml Terraform plan step
- Add
SUPABASE_SECRET_KEY to both staging and production Modal sync steps
- Add
SUPABASE_SECRET_KEY to modal-sync-secrets.sh
Not renamed: SQL service_role in RLS policies (Postgres role name, not our env var).
Manual step required
Set SUPABASE_SECRET_KEY as a GitHub Actions secret with the value from Supabase Dashboard > Settings > API > secret key.
Problem
The codebase uses
SUPABASE_SERVICE_KEYwhich follows Supabase's legacy naming. Supabase is migrating fromservice_rolekey tosecretkey (late 2026 deadline).The secret key was never passed to Cloud Run via Terraform or the deploy pipeline, so production couldn't perform admin operations (e.g., dataset uploads during seeding).
The secret key was also missing from the Modal secrets sync script, so Modal functions fell back to the anon key.
Changes
SUPABASE_SERVICE_KEY→SUPABASE_SECRET_KEYacross all 18 files (Python, Terraform, workflows, docs, configs)supabase_service_key→supabase_secret_key(Python settings field)get_service_role_client()→get_secret_client()(Python function)SUPABASE_SECRET_KEYto Terraform (variables.tf+main.tf) — was missing entirelyTF_VAR_supabase_secret_keytodeploy.ymlTerraform plan stepSUPABASE_SECRET_KEYto both staging and production Modal sync stepsSUPABASE_SECRET_KEYtomodal-sync-secrets.shNot renamed: SQL
service_rolein RLS policies (Postgres role name, not our env var).Manual step required
Set
SUPABASE_SECRET_KEYas a GitHub Actions secret with the value from Supabase Dashboard > Settings > API > secret key.