youngduck98 commented on code in PR #75608:
URL: https://github.com/apache/airflow/pull/75608#discussion_r4380695721


##########
airflow-core/src/airflow/ui/src/pages/Run/Header.tsx:
##########
@@ -60,8 +61,10 @@ export const Header = ({ dagRun }: { readonly dagRun: 
DAGRunResponse }) => {
   const dagId = dagRun.dag_id;
   const dagRunId = dagRun.dag_run_id;
 
-  const { data: alertData } = useDeadlinesServiceGetDagDeadlineAlerts({ dagId 
});
-  const hasDeadlineAlerts = (alertData?.total_entries ?? 0) > 0;
+  const { data: alertData } = useDeadlinesServiceGetDagDeadlineAlerts({ dagId, 
dagRunId, limit: 100 });
+  const hasDeadlineAlerts = (alertData?.deadline_alerts ?? []).some((alert) =>
+    isDeadlineAlertApplicable(alert, dagRun.run_type),
+  );

Review Comment:
   The run header and its modal show all deadline records stored in the 
database for this Dag run, regardless of its current run type. Filtering 
historical records by the current run type could hide a stored missed deadline 
and show Met based only on another applicable alert. If the same run is later 
reprocessed as backfill, displaying these records does not mean that new 
deadlines were created or existing deadlines were updated to evaluate that 
reexecution.
   
   When deadline records exist for the run, we display their status as before. 
Only when there are no deadline records do we check the alert definitions from 
the run's creation version against its current run type: if an alert applies, 
we show Met as before; otherwise, we hide the Deadline field. Changing the 
filter does not delete existing deadline records.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to