fix: build type env vars#7372
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (36)
💤 Files with no reviewable changes (4)
✅ Files skipped from review due to trivial changes (16)
🚧 Files skipped from review as they are similar to previous changes (15)
WalkthroughThis PR replaces hostname/regex-based environment detection with explicit configuration via ChangesEnvironment configuration & shared utilities
App-specific environment adoption
Explorer adoption
Cowswap frontend & test harness
Workflows, exports, minor tweaks
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer/CI
participant Build as Build (Webpack/Vercel)
participant Next as Next.js Server (middleware/routes)
participant Browser as Browser/Client
participant EnvLib as libs/common-utils
Dev->>Build: Provide env (REACT_APP_ENVIRONMENT / NEXT_PUBLIC_ENVIRONMENT)
Build->>EnvLib: getConfiguredEnvironmentNameFromEnvVars() (at build/test time)
Build->>Next: webpack.DefinePlugin inlines configuredEnvironment
Browser->>Next: Request (middleware/robots/layout call checkEnvironment())
Next->>EnvLib: checkEnvironment() (parameterless, uses configured value)
EnvLib-->>Next: Environment flags (isProd/isDev/isPr/isLocal/isStaging)
Next-->>Browser: Response with X-Robots-Tag / metadata / rendered page
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
124a7bd to
4f004fb
Compare
166a060 to
a2c238b
Compare
ceac06b to
86967f0
Compare
Summary
Sets up new env vars for the 3 apps:
NEXT_PUBLIC_ENVIRONMENTREACT_APP_ENVIRONMENTREACT_APP_ENVIRONMENTIt replaces the existing way of identifying the app via URL regex which is error prone and hard to test.
The app should fail to start if it's not set.
To Test
Cow.fi
[cow-fi][environment]with the envpr.Explorer
[explorer][environment]with the envpr.Cowswap
[COW][Default]with the envpr.Further testing to be done once the app reaches the appropriated envs OR locally by setting the env vars to the respective values
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Chores