Skip to content

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

chore: add warning about previous unrolled stages (#14989)

boojackb93ad4fec434
diff --git a/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
index e7ac2466f9..38f1a9c5a4 100644
--- a/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/IssueReviewActionPanel.vue
@@ -35,15 +35,6 @@
/>
</template>
</ErrorList>
- <div>
- <NCheckbox v-model:checked="performActionAnyway">
- {{
- $t("issue.action-anyway", {
- action: issueReviewActionDisplayName(action),
- })
- }}
- </NCheckbox>
- </div>
</div>
<div class="flex flex-col gap-y-1">
@@ -64,25 +55,42 @@
</div>
</template>
<template #footer>
- <div v-if="action" class="flex justify-end gap-x-3">
- <NButton @click="$emit('close')">
- {{ $t("common.cancel") }}
- </NButton>
+ <div
+ v-if="action"
+ class="w-full flex flex-row justify-between items-center gap-2"
+ >
+ <div>
+ <NCheckbox
+ v-if="showPerformActionAnyway"
+ v-model:checked="performActionAnyway"
+ >
+ {{
+ $t("issue.action-anyway", {
+ action: issueReviewActionDisplayName(action),
+ })
+ }}
+ </NCheckbox>
+ </div>
+ <div class="flex justify-end gap-x-3">
+ <NButton @click="$emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
- <NTooltip :disabled="confirmErrors.length === 0" placement="top">
- <template #trigger>
- <NButton
- :disabled="confirmErrors.length > 0"
- v-bind="confirmButtonProps"
- @click="handleClickConfirm"
- >
- {{ $t("common.confirm") }}
- </NButton>
- </template>
- <template #default>
- <ErrorList :errors="confirmErrors" />
- </template>
- </NTooltip>
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ :disabled="confirmErrors.length > 0"
+ v-bind="confirmButtonProps"
+ @click="handleClickConfirm"
+ >
+ {{ $t("common.confirm") }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
+ </div>
</div>
</template>
</CommonDrawer>
@@ -143,6 +151,10 @@ const database = computed(() =>
databaseForTask(issue.value, selectedTask.value)
);
+const showPerformActionAnyway = computed(() => {
+ return planCheckErrors.value.length > 0;
+});
+
const planCheckErrors = computed(() => {
const errors: string[] = [];
if (props.action === "APPROVE") {
diff --git a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
index 000a1a30a0..c84be581da 100644
--- a/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/IssueStatusActionPanel.vue
@@ -29,15 +29,6 @@
/>
</template>
</ErrorList>
- <div>
- <NCheckbox v-model:checked="performActionAnyway">
- {{
- $t("issue.action-anyway", {
- action: issueStatusActionDisplayName(action),
- })
- }}
- </NCheckbox>
- </div>
</div>
<div class="flex flex-col gap-y-1">
@@ -57,24 +48,41 @@
</div>
</template>
<template #footer>
- <div v-if="action" class="flex justify-end gap-x-3">
- <NButton @click="$emit('close')">
- {{ $t("common.cancel") }}
- </NButton>
- <NTooltip :disabled="confirmErrors.length === 0" placement="top">
- <template #trigger>
- <NButton
- :disabled="confirmErrors.length > 0"
- v-bind="confirmButtonProps"
- @click="handleConfirm(action!, comment)"
- >
- {{ $t("common.confirm") }}
- </NButton>
- </template>
- <template #default>
- <ErrorList :errors="confirmErrors" />
- </template>
- </NTooltip>
+ <div
+ v-if="action"
+ class="w-full flex flex-row justify-between items-center gap-2"
+ >
+ <div>
+ <NCheckbox
+ v-if="showPerformActionAnyway"
+ v-model:checked="performActionAnyway"
+ >
+ {{
+ $t("issue.action-anyway", {
+ action: issueStatusActionDisplayName(action),
+ })
+ }}
+ </NCheckbox>
+ </div>
+ <div class="flex justify-end gap-x-3">
+ <NButton @click="$emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ :disabled="confirmErrors.length > 0"
+ v-bind="confirmButtonProps"
+ @click="handleConfirm(action!, comment)"
+ >
+ {{ $t("common.confirm") }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
+ </div>
</div>
</template>
</CommonDrawer>
@@ -131,6 +139,10 @@ const title = computed(() => {
return "";
});
+const showPerformActionAnyway = computed(() => {
+ return issueStatusActionErrors.value.length > 0;
+});
+
const issueStatusActionErrors = computed(() => {
const tasks = flattenTaskV1List(issue.value.rolloutEntity);
if (tasks.some((task) => task.status === Task_Status.RUNNING)) {
diff --git a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
index 7eddb39c42..5622aa739d 100644
--- a/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
+++ b/frontend/src/components/IssueV1/components/Panel/TaskRolloutActionPanel.vue
@@ -11,17 +11,27 @@
v-if="action"
class="flex flex-col gap-y-4 h-full overflow-y-hidden px-1"
>
- <div
- v-if="stage"
- class="flex flex-col gap-y-1 shrink-0 overflow-y-hidden justify-start"
- >
- <label class="font-medium text-control">
- {{ $t("common.stage") }}
- </label>
- <div class="textinfolabel break-all">
- {{ stage.title }}
+ <template v-if="stage">
+ <NAlert
+ v-if="hasPreviousUnrolledStages"
+ :title="
+ t(
+ 'issue.status-transition.warning.some-previous-stages-are-not-done'
+ )
+ "
+ type="warning"
+ />
+ <div
+ class="flex flex-col gap-y-1 shrink-0 overflow-y-hidden justify-start"
+ >
+ <label class="font-medium text-control">
+ {{ $t("common.stage") }}
+ </label>
+ <div class="textinfolabel break-all">
+ {{ stage.title }}
+ </div>
</div>
- </div>
+ </template>
<div
class="flex flex-col gap-y-1 shrink overflow-y-hidden justify-start"
>
@@ -76,15 +86,6 @@
/>
</template>
</ErrorList>
- <div>
- <NCheckbox v-model:checked="performActionAnyway">
- {{
- $t("issue.action-anyway", {
- action: taskRolloutActionDialogButtonName(action, taskList),
- })
- }}
- </NCheckbox>
- </div>
</div>
<div class="flex flex-col gap-y-1 shrink-0">
@@ -104,25 +105,43 @@
</div>
</template>
<template #footer>
- <div v-if="action" class="flex justify-end gap-x-3">
- <NButton @click="$emit('close')">
- {{ $t("common.cancel") }}
- </NButton>
+ <div
+ v-if="action"
+ class="w-full flex flex-row justify-between items-center gap-x-2"
+ >
+ <div>
+ <NCheckbox
+ v-if="showPerformActionAnyway"
+ v-model:checked="performActionAnyway"
+ >
+ {{
+ $t("issue.action-anyway", {
+ action: taskRolloutActionDialogButtonName(action, taskList),
+ })
+ }}
+ </NCheckbox>
+ </div>
+
+ <div class="flex justify-end gap-x-3">
+ <NButton @click="$emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
- <NTooltip :disabled="confirmErrors.length === 0" placement="top">
- <template #trigger>
- <NButton
- :disabled="confirmErrors.length > 0"
- v-bind="taskRolloutActionButtonProps(action)"
- @click="handleConfirm(action!, comment)"
- >
- {{ taskRolloutActionDialogButtonName(action, taskList) }}
- </NButton>
- </template>
- <template #default>
- <ErrorList :errors="confirmErrors" />
- </template>
- </NTooltip>
+ <NTooltip :disabled="confirmErrors.length === 0" placement="top">
+ <template #trigger>
+ <NButton
+ :disabled="confirmErrors.length > 0"
+ v-bind="taskRolloutActionButtonProps(action)"
+ @click="handleConfirm(action!, comment)"
+ >
+ {{ taskRolloutActionDialogButtonName(action, taskList) }}
+ </NButton>
+ </template>
+ <template #default>
+ <ErrorList :errors="confirmErrors" />
+ </template>
+ </NTooltip>
+ </div>
</div>
</template>
</CommonDrawer>
@@ -131,6 +150,7 @@
<script setup lang="ts">
import { head, uniqBy } from "lodash-es";
import {
+ NAlert,
NButton,
NCheckbox,
NInput,
@@ -156,7 +176,7 @@ import { planCheckRunSummaryForCheckRunList } from "@/components/PlanCheckRun/co
import { rolloutServiceClient } from "@/grpcweb";
import { pushNotification } from "@/store";
import type { Task, TaskRun } from "@/types/proto/v1/rollout_service";
-import { TaskRun_Status } from "@/types/proto/v1/rollout_service";
+import { Task_Status, TaskRun_Status } from "@/types/proto/v1/rollout_service";
import { ErrorList } from "../common";
import CommonDrawer from "./CommonDrawer.vue";
import RolloutTaskDatabaseName from "./RolloutTaskDatabaseName.vue";
@@ -202,6 +222,24 @@ const stage = computed(() => {
return stageForTask(issue.value, firstTask);
});
+const hasPreviousUnrolledStages = computed(() => {
+ if (!stage.value) return false;
+ const stages = issue.value.rolloutEntity?.stages;
+ if (!stages) return false;
+ const stageIndex = stages.findIndex((s) => s.name === stage.value?.name);
+ return stages.slice(0, stageIndex).some((s) =>
+ s.tasks.some(
+ // Done or skipped tasks are considered as rolled.
+ // Otherwise, it's considered as unrolled.
+ (t) => ![Task_Status.DONE, Task_Status.SKIPPED].includes(t.status)
+ )
+ );
+});
+
+const showPerformActionAnyway = computed(() => {
+ return planCheckErrors.value.length > 0 || hasPreviousUnrolledStages.value;
+});
+
const planCheckRunList = computed(() => {
const list = props.taskList.flatMap(getPlanCheckRunsForTask);
return uniqBy(list, (checkRun) => checkRun.name);
@@ -232,8 +270,15 @@ const planCheckErrors = computed(() => {
const confirmErrors = computed(() => {
const errors: string[] = [];
- if (planCheckErrors.value.length > 0 && !performActionAnyway.value) {
- errors.push(...planCheckErrors.value);
+ if (!performActionAnyway.value) {
+ if (planCheckErrors.value.length > 0) {
+ errors.push(...planCheckErrors.value);
+ }
+ if (hasPreviousUnrolledStages.value) {
+ errors.push(
+ t("issue.status-transition.warning.some-previous-stages-are-not-done")
+ );
+ }
}
return errors;
});
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index a2f1d7b95e..c7da522f5f 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1116,6 +1116,9 @@
"note": "Note",
"placeholder": "(Optional) Add a note..."
},
+ "warning": {
+ "some-previous-stages-are-not-done": "Some previous stages are not done."
+ },
"error": {
"some-tasks-are-still-running": "Some tasks are still running"
}
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 1747a1beec..d69b43c57f 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1116,6 +1116,9 @@
"note": "Nota",
"placeholder": "(Opcional) Agregar una nota..."
},
+ "warning": {
+ "some-previous-stages-are-not-done": "Algunas etapas anteriores no están realizadas."
+ },
"error": {
"some-tasks-are-still-running": "Algunas tareas aún se están ejecutando"
}
@@ -3931,4 +3934,4 @@
"last-visit": "Última visita",
"changelog-for-version": "Registro de cambios para {version}"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 79001b1e1e..c2a8452bac 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1116,6 +1116,9 @@
"note": "ノート",
"placeholder": "(オプション) メモを追加します…"
},
+ "warning": {
+ "some-previous-stages-are-not-done": "以前のステージの一部が完了していません。"
+ },
"error": {
"some-tasks-are-still-running": "一部のタスクはまだ実行中です"
}
@@ -3931,4 +3934,4 @@
"last-visit": "最終訪問",
"changelog-for-version": "{version} の変更履歴"
}
-}
+}
\ No newline at end of file
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index b6cd267014..46e338105a 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1116,6 +1116,9 @@
"note": "笔记",
"placeholder": "(可选)添加一段笔记…"
},
+ "warning": {
+ "some-previous-stages-are-not-done": "存在之前的阶段尚未完成。"
+ },
"error": {
"some-tasks-are-still-running": "部分任务仍在运行"
}