Skip to content

Conversation

@jumski
Copy link
Contributor

@jumski jumski commented Nov 2, 2025

Update Supabase JS SDK and Improve Edge Worker E2E Testing

This PR updates the Supabase JS SDK from version 2.55.0 to 2.74.0 and significantly improves the edge worker E2E testing infrastructure.

Key changes:

  • Added a new script sync-e2e-deps.sh that copies built packages to a vendor directory for E2E tests
  • Created a new import map in supabase/functions/deno.json to properly resolve dependencies during tests
  • Added a new serve:functions:e2e task that uses the vendor directory for testing
  • Removed SQL views and functions that are no longer needed (active_workers, inactive_workers, spawn_worker)
  • Updated worker detection logic to use direct queries instead of views
  • Improved worker startup logic with retry mechanism for better test reliability
  • Added E2E test environment variables to .env file
  • Added --no-verify-jwt flag to function serving to simplify testing

These changes make the E2E tests more reliable and easier to run, while also keeping the codebase up-to-date with the latest Supabase SDK.

@changeset-bot
Copy link

changeset-bot bot commented Nov 2, 2025

⚠️ No Changeset found

Latest commit: 1265cb0

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 2, 2025


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 2, 2025

🤖 Nx Cloud AI Fix Eligible

An automatically generated fix could have helped fix failing tasks for this run, but Self-healing CI is disabled for this workspace. Visit workspace settings to enable it and get automatic fixes in future runs.

To disable these notifications, a workspace admin can disable them in workspace settings.


View your CI Pipeline Execution ↗ for commit 1265cb0

Command Status Duration Result
nx affected -t lint typecheck test --parallel -... ❌ Failed 7m 15s View ↗
nx affected -t test:e2e --parallel --base=b8aba... ✅ Succeeded 6m 17s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-02 15:22:32 UTC

Comment on lines +45 to +46
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} +
Copy link
Contributor

Choose a reason for hiding this comment

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

Critical: Platform compatibility issue with sed -i

The sed -i command behaves differently on macOS vs Linux. On macOS, sed -i requires a backup extension argument (even if empty), while Linux doesn't. This script will fail on macOS systems.

Fix:

# Use platform-independent approach
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -type f -delete

Or use a more portable solution:

find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f | while read -r file; do
  sed 's/\.js"/\.ts"/g; s/\.js'\''/.ts'\'''/g' "$file" > "$file.tmp" && mv "$file.tmp" "$file"
done
Suggested change
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i "s/\.js'/\.ts'/g" {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak 's/\.js"/\.ts"/g' {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.ts" -type f -exec sed -i.bak "s/\.js'/\.ts'/g" {} +
find "$VENDOR_DIR/@pgflow/edge-worker" -name "*.bak" -type f -delete

Spotted by Graphite Agent

Fix in Graphite


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

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

🔍 Preview Deployment: Playground

Deployment failed!

Please check the workflow logs for details.

@jumski jumski force-pushed the fix-e2e-edg-worker-tests branch 2 times, most recently from e933914 to 238cf24 Compare November 2, 2025 01:21
@jumski jumski force-pushed the fix-e2e-edg-worker-tests branch from 238cf24 to ab368d4 Compare November 2, 2025 01:44
@jumski jumski force-pushed the fix-e2e-edg-worker-tests branch 2 times, most recently from ff76958 to 8be0970 Compare November 2, 2025 12:42
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

🔍 Preview Deployment: Website

Deployment successful!

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

📝 Details:

  • Branch: fix-e2e-edg-worker-tests
  • Commit: 8e12e9daa42018dc49847cbaafd092236eff11dc
  • View Logs

_Last updated: _

…encies

- Added a new script to synchronize vendor dependencies for e2e tests
- Updated Deno lock file to include std library and remove outdated supabase-js entries
- Modified project.json to include a new sync-e2e-deps target and adjust test dependencies
- Removed obsolete import mappings from deno.json files in functions
- Added .gitignore for vendor directory to prevent committing vendor files
- Updated test command to use a different config file for e2e testing
- Ensured build verification before copying dependencies in the sync script
@jumski jumski force-pushed the fix-e2e-edg-worker-tests branch from c5371c5 to 1265cb0 Compare November 2, 2025 15:13
@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 2, 2025

Merge activity

  • Nov 2, 3:13 PM UTC: jumski added this pull request to the Graphite merge queue.
  • Nov 2, 3:14 PM UTC: CI is running for this pull request on a draft pull request (#295) due to your merge queue CI optimization settings.
  • Nov 2, 3:15 PM UTC: Merged by the Graphite merge queue via draft PR: #295.

graphite-app bot pushed a commit that referenced this pull request Nov 2, 2025
…re (#292)

# Update Supabase JS SDK and Improve Edge Worker E2E Testing

This PR updates the Supabase JS SDK from version 2.55.0 to 2.74.0 and significantly improves the edge worker E2E testing infrastructure.

Key changes:

- Added a new script `sync-e2e-deps.sh` that copies built packages to a vendor directory for E2E tests
- Created a new import map in `supabase/functions/deno.json` to properly resolve dependencies during tests
- Added a new `serve:functions:e2e` task that uses the vendor directory for testing
- Removed SQL views and functions that are no longer needed (`active_workers`, `inactive_workers`, `spawn_worker`)
- Updated worker detection logic to use direct queries instead of views
- Improved worker startup logic with retry mechanism for better test reliability
- Added E2E test environment variables to `.env` file
- Added `--no-verify-jwt` flag to function serving to simplify testing

These changes make the E2E tests more reliable and easier to run, while also keeping the codebase up-to-date with the latest Supabase SDK.
@graphite-app graphite-app bot closed this Nov 2, 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