Repository navigation
feat: show parallel sub-dag runs in timeline - #2093
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTimelineChart now constructs timeline rows via new helpers ( ChangesSub-DAG Timeline Visualization
Sequence DiagramsequenceDiagram
participant UI as TimelineChart UI
participant BuildRows as buildTimelineRows()
participant Hook as useQuery Hook
participant API as Sub-DAG Runs API
participant Render as Renderer
UI->>BuildRows: buildTimelineRows(dagRun, subRunDetails? , nowMs)
BuildRows-->>UI: TimelineRow[] (initial: steps only)
UI->>Render: render initial step rows
UI->>Hook: useQuery(fetch sub-dag-runs, refresh if active)
Hook->>API: GET /dag-runs/{name}/{dagRunId}/sub-dag-runs
API-->>Hook: subRunDetails[]
Hook-->>UI: update subRunsData
UI->>BuildRows: buildTimelineRows(dagRun, subRunsData, nowMs)
BuildRows-->>UI: TimelineRow[] (steps + subdag rows)
UI->>Render: render enriched timeline (rows with dagName, dagRunId, params, status)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 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)
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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
ui/src/features/dags/components/visualization/TimelineChart.tsx (1)
287-326:⚠️ Potential issue | 🟠 Major | ⚡ Quick winInclude sub-run query results in the timeline memo dependencies.
The memo derives
itemsfromsubRunsData?.subRuns(line 290), but the dependency array only includesstatus.nodes. When theuseQuerycall resolves or refreshes with new sub-run data, the memoized values remain stale because the memo doesn't re-calculate. This causes sub-DAG rows and timing information to either never appear or display outdated statuses untilstatus.nodeschanges.🐛 Fix
- }, [status.nodes]); + }, [status.nodes, subRunsData?.subRuns]);🤖 Prompt for 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. In `@ui/src/features/dags/components/visualization/TimelineChart.tsx` around lines 287 - 326, The memo that computes items, timelineStart, timelineEnd and timeMarkers (the useMemo block that calls buildTimelineRows) currently only lists status.nodes in its dependency array, so it must also include the sub-run query data used (subRunsData or subRunsData?.subRuns) and any other values referenced inside (e.g., timeFormat) so the memo recalculates when sub-run results arrive; update the useMemo dependencies to include subRunsData?.subRuns (or subRunsData) and any other referenced props/state to ensure buildTimelineRows runs when sub-run data changes.
🧹 Nitpick comments (1)
ui/src/features/dags/components/visualization/__tests__/timelineItems.test.ts (1)
19-28: ⚡ Quick winAvoid the
as neverescape in this fixture.
statusLabel: 'succeeded' as neversidesteps the generated schema contract, so this test will keep compiling even if the backend enum changes. Please use the generated enum value here instead.♻️ Suggested change
-import { components, NodeStatus, Status, StatusLabel } from '@/api/v1/schema'; +import { + components, + NodeStatus, + NodeStatusLabel, + Status, + StatusLabel, +} from '@/api/v1/schema'; ... - statusLabel: 'succeeded' as never, + statusLabel: NodeStatusLabel.succeeded,As per coding guidelines, "Frontend API types must be generated from OpenAPI spec via
pnpm gen:apito maintain type safety with the backend."🤖 Prompt for 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. In `@ui/src/features/dags/components/visualization/__tests__/timelineItems.test.ts` around lines 19 - 28, The fixture function node(...) is using a type escape with statusLabel: 'succeeded' as never which bypasses the generated API types; replace that literal cast by assigning the proper generated enum value (the enum member exported by the generated API types) to statusLabel in the node(...) return object so the test fails if the backend OpenAPI enum changes, and regenerate/validate types with pnpm gen:api if needed to import the correct enum symbol.
🤖 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.
Outside diff comments:
In `@ui/src/features/dags/components/visualization/TimelineChart.tsx`:
- Around line 287-326: The memo that computes items, timelineStart, timelineEnd
and timeMarkers (the useMemo block that calls buildTimelineRows) currently only
lists status.nodes in its dependency array, so it must also include the sub-run
query data used (subRunsData or subRunsData?.subRuns) and any other values
referenced inside (e.g., timeFormat) so the memo recalculates when sub-run
results arrive; update the useMemo dependencies to include subRunsData?.subRuns
(or subRunsData) and any other referenced props/state to ensure
buildTimelineRows runs when sub-run data changes.
---
Nitpick comments:
In
`@ui/src/features/dags/components/visualization/__tests__/timelineItems.test.ts`:
- Around line 19-28: The fixture function node(...) is using a type escape with
statusLabel: 'succeeded' as never which bypasses the generated API types;
replace that literal cast by assigning the proper generated enum value (the enum
member exported by the generated API types) to statusLabel in the node(...)
return object so the test fails if the backend OpenAPI enum changes, and
regenerate/validate types with pnpm gen:api if needed to import the correct enum
symbol.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: acf66491-ca2f-4280-8209-3449a8258049
📒 Files selected for processing (4)
ui/src/features/dags/components/visualization/TimelineChart.tsxui/src/features/dags/components/visualization/__tests__/TimelineChart.test.tsxui/src/features/dags/components/visualization/__tests__/timelineItems.test.tsui/src/features/dags/components/visualization/timelineItems.ts
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
Testing
pnpm exec vitest run src/features/dags/components/visualization/__tests__/TimelineChart.test.tsx src/features/dags/components/visualization/__tests__/timelineItems.test.tsCloses #2048
Summary by CodeRabbit
New Features
Tests