diff --git a/airflow/www/static/js/api/useExtraLinks.ts b/airflow/www/static/js/api/useExtraLinks.ts index 3d654e8cbc75d..e4140d7d4c881 100644 --- a/airflow/www/static/js/api/useExtraLinks.ts +++ b/airflow/www/static/js/api/useExtraLinks.ts @@ -34,19 +34,23 @@ export default function useExtraLinks({ executionDate, mapIndex, extraLinks, + tryNumber, }: { dagId: string; taskId: string; executionDate: string; mapIndex?: number | undefined; extraLinks: string[]; + tryNumber?: number | undefined; }) { return useQuery( - ["extraLinks", dagId, taskId, executionDate, mapIndex], + ["extraLinks", dagId, taskId, executionDate, mapIndex, tryNumber], async () => { const data = await Promise.all( extraLinks.map(async (link) => { const definedMapIndex = mapIndex ?? -1; + const tryNumberParam = + tryNumber !== undefined ? `&try_number=${tryNumber}` : ""; const url = `${extraLinksUrl}?task_id=${encodeURIComponent( taskId )}&dag_id=${encodeURIComponent( @@ -55,7 +59,7 @@ export default function useExtraLinks({ executionDate )}&link_name=${encodeURIComponent( link - )}&map_index=${definedMapIndex}`; + )}&map_index=${definedMapIndex}${tryNumberParam}`; try { const datum = await axios.get(url); return { diff --git a/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx b/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx index 1121459b4bfbc..a1f88e96237ce 100644 --- a/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/ExtraLinks.tsx @@ -28,6 +28,7 @@ interface Props { executionDate: string; mapIndex?: number | undefined; extraLinks: string[]; + tryNumber?: number | undefined; } const ExtraLinks = ({ @@ -36,6 +37,7 @@ const ExtraLinks = ({ executionDate, mapIndex, extraLinks, + tryNumber, }: Props) => { const { data: links } = useExtraLinks({ dagId, @@ -43,6 +45,7 @@ const ExtraLinks = ({ executionDate, mapIndex, extraLinks, + tryNumber, }); if (!links?.length) return null; diff --git a/airflow/www/static/js/dag/details/taskInstance/index.tsx b/airflow/www/static/js/dag/details/taskInstance/index.tsx index 204e900ea8974..bb5f63fb5b2a3 100644 --- a/airflow/www/static/js/dag/details/taskInstance/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/index.tsx @@ -106,6 +106,7 @@ const TaskInstance = ({ taskId, runId, mapIndex }: Props) => { mapIndex={mapIndex} executionDate={executionDate} extraLinks={group?.extraLinks} + tryNumber={instance.tryNumber} /> )} {!isMapped && group.extraLinks && ( @@ -114,6 +115,7 @@ const TaskInstance = ({ taskId, runId, mapIndex }: Props) => { dagId={dagId} executionDate={executionDate} extraLinks={group?.extraLinks} + tryNumber={instance.tryNumber} /> )}