Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: show latest task run detail in task table (#16913)

boojackc1fd7dbad515
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue
index a8df3cea69..0d980ed770 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskRunTable.vue
@@ -81,8 +81,8 @@ const columnList = computed((): DataTableColumn<TaskRun>[] => {
},
},
{
- key: "comment",
- title: t("common.comment"),
+ key: "detail",
+ title: t("common.detail"),
render: (taskRun: TaskRun) => {
return <TaskRunComment taskRun={taskRun} />;
},
diff --git a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
index a6d89cb8ae..d395cced40 100644
--- a/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
+++ b/frontend/src/components/Plan/components/RolloutView/TaskTable.vue
@@ -16,6 +16,7 @@
</template>
<script lang="tsx" setup>
+import { head } from "lodash-es";
import { CalendarClockIcon } from "lucide-vue-next";
import type { DataTableColumn } from "naive-ui";
import { NDataTable, NTag, NTooltip } from "naive-ui";
@@ -35,6 +36,7 @@ import {
extractSchemaVersionFromTask,
humanizeTs,
} from "@/utils";
+import { usePlanContextWithRollout } from "../../logic";
import { useRolloutViewContext } from "./context";
const props = withDefaults(
@@ -58,6 +60,7 @@ const { t } = useI18n();
const router = useRouter();
const { project } = useCurrentProjectV1();
const { rollout, mergedStages } = useRolloutViewContext();
+const { taskRuns } = usePlanContextWithRollout();
const taskList = computed(() => {
if (props.taskStatusFilter.length === 0) {
@@ -151,6 +154,14 @@ const rowProps = (task: Task) => {
};
};
+// Get the latest TaskRun for a given task
+const getLatestTaskRun = (task: Task) => {
+ const relatedTaskRuns = taskRuns.value.filter((taskRun) =>
+ taskRun.name.startsWith(task.name + "/taskRuns/")
+ );
+ return head(relatedTaskRuns);
+};
+
const columnList = computed((): DataTableColumn<Task>[] => {
return [
{
@@ -176,13 +187,21 @@ const columnList = computed((): DataTableColumn<Task>[] => {
{
key: "database",
title: t("common.database"),
+ resizable: true,
render: (task) => {
+ const schemaVersion = extractSchemaVersionFromTask(task);
+
return (
<div class="flex items-center gap-2">
<DatabaseDisplay database={task.target} />
<NTag round size="small">
{semanticTaskType(task.type)}
</NTag>
+ {schemaVersion && (
+ <NTag round size="small">
+ {schemaVersion}
+ </NTag>
+ )}
{task.runTime && (
<NTooltip>
{{
@@ -204,6 +223,19 @@ const columnList = computed((): DataTableColumn<Task>[] => {
);
},
},
+ {
+ key: "detail",
+ title: t("common.detail"),
+ ellipsis: true,
+ resizable: true,
+ render: (task) => {
+ const latestTaskRun = getLatestTaskRun(task);
+ if (!latestTaskRun || !latestTaskRun.detail) {
+ return "-";
+ }
+ return latestTaskRun.detail;
+ },
+ },
{
key: "updateTime",
title: t("common.updated-at"),
@@ -217,14 +249,6 @@ const columnList = computed((): DataTableColumn<Task>[] => {
);
},
},
- {
- key: "version",
- title: t("common.version"),
- width: 128,
- render: (task) => {
- return extractSchemaVersionFromTask(task) || "-";
- },
- },
];
});
</script>