Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: hide plan check list for certain plan spec types (#7696)
Liu Ji8a2479361073
diff --git a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vueindex 1f4e749d07..703288e389 100644--- a/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue+++ b/frontend/src/components/IssueV1/components/PlanCheckSection/PlanCheckSection.vue@@ -10,7 +10,7 @@</div><PlanCheckBar- v-if="!isCreating"+ v-if="show":allow-run-checks="allowRunChecks":task="selectedTask"class="px-4 py-2"@@ -20,7 +20,11 @@<script lang="ts" setup>import { NButton } from "naive-ui";import { computed } from "vue";-import { useIssueContext } from "@/components/IssueV1/logic";+import {+ planSpecHasPlanChecks,+ specForTask,+ useIssueContext,+} from "@/components/IssueV1/logic";import { rolloutServiceClient } from "@/grpcweb";import { useCurrentUserV1 } from "@/store";import {@@ -33,6 +37,17 @@ import PlanCheckBar from "./PlanCheckBar";const currentUser = useCurrentUserV1();const { isCreating, issue, selectedTask } = useIssueContext();+const show = computed(() => {+ if (isCreating.value) {+ return false;+ }+ const spec = specForTask(issue.value.planEntity, selectedTask.value);+ if (!spec) {+ return false;+ }+ return planSpecHasPlanChecks(spec);+});+const allowRunChecks = computed(() => {// Allowing below users to run plan checks// - the creator of the issuediff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.tsindex 7c35b2ffa3..f7fc1afb03 100644--- a/frontend/src/components/IssueV1/logic/plan-check.ts+++ b/frontend/src/components/IssueV1/logic/plan-check.ts@@ -5,11 +5,36 @@ import {PlanCheckRun_Result_Status,PlanCheckRun_Status,PlanCheckRun_Type,+ Plan_ChangeDatabaseConfig_Type,+ Plan_Spec,Task,Task_Status,} from "@/types/proto/v1/rollout_service";import { databaseForTask, specForTask, targetForSpec } from ".";+export const planSpecHasPlanChecks = (spec: Plan_Spec) => {+ if (spec.createDatabaseConfig) {+ return false;+ }+ if (spec.changeDatabaseConfig !== undefined) {+ if (+ [+ Plan_ChangeDatabaseConfig_Type.BASELINE,+ Plan_ChangeDatabaseConfig_Type.BRANCH,+ ].includes(spec.changeDatabaseConfig.type)+ ) {+ return false;+ }+ return true;+ }+ if (spec.restoreDatabaseConfig !== undefined) {+ if (spec.restoreDatabaseConfig.pointInTime !== undefined) {+ return true; // PITR check+ }+ }+ return false;+};+export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {const spec = specForTask(issue.planEntity, task);// If the task's spec is found, use its target.