Skip to content

fix: avoid wrangler inspector port collisions#1634

Open
riderx wants to merge 4 commits intomainfrom
riderx/cloudflare-ci-fix
Open

fix: avoid wrangler inspector port collisions#1634
riderx wants to merge 4 commits intomainfrom
riderx/cloudflare-ci-fix

Conversation

@riderx
Copy link
Member

@riderx riderx commented Feb 15, 2026

Summary (AI generated)

  • Added dedicated wrangler dev inspector ports for API, Plugin, and Files workers in scripts/start-cloudflare-workers.sh.
  • Updated each local worker launch to use those ports, preventing debugger port collisions during parallel startup.

Motivation (AI generated)

Cloudflare local/CI backend testing can fail when multiple workers compete for the default inspector port (127.0.0.1:9229).

Business Impact (AI generated)

This reduces Cloudflare backend test flakiness and improves CI reliability for release validation.

Test Plan (AI generated)

  • bun test:cloudflare:backend
  • bun lint:backend

Screenshots (AI generated)

  • N/A (backend shell script change)

Checklist (AI generated)

  • My code follows the code style of this project and passes
    bun run lint:backend && bun run lint.
  • My change requires a change to the documentation.
  • I have updated the documentation
    accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce
    my tests

Generated with AI

Summary by CodeRabbit

  • Chores
    • Added dedicated inspector ports for API, Plugin, and Files workers to improve local debugging; the dev startup now exposes each worker on its own inspector port. No changes to runtime behavior, error handling, or cleanup logic.

Copilot AI review requested due to automatic review settings February 15, 2026 00:31
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

A shell script was updated to add three inspector port defaults (API_INSPECTOR_PORT=9230, PLUGIN_INSPECTOR_PORT=9231, FILES_INSPECTOR_PORT=9232) and to pass them to each worker's wrangler dev command via --inspector-port flags.

Changes

Cohort / File(s) Summary
Inspector Port Configuration
scripts/start-cloudflare-workers.sh
Added three inspector port defaults (API_INSPECTOR_PORT, PLUGIN_INSPECTOR_PORT, FILES_INSPECTOR_PORT) and appended --inspector-port "<PORT>" to the wrangler dev startup commands for API, Plugin, and Files workers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 Three tiny ports snug in a row,
9230, 9231, 9232 glow.
Wranglers hum and devs take cheer,
Inspectors listen, debugging near.
Hoppity hops — logs crystal clear.

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (5 files):

⚔️ package.json (content)
⚔️ scripts/start-cloudflare-workers.sh (content)
⚔️ src/pages/admin/dashboard/plugins.vue (content)
⚔️ supabase/functions/_backend/utils/pg.ts (content)
⚔️ supabase/functions/_backend/utils/version.ts (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding dedicated inspector ports to prevent wrangler port collisions during parallel worker startup.
Description check ✅ Passed The description covers summary, motivation, test plan, and screenshots sections; however, the checklist is incomplete with only manual testing checked and lint/documentation items unchecked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 riderx/cloudflare-ci-fix
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch riderx/cloudflare-ci-fix
  • Create stacked PR with resolved conflicts
  • Post resolved changes as copyable diffs in a comment

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the local Cloudflare Workers startup script to prevent Node inspector/debugger port conflicts when running API/Plugin/Files workers in parallel (common in local + CI Cloudflare test runs).

Changes:

  • Introduces per-worker configurable inspector port defaults (9230/9231/9232).
  • Passes the dedicated inspector port to each wrangler dev invocation via --inspector-port.

@riderx riderx force-pushed the riderx/cloudflare-ci-fix branch from 609ab25 to 0f4a490 Compare February 15, 2026 20:29
@sonarqubecloud
Copy link

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