feat(automations): host selector for remote environment automations - #10187
feat(automations): host selector for remote environment automations#10187innocarpe wants to merge 0 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Automations page now supports selecting local or runtime environment hosts through a conditional dropdown. Host targets are keyed, parsed, resolved with pending navigation and selection precedence, and used by the shared refresh path. Changing hosts clears selected automation and run state. The host-target utilities and option construction include expanded unit tests covering precedence and generated option shapes. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/components/automations/AutomationsPage.tsx (1)
1003-1048: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPrevent stale refreshes from overwriting a newer host selection.
If a local refresh resolves after a newly selected remote refresh, its state setters restore the local list and key. Track a refresh generation and ignore stale completions.
Proposed fix
+const refreshRequestRef = useRef(0) const refresh = useCallback(async () => { + const requestId = ++refreshRequestRef.current setIsLoading(true) // ... const nextSelectedRuns = nextSelectedId ? await listAutomationRunsForTarget(automationHostTarget, nextSelectedId) : [] + if (requestId !== refreshRequestRef.current) { + return + } setAutomations(nextAutomations) setRuns(nextRuns) setAutomationHostTargetKey(getAutomationHostTargetKey(automationHostTarget)) // ... } finally { - setIsLoading(false) + if (requestId === refreshRequestRef.current) { + setIsLoading(false) + } }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6709ca9c-c506-4f37-91ed-2ecaf1ecc7e2
📒 Files selected for processing (3)
src/renderer/src/components/automations/AutomationsPage.tsxsrc/renderer/src/components/automations/automation-host-client.test.tssrc/renderer/src/components/automations/automation-host-client.ts
Bare "environment:" must not override the global list fallback. Fall through to getAutomationListTarget instead. Addresses CodeRabbit review on stablyai#10187.
Sync update (
|
01d36b3 to
981653f
Compare
|
Accidentally closed when a bad rebase helper force-pushed an empty tip. Restored and continued as #10347. |
Bare "environment:" must not override the global list fallback. Fall through to getAutomationListTarget instead. Addresses CodeRabbit review on stablyai#10187.
Bare "environment:" must not override the global list fallback. Fall through to getAutomationListTarget instead. Addresses CodeRabbit review on stablyai#10187.
Bare "environment:" must not override the global list fallback. Fall through to getAutomationListTarget instead. Addresses CodeRabbit review on stablyai#10187.
Summary
Fixes #9964.
Why
CLI
orca automations list --environment server-01already works, but the UI always listed viaactiveRuntimeEnvironmentId(or local). Projects from a connected remote could show in the sidebar while the Automations page stayed empty.Test plan
automation-host-clientunit tests (resolve host target + option list)