Skip to content

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

chore: update task run comment (#8938)

boojack0c06a002cd91
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
index bfd7ade79d..4de16fb42f 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
@@ -1,5 +1,5 @@
<template>
- {{ taskRun.detail }}
+ {{ comment }}
<template v-if="commentLink.link">
<router-link
@@ -17,6 +17,7 @@ import { useI18n } from "vue-i18n";
import { unknownTask } from "@/types";
import {
TaskRun,
+ TaskRun_ExecutionStatus,
TaskRun_Status,
Task_Type,
} from "@/types/proto/v1/rollout_service";
@@ -26,7 +27,7 @@ import {
extractTaskUID,
flattenTaskV1List,
} from "@/utils";
-import { databaseForTask, useIssueContext } from "../../logic";
+import { databaseForTask, specForTask, useIssueContext } from "../../logic";
export type CommentLink = {
title: string;
@@ -40,6 +41,43 @@ const props = defineProps<{
const { issue } = useIssueContext();
const { t } = useI18n();
+const task = computed(() => {
+ const taskUID = extractTaskUID(props.taskRun.name);
+ const task =
+ flattenTaskV1List(issue.value.rolloutEntity).find(
+ (task) => task.uid === taskUID
+ ) ?? unknownTask();
+ return task;
+});
+
+const earliestAllowedTime = computed(() => {
+ const spec = specForTask(issue.value.planEntity, task.value);
+ return spec?.earliestAllowedTime ? spec.earliestAllowedTime.getTime() : null;
+});
+
+const comment = computed(() => {
+ const { taskRun } = props;
+ if (taskRun.status === TaskRun_Status.PENDING) {
+ if (earliestAllowedTime.value) {
+ return t("task-run.status.enqueued-with-rollout-time", {
+ time: new Date(earliestAllowedTime.value).toLocaleString(),
+ });
+ }
+ return t("task-run.status.enqueued");
+ } else if (taskRun.status === TaskRun_Status.RUNNING) {
+ if (taskRun.executionStatus === TaskRun_ExecutionStatus.PRE_EXECUTING) {
+ return t("task-run.status.dumpling-schema-before-executing-sql");
+ } else if (taskRun.executionStatus === TaskRun_ExecutionStatus.EXECUTING) {
+ return t("task-run.status.executing-sql");
+ } else if (
+ taskRun.executionStatus === TaskRun_ExecutionStatus.POST_EXECUTING
+ ) {
+ return t("task-run.status.dumpling-schema-after-executing-sql");
+ }
+ }
+ return taskRun.detail;
+});
+
const commentLink = computed((): CommentLink => {
const { taskRun } = props;
const taskUID = extractTaskUID(taskRun.name);
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 50039d7216..03e3c14f4f 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -380,6 +380,15 @@
"cancel-task": "Cancel task | Cancel tasks",
"created": "Created"
},
+ "task-run": {
+ "status": {
+ "enqueued": "Waiting for execution",
+ "enqueued-with-rollout-time": "Waiting to execute after {time}",
+ "dumpling-schema-before-executing-sql": "Preparing to execute, dumpling Schema",
+ "executing-sql": "Executing SQL",
+ "dumpling-schema-after-executing-sql": "SQL execution completed, dumpling Schema"
+ }
+ },
"banner": {
"update-license": "Update license",
"license-expires": "Your license for {plan} has expired on {expireAt}.",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 09c4ad8b47..846017c8de 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -380,6 +380,15 @@
"cancel-task": "Cancelar tarea | Cancelar tareas",
"created": "Creado"
},
+ "task-run": {
+ "status": {
+ "enqueued": "Esperando a ser ejecutada",
+ "enqueued-with-rollout-time": "Esperando para ejecutar, {time} para ejecutar",
+ "dumpling-schema-before-executing-sql": "Listo para ejecutar, exportando Schema",
+ "executing-sql": "Ejecutando SQL",
+ "dumpling-schema-after-executing-sql": "Ejecución SQL completada, exportando esquema ahora"
+ }
+ },
"banner": {
"update-license": "Actualizar licencia",
"license-expires": "Su licencia para {plan} ha caducado el {expireAt}.",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 8aeececbea..1a8c0501b8 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -378,6 +378,15 @@
"cancel-task": "取消任务",
"created": "创建于"
},
+ "task-run": {
+ "status": {
+ "enqueued": "等待执行",
+ "enqueued-with-rollout-time": "等待执行,{time}后执行",
+ "dumpling-schema-before-executing-sql": "准备执行,正在导出 Schema",
+ "executing-sql": "正在执行 SQL",
+ "dumpling-schema-after-executing-sql": "SQL 执行完毕,正在导出 Schema"
+ }
+ },
"banner": {
"update-license": "更新证书",
"license-expires": "您的{plan}证书已在 {expireAt} 过期",