Skip to content

chore(electric-proxy): local dev setup and worker cleanup#1464

Merged
saddlepaddle merged 1 commit into
mainfrom
fix/electric-proxy-local-dev
Feb 13, 2026
Merged

chore(electric-proxy): local dev setup and worker cleanup#1464
saddlepaddle merged 1 commit into
mainfrom
fix/electric-proxy-local-dev

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Feb 13, 2026

Summary

  • Wire up electric-proxy for local dev with bun dev (wrangler dev, Caddy HTTP/2 proxy, .dev.vars generation)
  • Caddy now proxies electric-proxy (HTTP/2 for SSE multiplexing) instead of the API server
  • Extract Env interface to dedicated file, enable Cloudflare observability
  • Make ELECTRIC_SECRET optional for local dev

Changes

  • .superset/setup.sh — Generate apps/electric-proxy/.dev.vars with local Electric/auth URLs; Caddy now reverse-proxies wrangler dev instead of the API server; add ELECTRIC_PROXY_PORT and CADDY_ELECTRIC_PORT
  • package.json — Include @superset/electric-proxy in bun dev
  • turbo.jsonc — Add NEXT_PUBLIC_ELECTRIC_URL and ELECTRIC_PROXY_PORT to global env
  • apps/electric-proxy/package.json — Dev script reads port from .env via dotenv
  • apps/electric-proxy/src/env.ts — Extracted Env interface
  • apps/electric-proxy/src/index.ts — Import from env.ts, make secret conditional
  • apps/electric-proxy/wrangler.jsonc — Bump compat date, enable observability
  • .gitignore — Ignore .dev.vars

Test Plan

  • Run .superset/setup.sh — verify .dev.vars generated in apps/electric-proxy/
  • Run bun dev — verify electric-proxy starts alongside other services
  • Desktop app connects to Electric via Caddy HTTPS proxy

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Made the electric secret parameter optional, resolving configuration issues when the secret is not provided.
  • Chores

    • Enabled observability for improved monitoring and diagnostics.
    • Updated platform compatibility to the latest version.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 13, 2026

📝 Walkthrough

Walkthrough

The electric-proxy application extracts its environment configuration interface to a dedicated file and refactors the main module to import it. Additionally, the logic for handling the ELECTRIC_SECRET parameter is updated to be conditional—it is only included in query parameters when present.

Changes

Cohort / File(s) Summary
Type Definition Extraction
apps/electric-proxy/src/env.ts, apps/electric-proxy/src/index.ts
Moves Env interface definition to dedicated env.ts file and updates index.ts to import and re-export it. Modifies ELECTRIC_SECRET parameter handling to be conditional—now only added if truthy, rather than always included.
Configuration Update
apps/electric-proxy/wrangler.jsonc
Updates compatibility_date to 2026-02-12 and enables observability settings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A tale of organization most fine,
Interfaces extracted in line,
Secrets now conditional, wise and keen,
The cleanest config ever seen!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main objectives: setting up electric-proxy for local development and cleaning up the worker configuration.
Description check ✅ Passed The PR description provides a comprehensive summary, detailed changes, and a test plan, though it deviates from the repository's template structure.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/electric-proxy-local-dev

No actionable comments were generated in the recent review. 🎉


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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 13, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch
  • ✅ Electric Fly.io app
  • ✅ Streams Fly.io app

Thank you for your contribution! 🎉

…secret optional

Move Env interface to dedicated env.ts file. Enable Cloudflare
observability. Make ELECTRIC_SECRET optional for local dev without it.
@saddlepaddle saddlepaddle force-pushed the fix/electric-proxy-local-dev branch from af99d81 to d6b33bf Compare February 13, 2026 20:30
@saddlepaddle saddlepaddle merged commit 2e33594 into main Feb 13, 2026
14 of 15 checks passed
@Kitenite Kitenite deleted the fix/electric-proxy-local-dev branch February 16, 2026 00:04
AviPeltz added a commit that referenced this pull request Apr 18, 2026
Observability was enabled in #1464 but dropped when the proxy was
re-created from scratch in #1867. Without it, every wrangler deploy
reconciles Cloudflare back to logs/traces off, which is why the
dashboard toggles kept reverting after each production deploy.

Pin invocation_logs explicitly so future config drift can't silently
disable it again. Audit logs are an account-level setting and still
need to be re-enabled in the Cloudflare dashboard separately.
AviPeltz added a commit that referenced this pull request Apr 18, 2026
…3565)

Observability was enabled in #1464 but dropped when the proxy was
re-created from scratch in #1867. Without it, every wrangler deploy
reconciles Cloudflare back to logs/traces off, which is why the
dashboard toggles kept reverting after each production deploy.

Pin invocation_logs explicitly so future config drift can't silently
disable it again. Audit logs are an account-level setting and still
need to be re-enabled in the Cloudflare dashboard separately.
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.

1 participant