Skip to content

chore: migrate wrangler.toml to wrangler.jsonc - #79

Merged
chitcommit merged 1 commit into
mainfrom
chore/wrangler-jsonc
Apr 6, 2026
Merged

chitcommit merged 1 commit into
mainfrom
chore/wrangler-jsonc

Conversation

@chitcommit

@chitcommit chitcommit commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Converts wrangler config from TOML to JSONC. All bindings preserved (verified via dry-run). Bumps compatibility_date to 2026-03-02. Adds CHITTYGOV_URL. Updates doc references.

Summary by CodeRabbit

  • Documentation
    • Updated configuration setup guidance for Cloudflare Worker deployments
    • Enhanced security best practices for credential management
    • Clarified cron job scheduling configuration in deployment guides

Converts config from TOML to JSONC format:
- All bindings preserved: Hyperdrive, R2, KV, AI, Durable Objects,
  migrations, observability, tail_consumers, cron triggers
- Bumps compatibility_date to 2026-03-02
- Adds CHITTYGOV_URL to vars
- Updates references in CLAUDE.md, AGENTS.md, copilot-instructions.md
- Fixes mcp-query.sh to use hardcoded KV ID instead of grepping toml
- Verified via wrangler deploy --dry-run: all bindings intact

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
  1. @coderabbitai review
  2. @copilot review
  3. @codex review
  4. @claude review
    Adversarial review request: evaluate security, policy bypass paths, regression risk, and merge-gating bypass attempts.

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The PR migrates the Worker configuration from wrangler.toml to wrangler.jsonc format. Documentation references are updated accordingly. A shell script is modified to hard-code a KV namespace identifier instead of parsing the configuration file.

Changes

Cohort / File(s) Summary
Documentation Updates
.github/copilot-instructions.md, AGENTS.md, CLAUDE.md
Updated references to configuration file location from wrangler.toml to wrangler.jsonc. Also clarified that secrets should be stored via wrangler secret put rather than in the [vars] section.
Configuration Migration
wrangler.toml (removed), wrangler.jsonc (added)
Migrated Worker configuration from TOML to JSONC format. The new file includes account ID, entrypoint, compatibility settings, production environment variables, bindings for Hyperdrive, R2, KV, AI, and a Durable Object for ActionAgent, observability settings with full sampling, tail consumer for chittytrack, and four cron triggers for scheduled tasks.
Script Hardcoding
scripts/mcp-query.sh
Modified to set KV_ID to a fixed namespace identifier (64eef343b99b46ac909dbbcc1c4b2dee) instead of parsing it from wrangler.toml. Token retrieval now uses the constant value regardless of configuration file contents.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 From TOML to JSONC we hop,
With config files swapped top to top,
The cron jobs march, the secrets stay,
In wrangler's new format today! 🌟

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'chore: migrate wrangler.toml to wrangler.jsonc' accurately describes the primary change: converting the Wrangler configuration file format from TOML to JSONC.
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
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/wrangler-jsonc

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.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Apr 6, 2026

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
chittycommand-ui 9dfccc3 Apr 06 2026, 10:24 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9dfccc3ea7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/mcp-query.sh

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/mcp-query.sh (1)

8-9: Avoid locking this script to a single KV namespace ID.

Line 8 hard-codes one account/environment namespace, so a KV rotation or environment switch can silently break token lookup. Prefer sourcing KV_ID from env and fail fast if unset.

♻️ Proposed refactor
-KV_ID="64eef343b99b46ac909dbbcc1c4b2dee"  # COMMAND_KV namespace from wrangler.jsonc
+KV_ID="${COMMAND_KV_ID:-}"
+if [ -z "$KV_ID" ]; then
+  echo "ERROR: COMMAND_KV_ID is required (COMMAND_KV namespace id)" >&2
+  exit 1
+fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/mcp-query.sh` around lines 8 - 9, The script currently hard-codes
KV_ID and then fetches TOKEN using that value; change KV_ID to read from an
environment variable (e.g., KV_ID="${KV_ID:-}") and if it's empty print a clear
error and exit non‑zero (fail fast), then use that KV_ID in the TOKEN command
(TOKEN=$(npx wrangler kv key get "mcp:service_token" --namespace-id="$KV_ID"
--remote 2>/dev/null)); ensure any existing hard-coded literal is removed or
only used as an explicit fallback with a comment, and update the inline comment
to note the env-sourced behavior so KV rotations/environments won’t silently
break.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@scripts/mcp-query.sh`:
- Around line 8-9: The script currently hard-codes KV_ID and then fetches TOKEN
using that value; change KV_ID to read from an environment variable (e.g.,
KV_ID="${KV_ID:-}") and if it's empty print a clear error and exit non‑zero
(fail fast), then use that KV_ID in the TOKEN command (TOKEN=$(npx wrangler kv
key get "mcp:service_token" --namespace-id="$KV_ID" --remote 2>/dev/null));
ensure any existing hard-coded literal is removed or only used as an explicit
fallback with a comment, and update the inline comment to note the env-sourced
behavior so KV rotations/environments won’t silently break.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 46817895-af1d-4459-95a8-22be95dc2dcc

📥 Commits

Reviewing files that changed from the base of the PR and between de4e39f and 9dfccc3.

📒 Files selected for processing (6)
  • .github/copilot-instructions.md
  • AGENTS.md
  • CLAUDE.md
  • scripts/mcp-query.sh
  • wrangler.jsonc
  • wrangler.toml
💤 Files with no reviewable changes (1)
  • wrangler.toml

@chitcommit
chitcommit enabled auto-merge (squash) April 6, 2026 22:31
@chitcommit
chitcommit merged commit 96a4f3a into main Apr 6, 2026
17 of 19 checks passed
@chitcommit
chitcommit deleted the chore/wrangler-jsonc branch April 6, 2026 22:37
Copilot stopped work on behalf of chitcommit due to an error April 6, 2026 22:37
chitcommit added a commit that referenced this pull request Apr 14, 2026
- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB
  by using chunked base64 encoding (affects both single and batch uploads)
- Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79),
  add SVC_STORAGE service binding to wrangler.jsonc instead
- Fix batch upload: check ChittyStorage response for errors, create
  cc_documents DB records so batch uploads appear in UI
- Add fallback warning log when single upload falls through to legacy R2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chitcommit added a commit that referenced this pull request Apr 14, 2026
- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB
  by using chunked base64 encoding (affects both single and batch uploads)
- Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79),
  add SVC_STORAGE service binding to wrangler.jsonc instead
- Fix batch upload: check ChittyStorage response for errors, create
  cc_documents DB records so batch uploads appear in UI
- Add fallback warning log when single upload falls through to legacy R2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chitcommit added a commit that referenced this pull request Apr 14, 2026
…aps (#90)

- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB
  by using chunked base64 encoding (affects both single and batch uploads)
- Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79),
  add SVC_STORAGE service binding to wrangler.jsonc instead
- Fix batch upload: check ChittyStorage response for errors, create
  cc_documents DB records so batch uploads appear in UI
- Add fallback warning log when single upload falls through to legacy R2

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
chitcommit added a commit that referenced this pull request Jun 3, 2026
…aps (#93)

* fix: document upload crash, duplicate wrangler config, batch upload gaps

- Fix btoa(String.fromCharCode(...bytes)) stack overflow on files >64KB
  by using chunked base64 encoding (affects both single and batch uploads)
- Remove duplicate wrangler.toml — wrangler.jsonc is canonical (PR #79),
  add SVC_STORAGE service binding to wrangler.jsonc instead
- Fix batch upload: check ChittyStorage response for errors, create
  cc_documents DB records so batch uploads appear in UI
- Add fallback warning log when single upload falls through to legacy R2

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

* fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix: apply CodeRabbit auto-fixes (#97)

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix: apply review fixes to batch upload error handling, processing_status, and add r2_key unique migration

Co-authored-by: chitcommit <208086304+chitcommit@users.noreply.github.com>

* Update src/routes/documents.ts

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* fix: apply CodeRabbit auto-fixes

Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.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