Skip to content

fix: add global env#5678

Merged
jrgarciadev merged 1 commit into
canaryfrom
fix/turbo-envs
Sep 9, 2025
Merged

fix: add global env#5678
jrgarciadev merged 1 commit into
canaryfrom
fix/turbo-envs

Conversation

@tianenpang
Copy link
Copy Markdown
Contributor

@tianenpang tianenpang commented Sep 9, 2025

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

  • Chores
    • Expanded recognized environment variables for build and task execution to ensure consistent behavior across environments (production, preview, authenticated flows, chat services, and experimental tooling).
    • Improves reliability of environment-driven configuration without altering application functionality.
    • No impact on user-facing features or public APIs.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Sep 9, 2025

⚠️ No Changeset found

Latest commit: 8375809

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Sep 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
heroui Ready Ready Preview Comment Sep 9, 2025 6:18pm
heroui-sb Building Building Preview Comment Sep 9, 2025 6:18pm
heroui-v3-docs Building Building Preview Comment Sep 9, 2025 6:18pm
heroui-v3-storybook Error Error Sep 9, 2025 6:18pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Sep 9, 2025

Walkthrough

Added a globalEnv array to turbo.json with eight environment variables while retaining existing globalDependencies. No task definitions or structure were changed.

Changes

Cohort / File(s) Summary of Changes
Build system config
turbo.json
Introduced globalEnv with: IS_VERCEL_ENV, IS_PREVIEW, IS_VA_ENABLED, ENABLE_EXPERIMENTAL_COREPACK, PLAIN_USER_AUTHENTICATED, IMPORT_API_KEY, CHAT_URL, CHAT_API_URL. Kept globalDependencies unchanged. No task/structure edits.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks (2 passed, 1 warning)

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description includes the base template but leaves critical sections empty: the “Closes #” line has no issue number, and the sections for current behavior, new behavior, breaking change status, and additional information are all blank, which makes it incomplete and unhelpful for reviewers. Please link the relevant issue in the “Closes #” field and fill in the current behavior, new behavior, breaking change status, and any additional details to fully satisfy the repository’s PR description template.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “fix: add global env” directly reflects the main purpose of the changeset by indicating that global environment variables were added, making it both concise and aligned with the core update in turbo.json. It avoids extraneous details and remains clear enough for team members scanning the PR history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/turbo-envs

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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’s globalDependencies to 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

📥 Commits

Reviewing files that changed from the base of the PR and between f9bf3e3 and 8375809.

📒 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 supports globalEnv (added in v1.5)
Confirmed that the globalEnv field is officially supported in this schema, so no changes are needed.

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.

2 participants