[chore] Parse supabase status via -o env output - #229
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 24 minutes and 41 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the local development bootstrap script to reliably extract Supabase credentials by switching from parsing human-formatted supabase status output to machine-parseable supabase status -o env.
Changes:
- Replace
grep/awkparsing ofsupabase statusoutput withsupabase status -o env. - Parse
API_URL,ANON_KEY, andSERVICE_ROLE_KEYfrom env-style output usingsed(withouteval).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| echo "Reading Supabase local credentials..." | ||
| STATUS=$(supabase status) | ||
| STATUS_ENV=$(supabase status -o env 2>/dev/null) |
There was a problem hiding this comment.
Fixed — appended || true so a failing supabase status -o env (older CLI without that flag) no longer kills the script silently under set -e. The empty-string guard at line 47 now catches the empty STATUS_ENV and prints the actionable error.
56aaf87 to
02a2279
Compare
HAR-266. Newer Supabase CLI versions changed `supabase status` to a fancy table format, dropping the line-oriented `API URL` / `anon key` / `service_role key` labels the script was grepping for. That made URL/ANON_KEY/SERVICE_ROLE_KEY come out empty, which (now that PR #197 added a real `db:seed` script) makes the seed step fail under `set -e` and abort the whole script. Switch to `supabase status -o env` (stable, machine-parseable env-var output) and pull the same three values out via sed. The variable names downstream are unchanged. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
02a2279 to
b1352ee
Compare
Summary
HAR-266. Newer Supabase CLI versions render
supabase statusas a fancy table and dropped the line-orientedAPI URL/anon key/service_role keylabels the script was grepping for. The grep + awk pipeline silently returned empty strings, so URL/ANON_KEY/SERVICE_ROLE_KEY were unset. With PR #197 now adding a realdb:seedscript, the seed step actually runs and fails on the missing env vars — and underset -ethat aborts the wholedev-local.shflow.Switch to
supabase status -o env, which emits stable, machine-parseableKEY="value"lines that survive CLI cosmetic changes.Changes
scripts/dev-local.sh: read credentials fromsupabase status -o envviased(one regex per variable). Noeval. Downstream variable names (URL,ANON_KEY,SERVICE_ROLE_KEY) are unchanged so nothing else needs touching.Tests
bash -n scripts/dev-local.shpasses.http://127.0.0.1:54321URL plus a 153-char anon key and 164-char service role key.if [ -z "$URL" ] || ...) already covers regressions if the new format ever changes too.AI Metadata
Author-Agent: claude
Review-Status: ready
Review-Claimed-By: