This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7bc23ef3b56 Fix grid view URL for dynamic task groups (#63205)
7bc23ef3b56 is described below

commit 7bc23ef3b564b0b6d1069411b38aee01473266fe
Author: Subham <[email protected]>
AuthorDate: Tue Mar 10 04:50:32 2026 +0530

    Fix grid view URL for dynamic task groups (#63205)
    
    Dynamic task groups with isMapped=true were getting /mapped appended
    to their URL in the grid view, producing URLs like
    /tasks/group/{groupId}/mapped which has no matching route (404).
    
    The graph view correctly handles this by not appending /mapped for groups.
    This fix adds the same guard to buildTaskInstanceUrl.
    
    closes: #63197
---
 airflow-core/newsfragments/63205.bugfix.rst         |  1 +
 airflow-core/src/airflow/ui/src/utils/links.test.ts | 19 +++++++++++++++++--
 airflow-core/src/airflow/ui/src/utils/links.ts      |  2 +-
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/airflow-core/newsfragments/63205.bugfix.rst 
b/airflow-core/newsfragments/63205.bugfix.rst
new file mode 100644
index 00000000000..7e1781bc8ed
--- /dev/null
+++ b/airflow-core/newsfragments/63205.bugfix.rst
@@ -0,0 +1 @@
+Fix grid view URL for dynamic task groups producing 404 by not appending 
``/mapped`` to group URLs.
diff --git a/airflow-core/src/airflow/ui/src/utils/links.test.ts 
b/airflow-core/src/airflow/ui/src/utils/links.test.ts
index 47dd032ebc5..75d175e22a5 100644
--- a/airflow-core/src/airflow/ui/src/utils/links.test.ts
+++ b/airflow-core/src/airflow/ui/src/utils/links.test.ts
@@ -243,7 +243,7 @@ describe("buildTaskInstanceUrl", () => {
       }),
     ).toBe("/dags/new_dag/runs/new_run/tasks/group/new_group");
 
-    // Groups should never preserve tabs even for mapped groups
+    // Groups should never get /mapped appended — no such route exists for 
task groups
     expect(
       buildTaskInstanceUrl({
         currentPathname: "/dags/old/runs/old/tasks/group/old_group/events",
@@ -254,6 +254,21 @@ describe("buildTaskInstanceUrl", () => {
         runId: "new_run",
         taskId: "new_group",
       }),
-    ).toBe("/dags/new_dag/runs/new_run/tasks/group/new_group/mapped/3");
+    ).toBe("/dags/new_dag/runs/new_run/tasks/group/new_group");
+  });
+
+  it("should not append /mapped for dynamic task groups from grid view", () => 
{
+    // Regression test for https://github.com/apache/airflow/issues/63197
+    // Dynamic task groups have isMapped=true but no route exists for 
group/:groupId/mapped
+    expect(
+      buildTaskInstanceUrl({
+        currentPathname: "/dags/my_dag/runs/run_1/tasks/group/my_group",
+        dagId: "my_dag",
+        isGroup: true,
+        isMapped: true,
+        runId: "run_1",
+        taskId: "my_group",
+      }),
+    ).toBe("/dags/my_dag/runs/run_1/tasks/group/my_group");
   });
 });
diff --git a/airflow-core/src/airflow/ui/src/utils/links.ts 
b/airflow-core/src/airflow/ui/src/utils/links.ts
index 3beafb06afe..23c438721a5 100644
--- a/airflow-core/src/airflow/ui/src/utils/links.ts
+++ b/airflow-core/src/airflow/ui/src/utils/links.ts
@@ -89,7 +89,7 @@ export const buildTaskInstanceUrl = (params: {
 
   let basePath = `/dags/${dagId}/runs/${runId}/tasks/${groupPath}${taskId}`;
 
-  if (isMapped) {
+  if (isMapped && !isGroup) {
     basePath += `/mapped`;
     if (mapIndex !== undefined && mapIndex !== "-1") {
       basePath += `/${mapIndex}`;

Reply via email to