Skip to content

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

fix: display failed plan check runs in UI (#17480)

boojack52bf8a736167
diff --git a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
index ce7ac0c201..bbda194b44 100644
--- a/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
+++ b/frontend/src/components/Plan/components/ChecksView/ChecksView.vue
@@ -125,6 +125,7 @@
</template>
<script setup lang="ts">
+import { create } from "@bufbuild/protobuf";
import type { Timestamp } from "@bufbuild/protobuf/wkt";
import {
CheckCircleIcon,
@@ -142,8 +143,10 @@ import { useI18n } from "vue-i18n";
import { BBSpin } from "@/bbkit";
import {
PlanCheckRun_Result_Status,
+ PlanCheckRun_Status,
PlanCheckRun_Type,
type PlanCheckRun,
+ PlanCheckRun_ResultSchema,
} from "@/types/proto-es/v1/plan_service_pb";
import { humanizeTs } from "@/utils";
import CheckResultItem from "../common/CheckResultItem.vue";
@@ -170,6 +173,11 @@ const statusSummary = computed(() => {
const summary = { error: 0, warning: 0, success: 0 };
for (const checkRun of props.planCheckRuns) {
+ // Count failed plan check runs as errors
+ if (checkRun.status === PlanCheckRun_Status.FAILED) {
+ summary.error++;
+ }
+
for (const result of checkRun.results) {
if (result.status === PlanCheckRun_Result_Status.ERROR) {
summary.error++;
@@ -217,6 +225,14 @@ const filteredCheckRuns = computed(() => {
return props.planCheckRuns.filter((checkRun) => {
// Filter by status - check if any result matches the selected status
if (selectedStatus.value !== undefined) {
+ // If filtering for errors, include failed check runs
+ if (
+ selectedStatus.value === PlanCheckRun_Result_Status.ERROR &&
+ checkRun.status === PlanCheckRun_Status.FAILED
+ ) {
+ return true;
+ }
+
const hasMatchingResult = checkRun.results.some(
(result) => result.status === selectedStatus.value
);
@@ -229,12 +245,30 @@ const filteredCheckRuns = computed(() => {
});
const getFilteredResults = (checkRun: PlanCheckRun) => {
- return checkRun.results.filter((result) => {
+ let results = checkRun.results.filter((result) => {
return (
selectedStatus.value === undefined ||
result.status === selectedStatus.value
);
});
+
+ // For failed check runs, add a synthetic error result if filtering for errors or no filter
+ if (
+ checkRun.status === PlanCheckRun_Status.FAILED &&
+ (selectedStatus.value === undefined ||
+ selectedStatus.value === PlanCheckRun_Result_Status.ERROR)
+ ) {
+ // Create a synthetic error result for the failed check run
+ const syntheticResult = create(PlanCheckRun_ResultSchema, {
+ status: PlanCheckRun_Result_Status.ERROR,
+ title: "Check Failed",
+ content: checkRun.error || "Plan check run failed",
+ code: 0,
+ });
+ results = [syntheticResult, ...results];
+ }
+
+ return results;
};
const getCheckTypeIcon = (type: PlanCheckRun_Type) => {
diff --git a/frontend/src/components/Plan/logic/usePlanCheckStatus.ts b/frontend/src/components/Plan/logic/usePlanCheckStatus.ts
index dcf9d4c551..74257d6e98 100644
--- a/frontend/src/components/Plan/logic/usePlanCheckStatus.ts
+++ b/frontend/src/components/Plan/logic/usePlanCheckStatus.ts
@@ -27,7 +27,7 @@ export const usePlanCheckStatus = (
const statusCount = plan.value.planCheckRunStatusCount || {};
- if (statusCount["ERROR"] > 0) {
+ if (statusCount["ERROR"] > 0 || statusCount["FAILED"] > 0) {
return PlanCheckRun_Result_Status.ERROR;
} else if (statusCount["WARNING"] > 0) {
return PlanCheckRun_Result_Status.WARNING;
@@ -59,9 +59,13 @@ export const usePlanCheckStatus = (
statusCount[
PlanCheckRun_Result_Status[PlanCheckRun_Result_Status.ERROR]
] || 0;
- const total = running + success + warning + error;
+ // Also count FAILED plan check runs as errors
+ const failed =
+ statusCount[PlanCheckRun_Status[PlanCheckRun_Status.FAILED]] || 0;
+ const totalError = error + failed;
+ const total = running + success + warning + totalError;
- return { running, success, warning, error, total };
+ return { running, success, warning, error: totalError, total };
});
const hasAnyStatus = computed(() => {