-
-
Notifications
You must be signed in to change notification settings - Fork 729
Dev command engine URL now configurable via the webapp #1948
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
|
WalkthroughThis change introduces a new environment variable, Changes
Sequence Diagram(s)sequenceDiagram
participant WebApp
participant API
participant CLI
participant DevSupervisor
WebApp->>API: Request dev config
API-->>WebApp: Respond with { engineUrl }
CLI->>API: Fetch dev config
API-->>CLI: Respond with { engineUrl }
CLI->>DevSupervisor: Pass engineUrl
DevSupervisor->>CLI: Set engineURL via setEngineURL
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 0
🧹 Nitpick comments (1)
packages/cli-v3/src/apiClient.ts (1)
667-669
: Well-implemented setEngineURL methodThe
setEngineURL
method correctly sanitizes the URL by removing trailing slashes, consistent with howapiURL
is handled in the constructor.Consider adding URL validation to ensure the provided engine URL is properly formatted:
private setEngineURL(engineURL: string) { + try { + // Validate URL format + new URL(engineURL); this.engineURL = engineURL.replace(/\/$/, ""); + } catch (error) { + logger.warn(`Invalid engine URL provided: ${engineURL}. Using default.`); + } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/webapp/app/env.server.ts
(1 hunks)apps/webapp/app/routes/engine.v1.dev.config.ts
(1 hunks)packages/cli-v3/src/apiClient.ts
(11 hunks)packages/cli-v3/src/dev/devSupervisor.ts
(1 hunks)packages/core/src/v3/schemas/api.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (2)
apps/webapp/app/routes/engine.v1.dev.config.ts (1)
apps/webapp/app/env.server.ts (1)
env
(719-719)
packages/cli-v3/src/apiClient.ts (3)
packages/core/src/v3/apiClient/core.ts (1)
wrapZodFetch
(713-753)packages/core/src/v3/schemas/api.ts (2)
DevConfigResponseBody
(430-436)DevConfigResponseBody
(437-437)packages/cli-v3/src/dev/devSupervisor.ts (1)
eventSource
(340-367)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
- GitHub Check: units / 🧪 Unit Tests
- GitHub Check: typecheck / typecheck
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (8)
apps/webapp/app/env.server.ts (1)
627-629
: LGTM: Good addition of configurable dev engine URL.The new environment variable is properly documented and uses a sensible default fallback chain (APP_ORIGIN or localhost).
packages/core/src/v3/schemas/api.ts (1)
435-435
: LGTM: Schema update matches the new API contract.The
engineUrl
string property correctly extends theDevConfigResponseBody
schema to support the new configuration option.apps/webapp/app/routes/engine.v1.dev.config.ts (1)
24-24
: LGTM: Correctly exposes the environment variable through the API.The change properly includes the
engineUrl
in the JSON response, making it available to clients.packages/cli-v3/src/dev/devSupervisor.ts (1)
87-87
: LGTM: Properly integrates the configurable engine URL.The change correctly sets the engine URL on the client using the retrieved configuration, completing the end-to-end implementation of the feature.
packages/cli-v3/src/apiClient.ts (4)
48-49
: Good addition of a separate engineURL propertyAdding a distinct property for the engine URL allows for better configurability and separation of concerns, enabling different endpoints for API and engine operations if needed.
56-56
: Appropriate initialization of engineURLInitializing
engineURL
to matchapiURL
by default provides backward compatibility while enabling the new configuration option.
424-424
: Good approach exposing the setEngineURL methodExposing the
setEngineURL
method through thedev
getter follows the established pattern in this class and provides a clean interface for external configuration.
493-493
: Consistent updates to use engineURL for all dev endpoint URLsAll development-related API endpoints have been updated to use the configurable
engineURL
property instead ofapiURL
, ensuring consistency throughout the codebase.Also applies to: 510-510, 564-564, 582-582, 598-598, 616-616, 635-635, 655-655
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.
Nice!
Can be set via a new env var and is returned by the dev config response.
Summary by CodeRabbit