Add default API URL fallback (vertex app) - #3586
Conversation
Introduce getDefaultApiUrl() in envConstants to provide environment-aware default API endpoints (production, staging, localhost). Change getApiBaseUrl() to fall back to this default instead of throwing when NEXT_PUBLIC_API_URL is missing. Update vertex.config to import and use getDefaultApiUrl() for api.baseUrl and publicMeasurementsBaseUrl, ensuring the app has sensible defaults across environments.
|
Warning Review limit reached
More reviews will be available in 53 minutes and 34 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAPI URL resolution now respects environment variables ( ChangesEnvironment-based API URL Configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (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.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/vertex/lib/envConstants.ts`:
- Line 23: The validateEnvironment() required-vars list is inconsistent with
getApiBaseUrl()/getDefaultApiUrl(): remove NEXT_PUBLIC_API_URL from the required
variables in validateEnvironment() so that the validator matches the runtime
fallback; update validateEnvironment() to no longer include
"NEXT_PUBLIC_API_URL" while leaving other required env names untouched and keep
getApiBaseUrl() and getDefaultApiUrl() behavior unchanged.
In `@src/vertex/vertex.config.ts`:
- Line 7: Add a type import for VertexConfigInput at the top of
src/vertex/vertex.config.ts and use it for the config variable (or remove the
explicit annotation); specifically import the exported type symbol
VertexConfigInput from ./core/config/vertex-config (e.g. using an `import type {
VertexConfigInput } from "./core/config/vertex-config"` statement) so the `const
config: VertexConfigInput = { ... }` declaration is valid.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 917bad93-f0fe-48e7-9d92-1b63e8a0e798
📒 Files selected for processing (2)
src/vertex/lib/envConstants.tssrc/vertex/vertex.config.ts
|
New azure vertex changes available for preview here |
1 similar comment
|
New azure vertex changes available for preview here |
Summary of Changes (What does this PR do?)
Status of maturity (all need to be checked before merging):
How should this be manually tested?
What are the relevant tickets?
Screenshots (optional)
Summary by CodeRabbit