fix: show correct stats for remote environments on dashboard#549
fix: show correct stats for remote environments on dashboard#549
Conversation
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
📝 WalkthroughWalkthroughAdded system and Docker services to EnvironmentHandler, introduced GET /:id/docker/info, and centralized system route handling. Updated router to inject new services. Frontend now fetches Docker info via EnvironmentAPI instead of SystemAPI, updating dashboard data retrieval accordingly. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests❌ Error creating Unit Test PR.
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.
Please see the documentation for more information. 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. 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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
backend/internal/api/environment_handler.go(6 hunks)backend/internal/bootstrap/router_bootstrap.go(2 hunks)frontend/src/lib/services/api/environment-api-service.ts(2 hunks)frontend/src/routes/dashboard/+page.svelte(1 hunks)frontend/src/routes/dashboard/+page.ts(2 hunks)
🧰 Additional context used
🪛 GitHub Check: Run Golangci-lint
backend/internal/api/environment_handler.go
[failure] 246-246:
singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
🪛 GitHub Actions: Run Backend Linter
backend/internal/api/environment_handler.go
[error] 246-246: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
⏰ 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). (3)
- GitHub Check: build
- GitHub Check: test
- GitHub Check: Analyze (go)
🔇 Additional comments (10)
frontend/src/lib/services/api/environment-api-service.ts (2)
12-12: Type import for DockerInfo aligns with new endpoint contract.
25-31: New getDockerInfo() is correctly environment-scoped.Endpoint path and return typing look correct. Verification inconclusive: ripgrep returned "No files were searched" when run in the sandbox — confirm locally that no frontend call sites remain by running:
rg -n -S -C1 '\bgetDockerInfo\s*\(' --hidden -g '!.git' -g '!node_modules/**'.frontend/src/routes/dashboard/+page.ts (1)
1-1: Docker info now sourced from environmentAPI — matches backend route.Also applies to: 31-34
backend/internal/bootstrap/router_bootstrap.go (1)
68-69: Injected System and Docker services into EnvironmentHandler.Wiring looks correct in both AgentMode and standard paths.
Please confirm Services initializes System and Docker in both modes to avoid nil dereferences.
Also applies to: 79-79
backend/internal/api/environment_handler.go (5)
36-39: Added systemService and dockerService to EnvironmentHandler.
52-56: New ctor params and assignments wired correctly.Also applies to: 68-71
147-148: New GET /:id/docker/info route registered under environments.
213-216: Local routing now includes system routes — enables docker/info locally.
254-257: GetDockerInfo wrapper correctly delegates via routeRequest.frontend/src/routes/dashboard/+page.svelte (1)
119-119: Switched to environmentAPI.getDockerInfo() — correct for remote envs.Dashboard files call environmentAPI.getDockerInfo (frontend/src/routes/dashboard/+page.svelte:119, frontend/src/routes/dashboard/+page.ts:32); no dashboard references to systemAPI.getDockerInfo (system-api-service.ts only defines it).
File: frontend/src/routes/dashboard/+page.svelte
Lines: 119-119tryCatch(environmentAPI.getDockerInfo()),
|
Warning Docstrings generation is disabled for your repository or organization. |
|
Note Unit test generation is an Early Access feature. Expect some limitations and changes as we gather feedback and continue to improve it. Generating unit tests... This may take up to 20 minutes. |
Fixes: #479
Summary by CodeRabbit
New Features
Refactor