-
Notifications
You must be signed in to change notification settings - Fork 911
use t3-env for WORKFLOWS_RPC_URL #1197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughReplaces REMOTE_WORKFLOW_* env keys with WORKFLOWS_RPC_* (URL optional, SECRET required) and changes the web server’s WorkflowRpcSecret service from an Effect.Config-based redacted mapping to a synchronous provider that uses Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant WebApp as Web App
participant Env as serverEnv()
participant SecretSvc as WorkflowRpcSecret
Note over WebApp,Env: Startup initialization
WebApp->>Env: read WORKFLOWS_RPC_SECRET
Env-->>WebApp: return secret string
WebApp->>SecretSvc: sync provider -> { authSecret: Redacted.make(secret) }
SecretSvc-->>WebApp: service available
Note over SecretSvc: Replaces prior Effect.Config.redacted + Effect.map flow
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (4)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/web/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
apps/web/**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧬 Code graph analysis (1)apps/web/lib/server.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (1)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/web/lib/server.ts (1)
64-67
: Inconsistent migration:WORKFLOWS_RPC_URL
should also useserverEnv()
.The PR migrates to t3-env for workflow configuration, and
WORKFLOWS_RPC_SECRET
now usesserverEnv()
(line 58). However,WORKFLOWS_RPC_URL
still reads from the Effect Config system viaConfig.option()
. This creates an inconsistent approach where some workflow configuration comes from t3-env and some from Effect Config.For consistency and to fully complete the migration indicated by the PR title "use t3-env for WORKFLOWS_RPC_URL", update this to read from
serverEnv()
as well.Apply this diff to use
serverEnv()
consistently:- const url = Option.getOrElse( - yield* Config.option(Config.string("WORKFLOWS_RPC_URL")), - () => "http://127.0.0.1:42169", - ); + const url = serverEnv().WORKFLOWS_RPC_URL ?? "http://127.0.0.1:42169";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/web/lib/server.ts
(2 hunks)packages/env/server.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx}
: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by runningpnpm format
.Use strict TypeScript and avoid any; leverage shared types
Files:
packages/env/server.ts
apps/web/lib/server.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,js,jsx}
: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g.,user-menu.tsx
).
Use PascalCase for React/Solid components.
Files:
packages/env/server.ts
apps/web/lib/server.ts
apps/web/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
On the client, always use
useEffectQuery
oruseEffectMutation
from@/lib/EffectRuntime
; never callEffectRuntime.run*
directly in components.
Files:
apps/web/lib/server.ts
apps/web/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
apps/web/**/*.{ts,tsx}
: Use TanStack Query v5 for all client-side server state and fetching in the web app
Mutations should call Server Actions directly and perform targeted cache updates with setQueryData/setQueriesData
Run server-side effects via the ManagedRuntime from apps/web/lib/server.ts using EffectRuntime.runPromise/runPromiseExit; do not create runtimes ad hoc
Client code should use helpers from apps/web/lib/EffectRuntime.ts (useEffectQuery, useEffectMutation, useRpcClient); never call ManagedRuntime.make inside components
Files:
apps/web/lib/server.ts
🧬 Code graph analysis (1)
apps/web/lib/server.ts (1)
packages/env/server.ts (1)
serverEnv
(84-88)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
- GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
- GitHub Check: Analyze (rust)
🔇 Additional comments (2)
packages/env/server.ts (1)
70-71
: LGTM! Environment schema correctly updated.The new
WORKFLOWS_RPC_URL
(optional) andWORKFLOWS_RPC_SECRET
(required) variables are properly defined and align with the PR objectives to migrate fromREMOTE_WORKFLOW_*
naming.apps/web/lib/server.ts (1)
4-4
: LGTM! Import added correctly.The
serverEnv
import from@cap/env
is properly added to support the new synchronous environment access pattern.
Summary by CodeRabbit
Refactor
Chores