Skip to content

fix(urls): repair workers.dev URLs broken by mothership rename#22

Merged
chitcommit merged 1 commit into
mainfrom
fix/workers-dev-urls
Jun 3, 2026
Merged

fix(urls): repair workers.dev URLs broken by mothership rename#22
chitcommit merged 1 commit into
mainfrom
fix/workers-dev-urls

Conversation

@chitcommit

@chitcommit chitcommit commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

Follow-up to #21. Addresses two Codex review comments where the mothership->chittyid rename mechanically replaced chittyid-mothership with chittyid inside workers.dev URLs, breaking URL structure semantics (the renamed segment was the account subdomain, not the worker name). Compounded by workers_dev: false in wrangler.jsonc, meaning these URLs never resolved either before or after the rename.

  • src/services/registry-client.js:26: registered endpoint now reads from env.CHITTYID_SERVICE_URL (matches the convention in src/client/index.js) or SERVICE_PUBLIC_URL, falling back to canonical route https://id.chitty.cc. No hardcoded workers.dev URL.
  • scripts/monitor-notion-sync.js:8: NOTION_SYNC_WORKER_URL is now required; the script fails fast with a clear error if unset. No wrangler config in this repo deploys src/workers/notion-sync-worker.js, so picking any canonical URL would be guessing.

Notes

  • src/workers/notion-sync-worker.js may be dead code: no wrangler.toml/wrangler.jsonc deploys it. Worth a separate cleanup PR if confirmed.

Test plan

  • node --check src/services/registry-client.js
  • node --check scripts/monitor-notion-sync.js

Summary by CodeRabbit

  • Chores
    • Updated service configuration to require explicit environment variables for worker and service endpoint URLs. Hardcoded defaults have been replaced with configurable environment-based settings to support flexible deployment configurations.

The mothership->chittyid rename incorrectly transformed account-subdomain
segments of workers.dev URLs. Cloudflare workers.dev URL shape is
<worker_name>.<account_subdomain>.workers.dev, so notion-sync.chittyid-mothership.workers.dev
had "chittyid-mothership" as the *account subdomain*, not the worker name.
Renaming that segment to "chittyid" produced URLs that don't resolve.
Also, this worker has workers_dev: false, so neither URL was ever live.

- src/services/registry-client.js: read endpoint from
  env.CHITTYID_SERVICE_URL (matches src/client/index.js convention) /
  SERVICE_PUBLIC_URL, fallback to canonical route https://id.chitty.cc.
- scripts/monitor-notion-sync.js: require NOTION_SYNC_WORKER_URL to be
  set explicitly; fail with a clear error otherwise. No notion-sync
  wrangler config deploys src/workers/notion-sync-worker.js in this repo,
  so guessing a canonical URL would be wrong.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2a442d09-31f1-49e8-b0cc-e70dabaf8803

📥 Commits

Reviewing files that changed from the base of the PR and between bf07a1f and 8236bb6.

📒 Files selected for processing (2)
  • scripts/monitor-notion-sync.js
  • src/services/registry-client.js

📝 Walkthrough

Walkthrough

This PR moves service endpoint URL configuration from hardcoded defaults to environment variables with explicit validation. The Notion Sync monitor now requires NOTION_SYNC_WORKER_URL and fails fast with an error if missing. The registry client derives its public endpoint from environment variables (CHITTYID_SERVICE_URL, SERVICE_PUBLIC_URL) with a fallback default.

Changes

Service endpoint configuration

Layer / File(s) Summary
Environment-based endpoint URLs with validation and fallbacks
scripts/monitor-notion-sync.js, src/services/registry-client.js
Endpoint URL configuration is moved from hardcoded defaults to environment variables. monitor-notion-sync.js now requires NOTION_SYNC_WORKER_URL and exits with status 1 if missing. registry-client.buildServiceInfo() derives the endpoint from CHITTYID_SERVICE_URL or SERVICE_PUBLIC_URL, with fallback to https://id.chitty.cc.

Possibly Related PRs

  • chittyfoundation/chittyid#21: Both PRs modify service endpoint wiring—this PR uses environment variables to derive endpoints, while PR #21 adjusts related endpoint/worker URL naming and configuration.

🐰 From hardcoded chains we break free,
Environment variables set us loose, you see!
Notion Sync checks its config with care,
Registry finds its home anywhere! ✨

🎯 2 (Simple) | ⏱️ ~10 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/workers-dev-urls

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
chittyid 8236bb6 Jun 03 2026, 10:48 PM

@chitcommit chitcommit merged commit a2bf8b2 into main Jun 3, 2026
2 of 4 checks passed
chitcommit added a commit that referenced this pull request Jun 10, 2026
These files are leftovers from an older notion-sync architecture:

- src/workers/notion-sync-worker.js is not bound by any wrangler config
  (wrangler.jsonc, wrangler.hybrid.toml, wrangler-pages.toml all have
  zero Notion references) and is only referenced by itself.
- scripts/monitor-notion-sync.js reads NOTION_SYNC_WORKER_URL which is
  not set anywhere in the repo or ecosystem and targets a worker that
  is not deployed.
- No cross-repo references exist in CHITTYFOUNDATION/* or CHITTYOS/*.
- Current Notion integration flows through src/services/notion-sync.js
  and src/api/notion-bridge.js, which are unaffected.

Surfaced during chittyid PR #22 cleanup (orphan task
4b35b6e3-51a4-4c44-a8e4-ac43b9b17e68).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
chitcommit added a commit that referenced this pull request Jun 10, 2026
These files are leftovers from an older notion-sync architecture:

- src/workers/notion-sync-worker.js is not bound by any wrangler config
  (wrangler.jsonc, wrangler.hybrid.toml, wrangler-pages.toml all have
  zero Notion references) and is only referenced by itself.
- scripts/monitor-notion-sync.js reads NOTION_SYNC_WORKER_URL which is
  not set anywhere in the repo or ecosystem and targets a worker that
  is not deployed.
- No cross-repo references exist in CHITTYFOUNDATION/* or CHITTYOS/*.
- Current Notion integration flows through src/services/notion-sync.js
  and src/api/notion-bridge.js, which are unaffected.

Surfaced during chittyid PR #22 cleanup (orphan task
4b35b6e3-51a4-4c44-a8e4-ac43b9b17e68).

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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