Skip to content

chore: upgrade to zod v4#4039

Open
carderne wants to merge 8 commits into
mainfrom
chore/zod-4
Open

chore: upgrade to zod v4#4039
carderne wants to merge 8 commits into
mainfrom
chore/zod-4

Conversation

@carderne

@carderne carderne commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Experimental, not thoroughly tested yet.

TODO list before merging

@changeset-bot

changeset-bot Bot commented Jun 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d85c7f3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 28 packages
Name Type
@trigger.dev/core Patch
@trigger.dev/sdk Patch
trigger.dev Patch
@trigger.dev/redis-worker Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/build Patch
@trigger.dev/plugins Patch
@trigger.dev/python Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/llm-model-catalog Patch
@trigger.dev/rbac Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/run-store Patch
@internal/schedule-engine Patch
@trigger.dev/sso Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/tsql Patch
@internal/zod-worker Patch
@internal/dashboard-agent Patch
@internal/sdk-compat-tests Patch
@trigger.dev/react-hooks Patch
@trigger.dev/rsc Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c08a280-f0a2-4de2-afcb-252b221e12c5

📥 Commits

Reviewing files that changed from the base of the PR and between 822ea2f and d85c7f3.

📒 Files selected for processing (4)
  • apps/webapp/app/components/Feedback.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug_.projects.new/route.tsx
  • apps/webapp/app/routes/resources.branches.archive.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/webapp/app/routes/resources.branches.archive.tsx
  • apps/webapp/app/routes/app.orgs.$organizationSlug.projects.new/route.tsx
  • apps/webapp/app/components/Feedback.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx
📜 Recent review details
⏰ Context from checks skipped due to timeout. (30)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (10, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (8, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (6, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (9, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (12, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (11, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (1, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (7, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (4, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (5, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (2, 12)
  • GitHub Check: internal / 🧪 Unit Tests: Internal (3, 12)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (1, 3)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (3, 3)
  • GitHub Check: packages / 🧪 Unit Tests: Packages (2, 3)
  • GitHub Check: e2e-webapp / 🧪 E2E Tests: Webapp
  • GitHub Check: 🛡️ E2E Auth Tests (full)

Walkthrough

Package manifests and overrides update Zod versions, peer ranges, and dependency placement across the workspace. Core and webapp schemas switch to explicit string-keyed records and adjust a few field shapes. Webapp routes and components migrate to parseWithZod, getFormProps, and .errors-based rendering. Several helpers and runtime paths add casts or updated type aliases to match Zod v4 APIs.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required template sections, checklist, testing details, changelog, and screenshots. Rewrite it to match the repository template, including Closes #issue, checklist items, Testing, Changelog, and Screenshots sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% 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 is concise and directly summarizes the main change: upgrading to Zod v4.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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/zod-4

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed due to a network error.


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.

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@trigger.dev/build

npm i https://pkg.pr.new/@trigger.dev/build@4a249c1

trigger.dev

npm i https://pkg.pr.new/trigger.dev@4a249c1

@trigger.dev/core

npm i https://pkg.pr.new/@trigger.dev/core@4a249c1

@trigger.dev/python

npm i https://pkg.pr.new/@trigger.dev/python@4a249c1

@trigger.dev/react-hooks

npm i https://pkg.pr.new/@trigger.dev/react-hooks@4a249c1

@trigger.dev/redis-worker

npm i https://pkg.pr.new/@trigger.dev/redis-worker@4a249c1

@trigger.dev/rsc

npm i https://pkg.pr.new/@trigger.dev/rsc@4a249c1

@trigger.dev/schema-to-json

npm i https://pkg.pr.new/@trigger.dev/schema-to-json@4a249c1

@trigger.dev/sdk

npm i https://pkg.pr.new/@trigger.dev/sdk@4a249c1

commit: 4a249c1

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/triggerdotdev/trigger.dev/issues/comments/4799766654","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- review_stack_entry_start -->\n\n[![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/triggerdotdev/trigger.dev/pull/4039?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)\n\n<!-- review_stack_entry_end -->\n<!-- This is an auto-generated comment: review in progress by coderabbit.ai -->\n\n> [!NOTE]\n> Currently processing new changes in this PR. This may take a few minutes, please wait...\n> \n> <details>\n> <summary>⚙️ Run configuration</summary>\n> \n> **Configuration used**: Repository UI\n> \n> **Review profile**: CHILL\n> \n> **Plan**: Pro\n> \n> **Run ID**: `8fad56a2-0f47-4f9f-b9bc-59ba132bf08d`\n> \n> </details>\n> \n> <details>\n> <summary>📥 Commits</summary>\n> \n> Reviewing files that changed from the base of the PR and between d565949205ab1fefbc2cbf8bf5ab826207f3192e and 3d5ccd22d7736c6a1545298e1da9626a721e55ac.\n> \n> </details>\n> \n> <details>\n> <summary>⛔ Files ignored due to path filters (1)</summary>\n> \n> * `pnpm-lock.yaml` is excluded by `!**/pnpm-lock.yaml`\n> \n> </details>\n> \n> <details>\n> <summary>📒 Files selected for processing (82)</summary>\n> \n> * `.changeset/zod-4-support.md`\n> * `apps/supervisor/package.json`\n> * `apps/webapp/app/components/metrics/QueryWidget.tsx`\n> * `apps/webapp/app/models/orgIntegration.server.ts`\n> * `apps/webapp/app/models/vercelIntegration.server.ts`\n> * `apps/webapp/app/models/vercelSdkRecovery.server.ts`\n> * `apps/webapp/app/presenters/v3/MetricDashboardPresenter.server.ts`\n> * `apps/webapp/app/presenters/v3/SpanPresenter.server.ts`\n> * `apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.environment-variables.new/route.tsx`\n> * `apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query/route.tsx`\n> * `apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.billing-alerts/route.tsx`\n> * `apps/webapp/app/routes/account._index/route.tsx`\n> * `apps/webapp/app/routes/account.tokens/route.tsx`\n> * `apps/webapp/app/routes/admin.feature-flags.tsx`\n> * `apps/webapp/app/routes/api.v1.plain.customer-cards.ts`\n> * `apps/webapp/app/routes/api.v1.prompts.$slug.ts`\n> * `apps/webapp/app/routes/api.v1.query.ts`\n> * `apps/webapp/app/routes/api.v1.schedules.ts`\n> * `apps/webapp/app/routes/resources.feedback.ts`\n> * `apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.schedules.new/route.tsx`\n> * `apps/webapp/app/services/apiAuth.server.ts`\n> * `apps/webapp/app/services/authorizationRateLimitMiddleware.server.ts`\n> * `apps/webapp/app/services/queryService.server.ts`\n> * `apps/webapp/app/services/routeBuilders/apiBuilder.server.ts`\n> * `apps/webapp/app/services/routeBuilders/dashboardBuilder.server.ts`\n> * `apps/webapp/app/services/routeBuilders/dashboardBuilder.ts`\n> * `apps/webapp/app/utils/json.ts`\n> * `apps/webapp/app/utils/timeGranularity.ts`\n> * `apps/webapp/app/v3/featureFlags.server.ts`\n> * `apps/webapp/app/v3/featureFlags.ts`\n> * `apps/webapp/app/v3/marqs/types.ts`\n> * `apps/webapp/app/v3/schedules.ts`\n> * `apps/webapp/app/v3/services/aiRunFilterService.server.ts`\n> * `apps/webapp/app/v3/services/replayTaskRun.server.ts`\n> * `apps/webapp/app/v3/utils/zodPubSub.server.ts`\n> * `apps/webapp/app/v3/vercel/vercelProjectIntegrationSchema.ts`\n> * `apps/webapp/package.json`\n> * `internal-packages/clickhouse/package.json`\n> * `internal-packages/clickhouse/src/client/tsql.ts`\n> * `internal-packages/clickhouse/src/tsqlFunctions.test.ts`\n> * `internal-packages/compute/package.json`\n> * `internal-packages/compute/src/types.ts`\n> * `internal-packages/emails/package.json`\n> * `internal-packages/run-engine/package.json`\n> * `internal-packages/run-engine/src/batch-queue/types.ts`\n> * `internal-packages/schedule-engine/package.json`\n> * `internal-packages/tsql/package.json`\n> * `internal-packages/zod-worker/package.json`\n> * `internal-packages/zod-worker/src/index.ts`\n> * `package.json`\n> * `packages/cli-v3/package.json`\n> * `packages/cli-v3/src/cli/common.ts`\n> * `packages/cli-v3/src/commands/analyze.ts`\n> * `packages/cli-v3/src/mcp/tools/agentChat.ts`\n> * `packages/cli-v3/src/utilities/configFiles.ts`\n> * `packages/core/package.json`\n> * `packages/core/src/schemas/eventFilter.ts`\n> * `packages/core/src/schemas/json.ts`\n> * `packages/core/src/v3/apiClient/index.ts`\n> * `packages/core/src/v3/runEngineWorker/supervisor/schemas.ts`\n> * `packages/core/src/v3/schemas/api.ts`\n> * `packages/core/src/v3/schemas/build.ts`\n> * `packages/core/src/v3/schemas/common.ts`\n> * `packages/core/src/v3/schemas/eventFilter.ts`\n> * `packages/core/src/v3/schemas/messages.ts`\n> * `packages/core/src/v3/schemas/openTelemetry.ts`\n> * `packages/core/src/v3/schemas/query.ts`\n> * `packages/core/src/v3/schemas/resources.ts`\n> * `packages/core/src/v3/schemas/runEngine.ts`\n> * `packages/core/src/v3/schemas/schemas.ts`\n> * `packages/core/src/v3/serverOnly/httpServer.ts`\n> * `packages/core/src/v3/types/tools.ts`\n> * `packages/core/src/v3/zodIpc.ts`\n> * `packages/core/src/v3/zodMessageHandler.ts`\n> * `packages/core/src/v3/zodNamespace.ts`\n> * `packages/core/src/v3/zodSocket.ts`\n> * `packages/redis-worker/package.json`\n> * `packages/redis-worker/src/mollifier/schemas.ts`\n> * `packages/redis-worker/src/queue.ts`\n> * `packages/redis-worker/src/worker.ts`\n> * `packages/schema-to-json/package.json`\n> * `packages/trigger-sdk/package.json`\n> \n> </details>\n> \n> \n\n<!-- end of auto-generated comment: review in progress by coderabbit.ai -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n<details>\n<summary>📝 Generate docstrings</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> Create stacked PR\n- [ ] <!-- {\"checkboxId\": \"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98\"} --> Commit on current branch\n\n</details>\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `chore/zod-4`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=triggerdotdev/trigger.dev&utm_content=4039)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n\n<sub>Comment `@coderabbitai help` to get the list of available commands.</sub>\n\n<!-- tips_end -->"},"request":{"retryCount":3,"signal":{},"retries":3,"retryAfter":16}}}

coderabbitai[bot]

This comment was marked as resolved.

carderne added 5 commits June 25, 2026 16:19
Migrate the dashboard form layer from @conform-to 0.9 to the 1.x API.
conform 1.x peer-depends on zod ^3.21 || ^4, so it runs on the current
zod 3 and unblocks the zod 4 upgrade (conform 0.9 cannot bundle against
zod 4, which removed ZodNativeEnum, ZodEffects, and ZodPipeline).
Address CodeRabbit feedback on the conform 1.x migration: use defaultValue
(not value) on hidden inputs so they stay uncontrolled, return the env-var
project-lookup failure as a form-level error, join multi-message field
errors when rendering, and clone alerts.emails before using it as mutable
field-list state.
The schedules and branches add-on purchase modals detected conform
responses with "intent" in fetcher.data, but conform v1's
submission.reply() returns a status field, not intent, so lastResult was
always undefined and server-side errors never rendered. Switch the guard
to "status" in fetcher.data, matching the rest of the migration.
- core: forward the validated/normalized payload (parsedPayload.data)
  from the zod message sender instead of casting the raw input, so zod
  transforms, defaults, and coercions are applied on send
- webapp: reword the feedback type union error to cover all feedback
  types, not just bug/feature
coderabbitai[bot]

This comment was marked as resolved.

The root @conform-to/zod entry is the zod 3 implementation (it imports
ZodBranded/ZodEffects from zod), so it throws at module load under
zod 4.4.3, breaking the auth/invite forms and the e2e suites. Switch all
44 imports to the @conform-to/zod/v4 subpath, which targets zod 4.

Also address review feedback:
- concurrency: use formEnvironments.errorId (not .id) for the FormError
  element id to avoid a duplicate DOM id and keep aria-describedby valid
- team / confirm-basic-details: pass value:false to getInputProps on the
  controlled number/hidden inputs so conform omits defaultValue and the
  inputs stay purely controlled
- branches.archive: join the form.errors string[] for readable output
@carderne carderne marked this pull request as ready for review June 25, 2026 18:37
devin-ai-integration[bot]

This comment was marked as resolved.

…nputs

These hidden inputs supply their own value/defaultValue, so opt out of
conform's auto-derived default (value:false) to keep them as a single
controlled source and avoid a value+defaultValue mix on the same element.
Submissions were already correct (getInputProps emits defaultValue, not
value, for hidden inputs), this just makes the intent explicit and matches
the confirm-basic-details pattern.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 new potential issues.

Open in Devin Review

Comment thread apps/webapp/app/v3/featureFlags.ts
Comment thread packages/redis-worker/src/mollifier/schemas.ts
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