Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Nov 27, 2025

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

@changeset-bot
Copy link

changeset-bot bot commented Nov 27, 2025

⚠️ No Changeset found

Latest commit: 6a52203

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor Author

jumski commented Nov 27, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge:queue - adds this PR to the back of the merge queue
  • hotfix:queue - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@nx-cloud
Copy link

nx-cloud bot commented Nov 27, 2025

View your CI Pipeline Execution ↗ for commit 6a52203

Command Status Duration Result
nx affected -t verify-exports --base=origin/mai... ✅ Succeeded 3s View ↗
nx affected -t build --configuration=production... ✅ Succeeded 30s View ↗
nx affected -t lint typecheck test --parallel -... ✅ Succeeded 3m 41s View ↗
nx run edge-worker:e2e ✅ Succeeded 2m 54s View ↗
nx run cli:e2e ✅ Succeeded 5s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-27 16:36:14 UTC

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
Copy link
Contributor

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"; then

The -x flag ensures exact line matching, preventing substring false positives.

Suggested change
if ! echo "$running_containers" | grep -qF "$full_container_name"; then
if ! echo "$running_containers" | grep -qxF "$full_container_name"; then

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@github-actions
Copy link
Contributor

🔍 Preview Deployment: Website

Deployment successful!

🔗 Preview URL: https://pr-438.pgflow.pages.dev

📝 Details:

  • Branch: 11-27-fix_supabase-start_to_check_project-specific_containers_and_improve_compile_404_errors
  • Commit: 59a4fcaa5c02ef18d37c7d16e16b4116780797c4
  • View Logs

_Last updated: _

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 28, 2025

Merge activity

  • Nov 28, 11:45 PM UTC: jumski added this pull request to the Graphite merge queue.
  • Nov 28, 11:45 PM UTC: CI is running for this pull request on a draft pull request (#449) due to your merge queue CI optimization settings.
  • Nov 28, 11:53 PM UTC: Merged by the Graphite merge queue via draft PR: #449.

graphite-app bot pushed a commit that referenced this pull request Nov 28, 2025
)

# 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
@graphite-app graphite-app bot closed this Nov 28, 2025
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