Dag Run and Overview Tab Display Deadlines#62195
Dag Run and Overview Tab Display Deadlines#62195imrichardwu wants to merge 18 commits intoapache:mainfrom
Conversation
This commit introduces a new `FailedIcon` component for representing failure states in the UI, along with a plugin for the DurationChart that visually indicates failed indices. The `FailedIcon` is created using Chakra UI's icon system, while the plugin draws a custom icon on the chart for failed data points.
|
@pierrejeambrun this is the PR to actually implement that endpoint you modified in #62374, if you can review when you get time. |
|
@imrichardwu - As I mentioned on Slack, I love how this looks in the screenshot, but the typescript/React stuff is well outside of my comfort zone to approve so I'll leave that for the others. The rendered result looks great to me though! |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Nice PR.
Overall looking good. Just a few suggestions/improvements.
airflow-core/src/airflow/ui/src/components/DurationChart/failedIconPlugin.ts
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/layouts/Details/Grid/constants.ts
Outdated
Show resolved
Hide resolved
|
I am struggling to understand the UX here.
Let me work on an issue for AIP-86's UI to make sure we are thinking this all through and developing enough API endpoints to support it. |
I don't see user having more than a couple. I don't know what the actual average number will be, but my expectation is under 5. That's why I didn't think the pagination was a major miss in his original code, but it can't hurt to have either way. The rest are UI/UX questions which aren't really my forte, I'll let you artists sort that part out, but I'll keep an eye here in case I can help at all. |
|
I wrote up my thoughts over in AIP-86 UI issue. |
5d348eb to
6c32415
Compare
- Introduce CalendarDeadlines component to display deadlines in the calendar view. - Implement DeadlineAlertsBadge to show alerts related to deadlines in the DAG header. - Create DagDeadlines component for overview page to list upcoming and missed deadlines. - Add DeadlineStatus component to show the status of deadlines in the run details. - Enhance i18n support for new deadline-related strings in dag.json.
|
Cool! I like the deadlines in the Overview tab and dag run header. I don't quite get the calendar view one since pending or missed deadlines are not actually in the calendar itself. So I would remove the calendar part for now and just focus on the other two. |
airflow-core/src/airflow/ui/src/pages/Dag/Overview/DagDeadlines.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Adds UI surfacing for DAG run deadlines (Calendar + DAG Overview + Run header) and extends DeadlineAlert serialization to include human-friendly metadata (name/description), aligning with the deadlines UI/API work tracked in #50501.
Changes:
- Add DeadlineAlert
name/descriptionto the Task SDK model and Core serialization/DB persistence. - Add new UI components to display deadline status on the Run header, and deadline alerts/deadlines on DAG pages (Overview + Calendar).
- Add i18n strings for the new UI labels.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| task-sdk/src/airflow/sdk/definitions/deadline.py | Extend DeadlineAlert with optional name/description. |
| providers/common/ai/src/airflow/providers/common/ai/plugins/www/init.py | Add missing package __init__ (license header only). |
| airflow-core/src/airflow/ui/src/pages/Run/Header.tsx | Add “Deadline” stat row in DagRun header. |
| airflow-core/src/airflow/ui/src/pages/Run/DeadlineStatus.tsx | New component to render per-run deadline status (missed/upcoming/met). |
| airflow-core/src/airflow/ui/src/pages/Dag/Overview/Overview.tsx | Insert deadlines widget into DAG Overview tab. |
| airflow-core/src/airflow/ui/src/pages/Dag/Overview/DagDeadlines.tsx | New widget listing pending + recently missed deadlines for a DAG. |
| airflow-core/src/airflow/ui/src/pages/Dag/Header.tsx | Add deadline alerts badge to the DAG header actions. |
| airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx | New popover badge showing configured deadline alerts. |
| airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarDeadlines.tsx | New calendar-period deadlines list (pending + missed). |
| airflow-core/src/airflow/ui/src/pages/Dag/Calendar/Calendar.tsx | Render CalendarDeadlines under the calendar. |
| airflow-core/src/airflow/ui/public/i18n/locales/en/dag.json | Add translations for new deadline UI labels. |
| airflow-core/src/airflow/serialization/encoders.py | Include name/description in deadline alert serialization. |
| airflow-core/src/airflow/serialization/definitions/deadline.py | Add field constants + extend SerializedDeadlineAlert for metadata. |
| airflow-core/src/airflow/serialization/decoders.py | Decode name/description into SerializedDeadlineAlert. |
| airflow-core/src/airflow/models/serialized_dag.py | Persist name/description into deadline_alert DB rows. |
Comments suppressed due to low confidence (1)
airflow-core/src/airflow/serialization/encoders.py:211
- There are existing unit tests around deadline-alert serialization; with the new
name/descriptionfields, it would be good to extend coverage to assert non-null values round-trip (not just that the keys exist). This helps prevent regressions where these fields are dropped in encode/decode.
def encode_deadline_alert(d: DeadlineAlert | SerializedDeadlineAlert) -> dict[str, Any]:
"""
Encode a deadline alert.
:meta private:
"""
from airflow.sdk.serde import serialize
return {
"name": getattr(d, "name", None),
"description": getattr(d, "description", None),
"reference": encode_deadline_reference(d.reference),
"interval": d.interval.total_seconds(),
"callback": serialize(d.callback),
}
airflow-core/src/airflow/ui/src/pages/Dag/Calendar/CalendarDeadlines.tsx
Outdated
Show resolved
Hide resolved
…remove CalendarDeadlines component, and enhance deadline display with new modal and row components.
bbovenzi
left a comment
There was a problem hiding this comment.
Testing this all manually and I find the UX to still be a bit confusing. Let me try to provide some guidance.
-
Let's move all the python work in this PR to a separate PR that we merge before this. Then we can just focus on the UI here.
-
We can't rely on the name and description to tell a user what the alerts and deadlines are. We can do a better job of interpreting the reference and interval. For all cases of Met, Pending, and Missed. We should compare the alert's expected vs the dag run's actual. eg "Expected dag run finish: 1 hr after logical date. Actual dag run finish: 2 hours after logical date".
-
In the dag overview page, let's include the state of the dag run with each deadline so that I can, at a glance, know things like "Running dag with a missed deadline", "Successful run with a missed deadline"
Just showing a dag run id and a date is not sufficient information for a user to know what is going on.
airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx
Outdated
Show resolved
Hide resolved
airflow-core/src/airflow/ui/src/pages/Dag/DeadlineAlertsBadge.tsx
Outdated
Show resolved
Hide resolved
…lerts, and introduce DeadlineStatusModal
… redundant description check
…plify alert retrieval logic
bbovenzi
left a comment
There was a problem hiding this comment.
Thanks for doing the human readable changes. I would still prefer that we split the python and UI changes into separate PRs.
There was a problem hiding this comment.
This file looks like a mistake?
There was a problem hiding this comment.
I split the pr. I should had @ you. And I do not think that is a mistake because the pre commit hook did that. I’m not too sure why cuz I tried getting rid of it every time and it just keeps creating it when I commit. I mention it in my note in the pr because I was kinda confuse why it did that.
There was a problem hiding this comment.
Yes, thanks I reviewed this before I saw your other PR.
There was a problem hiding this comment.
You can make this one change and skip the pre-commit checks with --no-verify
600cb9c to
fd76b5b
Compare
PR scope change, so the branch name is a bit odd, but that's ok.
Implemented Dag run UI and Overview Tab base on the detail's at this PR(#50501 (comment))



Note
blocked by #64926
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.