fix: add global env#5678
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdded a globalEnv array to turbo.json with eight environment variables while retaining existing globalDependencies. No task definitions or structure were changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches🧪 Generate unit tests
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.
Actionable comments posted: 0
🧹 Nitpick comments (3)
turbo.json (3)
4-13: Trim globalEnv to only variables that deterministically affect build outputs.Including secrets or dev-only toggles increases cache churn and can reduce remote cache hit rates. Reconsider adding items like IMPORT_API_KEY, PLAIN_USER_AUTHENTICATED, ENABLE_EXPERIMENTAL_COREPACK unless they truly change emitted artifacts.
Example (if they are runtime-only):
"globalEnv": [ "IS_VERCEL_ENV", "IS_PREVIEW", "IS_VA_ENABLED", - "ENABLE_EXPERIMENTAL_COREPACK", - "PLAIN_USER_AUTHENTICATED", - "IMPORT_API_KEY", "CHAT_URL", "CHAT_API_URL" ],
4-13: Nit: alphabetize globalEnv for easier diffs."globalEnv": [ - "IS_VERCEL_ENV", - "IS_PREVIEW", - "IS_VA_ENABLED", - "ENABLE_EXPERIMENTAL_COREPACK", - "PLAIN_USER_AUTHENTICATED", - "IMPORT_API_KEY", - "CHAT_URL", - "CHAT_API_URL" + "CHAT_API_URL", + "CHAT_URL", + "ENABLE_EXPERIMENTAL_COREPACK", + "IMPORT_API_KEY", + "IS_PREVIEW", + "IS_VA_ENABLED", + "IS_VERCEL_ENV", + "PLAIN_USER_AUTHENTICATED" ],
3-3: Add pnpm-lock.yaml to globalDependencies
Include your pnpm lockfile in turbo.json’sglobalDependenciesto invalidate caches when dependencies change.Optional refactor:
"globalDependencies": ["tsconfig.json", "pnpm-lock.yaml"]
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
turbo.json(1 hunks)
⏰ 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). (4)
- GitHub Check: Build
- GitHub Check: Continuous Release
- GitHub Check: ESLint
- GitHub Check: TypeScript
🔇 Additional comments (3)
turbo.json (3)
4-13: Good use of Turbo’s globalEnv to fix cache invalidation on env changes.This should make builds correctly bust cache when these variables change.
4-13: Secrets and remote cache hygiene.If you use remote caching, confirm your provider doesn’t store or log raw env values referenced in globalEnv. Keep secrets out unless essential.
4-13: No action required — Turborepo v2.4.4 supportsglobalEnv(added in v1.5)
Confirmed that theglobalEnvfield is officially supported in this schema, so no changes are needed.
Closes #
📝 Description
Fixed the turbo env during build time.
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit