-
Notifications
You must be signed in to change notification settings - Fork 15
fix: improve error handling for missing ControlPlane edge function #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ompile 404 errors
|
|
View your CI Pipeline Execution ↗ for commit 6a52203
☁️ Nx Cloud last updated this comment at |
| if ! echo "$running_containers" | grep -q "^${service_prefix}"; then | ||
| for service_prefix in "${REQUIRED_SERVICE_PREFIXES[@]}"; do | ||
| local full_container_name="${service_prefix}${project_name}" | ||
| if ! echo "$running_containers" | grep -qF "$full_container_name"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grep -qF performs substring matching which can cause false positives when project names are substrings of each other. For example, if projects 'cli' and 'cli_test' exist, checking for 'cli' would incorrectly match 'supabase_db_cli_test' when only 'cli_test' is running.
Fix:
if ! echo "$running_containers" | grep -qxF "$full_container_name"; thenThe -x flag ensures exact line matching, preventing substring false positives.
| if ! echo "$running_containers" | grep -qF "$full_container_name"; then | |
| if ! echo "$running_containers" | grep -qxF "$full_container_name"; then |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
🔍 Preview Deployment: Website✅ Deployment successful! 🔗 Preview URL: https://pr-438.pgflow.pages.dev 📝 Details:
_Last updated: _ |
Merge activity
|
) # Improve error handling for missing ControlPlane edge function This PR enhances error handling in the CLI when the ControlPlane edge function is not found, distinguishing between two different 404 scenarios: 1. When the flow exists but isn't found in the ControlPlane (our existing error) 2. When the ControlPlane edge function itself doesn't exist (new error case) The changes: - Add specific error message when the Supabase gateway returns a 404 for the missing edge function - Provide clear instructions to run `npx pgflow install` when the edge function is missing - Handle non-JSON responses (like HTML error pages) that some gateways return - Add tests for these new error handling cases Additionally, the PR improves the Supabase startup script to: - Better detect running services by using the project name from project.json - Add configurable retry parameters for E2E tests when waiting for the server to be ready

Improve error handling for missing ControlPlane edge function
This PR enhances error handling in the CLI when the ControlPlane edge function is not found, distinguishing between two different 404 scenarios:
The changes:
npx pgflow installwhen the edge function is missingAdditionally, the PR improves the Supabase startup script to: