fix: make supabase service key env var consistent#2867
Conversation
|
@pranayukey200 is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThree backend files are updated to resolve an env var naming inconsistency: Supabase client initialization in ChangesSupabase service key env var normalization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/services/auto_close_service.py`:
- Around line 37-40: Add explicit validation before calling create_client(...)
to ensure both SUPABASE_URL and the resolved Supabase key (with fallback from
SUPABASE_SERVICE_KEY or SUPABASE_SERVICE_ROLE_KEY) are not None. In
backend/services/auto_close_service.py#L37-L40, validate both credentials and
raise/log a clear service-specific error if either is missing before passing to
create_client. In backend/services/notification_routing.py#L54-L57, apply the
same validation guard with middleware-startup-specific error handling. In
backend/scripts/seed_company_settings.py#L48-L51, validate credentials before
seeding client creation and return an actionable error status if env is
incomplete. In backend/scripts/seed_company_settings.py#L142-L145, extract the
validation logic into a reusable helper and use it in verify_seed() to ensure
consistent validation behavior with seed_company_settings().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: aab13cdd-7fa4-417f-a76c-6d9e76af80cf
📒 Files selected for processing (3)
backend/scripts/seed_company_settings.pybackend/services/auto_close_service.pybackend/services/notification_routing.py
Fix: Make Supabase service key environment variable consistent This PR fixes the inconsistent environment variable naming for the Supabase service key:
closes #2823
Summary by CodeRabbit