Skip to content

[chore] Parse supabase status via -o env output - #229

Merged
harryden merged 1 commit into
mainfrom
chore/dev-local-supabase-status-parse
May 25, 2026
Merged

harryden merged 1 commit into
mainfrom
chore/dev-local-supabase-status-parse

Conversation

@harryden

Copy link
Copy Markdown
Owner

Summary

HAR-266. Newer Supabase CLI versions render supabase status as a fancy table and dropped the line-oriented API URL / anon key / service_role key labels 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 real db:seed script, the seed step actually runs and fails on the missing env vars — and under set -e that aborts the whole dev-local.sh flow.

Switch to supabase status -o env, which emits stable, machine-parseable KEY="value" lines that survive CLI cosmetic changes.

Changes

  • scripts/dev-local.sh: read credentials from supabase status -o env via sed (one regex per variable). No eval. Downstream variable names (URL, ANON_KEY, SERVICE_ROLE_KEY) are unchanged so nothing else needs touching.

Tests

  • bash -n scripts/dev-local.sh passes.
  • Manually ran the new parsing block in a subshell against the current local Supabase — returns the expected http://127.0.0.1:54321 URL plus a 153-char anon key and 164-char service role key.
  • The empty-string guard (if [ -z "$URL" ] || ...) already covers regressions if the new format ever changes too.

AI Metadata

Author-Agent: claude
Review-Status: ready
Review-Claimed-By:

Copilot AI review requested due to automatic review settings May 25, 2026 13:11
@vercel

vercel Bot commented May 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
linked-list Ready Ready Preview, Comment May 25, 2026 1:18pm

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@harryden, we couldn't start this review because you've used your available PR reviews for now.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d1c6b74-422b-4ba0-a89d-f18740dbb33a

📥 Commits

Reviewing files that changed from the base of the PR and between 00468fe and b1352ee.

📒 Files selected for processing (1)
  • scripts/dev-local.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dev-local-supabase-status-parse

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/awk parsing of supabase status output with supabase status -o env.
  • Parse API_URL, ANON_KEY, and SERVICE_ROLE_KEY from env-style output using sed (without eval).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/dev-local.sh Outdated

echo "Reading Supabase local credentials..."
STATUS=$(supabase status)
STATUS_ENV=$(supabase status -o env 2>/dev/null)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@harryden
harryden force-pushed the chore/dev-local-supabase-status-parse branch from 56aaf87 to 02a2279 Compare May 25, 2026 13:16
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>
@harryden
harryden force-pushed the chore/dev-local-supabase-status-parse branch from 02a2279 to b1352ee Compare May 25, 2026 13:17
@harryden
harryden merged commit e75f72b into main May 25, 2026
6 checks passed
@harryden
harryden deleted the chore/dev-local-supabase-status-parse branch May 25, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants