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


##########
airflow-core/src/airflow/ui/src/pages/Run/Header.tsx:
##########
@@ -60,8 +61,16 @@ 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 });

Review Comment:
   Passing dagRunId retrieves the alert definitions from the Dag version that 
created this run, rather than the latest Dag version. The run view uses those 
definitions for alert metadata and, when there are no stored deadline records, 
to check applicability against the run's current type. Stored deadline records 
remain visible regardless of that applicability check.
   
   For example, suppose a manual run is created while an alert applies only to 
scheduled runs. No deadline record is created for that manual run, and its 
Deadline field is hidden. If the filter later includes manual runs, querying 
the latest definitions would make the old run show Met simply because an alert 
now applies and no deadline records exist, even though that alert did not 
monitor the run when it was created. Using the creation version keeps the field 
hidden in this case.
   



-- 
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