Skip to content

feat: show next scheduled dag run in details#1953

Merged
yottahmd merged 5 commits intomainfrom
issue-1950-next-run-details
Apr 2, 2026
Merged

feat: show next scheduled dag run in details#1953
yottahmd merged 5 commits intomainfrom
issue-1950-next-run-details

Conversation

@yottahmd
Copy link
Copy Markdown
Collaborator

@yottahmd yottahmd commented Apr 2, 2026

Summary

  • add scheduler-aware nextRun data to DAG detail and spec API responses
  • render the next scheduled run in the DAG spec attributes panel alongside the configured schedule
  • cover the new API projection and UI rendering with focused tests

Testing

  • go test ./internal/service/frontend/api/v1 -run 'Test(ListDAGsDataPreservesNextRunAcrossSSEPath|GetDAGDetailsAndSpecIncludeNextRun)$' -count=1
  • cd ui && pnpm test src/features/dags/components/dag-editor/__tests__/DAGAttributes.test.tsx src/features/dags/components/dag-details/__tests__/DAGStatusOverview.test.tsx

Closes #1950

Summary by CodeRabbit

  • New Features
    • Scheduled DAGs now display their next planned run time, providing visibility into when each DAG will execute next. Pending overdue one-offs remain visible until consumed.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 2, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9fb6c833-1802-4d49-a526-3914fe5d88c7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds a NextRun timestamp field to DAGDetails that displays the scheduler-aware next planned run time. Changes span API schema definition, backend computation logic with scheduler state integration, and UI display with formatted timestamps.

Changes

Cohort / File(s) Summary
API Schema & Code Generation
api/v1/api.yaml, api/v1/api.gen.go
Added nextRun property to DAGDetails schema with date-time format and description. Generated corresponding *time.Time field in the Go struct with JSON serialization metadata.
Backend Service Logic
internal/service/frontend/api/v1/dags.go
Added projectNextRun and nextRunProjection methods to compute next run times by loading scheduler state and invoking scheduler.NextPlannedRun. Updated GetDAGSpec and getDAGDetailsData to conditionally populate the NextRun field; refactored listDAGsData to use the new projection method.
Backend Tests
internal/service/frontend/api/v1/dags_internal_test.go
Added TestGetDAGDetailsAndSpecIncludeNextRun to verify that NextRun is correctly computed and returned for both GetDAGDetails and GetDAGSpec endpoints using stubbed scheduler state.
Frontend Schema & UI Components
ui/src/api/v1/schema.ts, ui/src/features/dags/components/dag-editor/DAGAttributes.tsx
Updated TypeScript schema to include optional nextRun field. Modified DAGAttributes component to display "Next run" label with formatted timestamp and relative time (dayjs integration) when schedule is present.
Frontend Tests
ui/src/features/dags/components/dag-editor/__tests__/DAGAttributes.test.tsx
Added test suite validating "Next run" rendering with ISO timestamp formatting and relative time display; includes test case for missing nextRun showing fallback "No upcoming run" message.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding display of the next scheduled DAG run in the details view, which is the primary objective.
Linked Issues check ✅ Passed The PR implements all requirements from issue #1950: surfaces next scheduled run timestamp, helps non-cron-familiar users, and allows verification of cron expressions.
Out of Scope Changes check ✅ Passed All changes are scoped to the next-run feature: API schema updates, backend projection logic, and UI rendering with appropriate tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-1950-next-run-details

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
ui/src/features/dags/components/dag-editor/DAGAttributes.tsx (1)

70-71: Align the new “Next run” text with the project color hierarchy tokens.

The newly added block uses semantic foreground tokens rather than the repo’s explicit slate hierarchy rule.

🎨 Suggested adjustment
-              <div className="text-sm text-muted-foreground">
-                <span className="font-medium text-foreground">Next run:</span>{' '}
+              <div className="text-sm text-slate-600 dark:text-slate-400">
+                <span className="font-medium text-slate-800 dark:text-slate-200">Next run:</span>{' '}

As per coding guidelines, "Use text color hierarchy with primary text as text-slate-800 dark:text-slate-200, secondary as text-slate-600 dark:text-slate-400, and muted as text-slate-500 dark:text-slate-500."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/features/dags/components/dag-editor/DAGAttributes.tsx` around lines 70
- 71, Replace the semantic tokens with the repo's explicit slate hierarchy in
DAGAttributes.tsx: change the outer div's "text-sm text-muted-foreground" to the
muted token "text-slate-500 dark:text-slate-500", and change the label span's
"font-medium text-foreground" to the primary token "font-medium text-slate-800
dark:text-slate-200" (leave any following value text as muted/secondary as
appropriate, e.g., "text-slate-600 dark:text-slate-400"). Ensure you update the
className on the div and the span where "Next run:" is rendered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@ui/src/features/dags/components/dag-editor/DAGAttributes.tsx`:
- Around line 70-71: Replace the semantic tokens with the repo's explicit slate
hierarchy in DAGAttributes.tsx: change the outer div's "text-sm
text-muted-foreground" to the muted token "text-slate-500 dark:text-slate-500",
and change the label span's "font-medium text-foreground" to the primary token
"font-medium text-slate-800 dark:text-slate-200" (leave any following value text
as muted/secondary as appropriate, e.g., "text-slate-600 dark:text-slate-400").
Ensure you update the className on the div and the span where "Next run:" is
rendered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9b66b65-67aa-4f6c-8b9d-68d4171afafe

📥 Commits

Reviewing files that changed from the base of the PR and between 01495ae and be9a0c8.

📒 Files selected for processing (7)
  • api/v1/api.gen.go
  • api/v1/api.yaml
  • internal/service/frontend/api/v1/dags.go
  • internal/service/frontend/api/v1/dags_internal_test.go
  • ui/src/api/v1/schema.ts
  • ui/src/features/dags/components/dag-editor/DAGAttributes.tsx
  • ui/src/features/dags/components/dag-editor/__tests__/DAGAttributes.test.tsx

@yottahmd yottahmd merged commit 50d8a8b into main Apr 2, 2026
6 checks passed
@yottahmd yottahmd deleted the issue-1950-next-run-details branch April 2, 2026 15:30
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.98%. Comparing base (01495ae) to head (f42f572).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1953      +/-   ##
==========================================
+ Coverage   67.96%   67.98%   +0.01%     
==========================================
  Files         475      475              
  Lines       61304    61304              
==========================================
+ Hits        41668    41679      +11     
+ Misses      15660    15654       -6     
+ Partials     3976     3971       -5     

see 17 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 01495ae...f42f572. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display when is the next scheduled dag run

1 participant