This is an automated email from the ASF dual-hosted git repository.
vatsrahul1001 pushed a commit to branch v3-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-4-test by this push:
new 598ce54cd55 [v3-4-test] Fix 404 error on looped task group breadcrump
and add test (#76050) (#76062)
598ce54cd55 is described below
commit 598ce54cd5582a88c0220d0264187ca444808677
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Oct 30 22:39:23 2026 +0530
[v3-4-test] Fix 404 error on looped task group breadcrump and add test
(#76050) (#76062)
(cherry picked from commit aa3a5239652e884a3510becf2d2a1a3a5cfe056f)
Co-authored-by: Tamara Fingerlin <[email protected]>
---
.../ui/src/layouts/Details/DagBreadcrumb.test.tsx | 21 ++++++++++++++++++++-
.../ui/src/layouts/Details/DagBreadcrumb.tsx | 1 -
2 files changed, 20 insertions(+), 2 deletions(-)
diff --git
a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx
b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx
index c9bf3561994..80215afb5d8 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.test.tsx
@@ -20,11 +20,12 @@ import type { PropsWithChildren } from "react";
import "@testing-library/jest-dom/vitest";
import { cleanup, fireEvent, render, screen, waitFor } from
"@testing-library/react";
-import { MemoryRouter, Route, Routes, useLocation, useMatches } from
"react-router-dom";
+import { MemoryRouter, Route, Routes, matchRoutes, useLocation, useMatches }
from "react-router-dom";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import { DagRunService, DagService, TaskInstanceService } from
"openapi/requests/services.gen";
+import { routerConfig } from "src/router";
import { BaseWrapper } from "src/utils/Wrapper";
import { DagBreadcrumb } from "./DagBreadcrumb";
@@ -57,6 +58,8 @@ vi.mock("src/queries/useLoopFilterOptions", async
(importOriginal) => {
// The msw dag-details handler is pinned to this dag id.
const DAG_ID = "tutorial_taskflow_api";
+const leadsToErrorPage = (href: string) => matchRoutes(routerConfig,
href)?.at(-1)?.route.path === "*";
+
const LocationProbe = () => <div
data-testid="location-pathname">{useLocation().pathname}</div>;
const createWrapper =
@@ -268,6 +271,22 @@ describe("DagBreadcrumb", () => {
expect(screen.getByText("0")).toBeInTheDocument();
});
+ it("never links a looped group page's levels to a missing page", async () =>
{
+ mockLoopOptions = LOOP_PASSES;
+ render(<DagBreadcrumb />, {
+ wrapper: createWrapper(
+ `/dags/${DAG_ID}/runs/run_1/tasks/group/batch`,
+ "/dags/:dagId/runs/:runId/tasks/group/:groupId",
+ ),
+ });
+
+ await screen.findByTestId("switch-iteration");
+
+ for (const link of screen.getAllByRole("link")) {
+ expect(leadsToErrorPage(link.getAttribute("href") ?? "")).toBe(false);
+ }
+ });
+
it("resolves the task instance by the region coordinates in the URL", async
() => {
const regionId = "11111111-1111-4111-8111-111111111111";
const getTaskInstance = vi.spyOn(TaskInstanceService, "getTaskInstance");
diff --git a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx
b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx
index 55e1008f936..20fb4508831 100644
--- a/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx
+++ b/airflow-core/src/airflow/ui/src/layouts/Details/DagBreadcrumb.tsx
@@ -221,7 +221,6 @@ export const DagBreadcrumb = () => {
hasState: true,
key: "group",
state: groupSummary?.state,
- to: `/dags/${dagId}/groups/${groupId}`,
value: groupId,
});
}