Skip to content

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

chore: filter logic (#9126)

Liu Ji4223b600a97b
diff --git a/frontend/src/components/IssueV1/logic/plan-check.ts b/frontend/src/components/IssueV1/logic/plan-check.ts
index 73aa3f6390..670ddc97ea 100644
--- a/frontend/src/components/IssueV1/logic/plan-check.ts
+++ b/frontend/src/components/IssueV1/logic/plan-check.ts
@@ -9,7 +9,7 @@ import {
Task,
Task_Status,
} from "@/types/proto/v1/rollout_service";
-import { databaseForTask } from ".";
+import { databaseForTask, sheetNameForSpec, specForTask } from ".";
export const planSpecHasPlanChecks = (spec: Plan_Spec) => {
if (spec.createDatabaseConfig) {
@@ -28,7 +28,17 @@ export const planSpecHasPlanChecks = (spec: Plan_Spec) => {
export const planCheckRunListForTask = (issue: ComposedIssue, task: Task) => {
const target = databaseForTask(issue, task).name;
- return issue.planCheckRunList.filter((check) => check.target === target);
+ const spec = specForTask(issue.planEntity, task);
+ const sheet = spec ? sheetNameForSpec(spec) : "";
+ return issue.planCheckRunList.filter((check) => {
+ if (sheet && check.sheet) {
+ // If both the task spec and the planCheckRun have `sheet`
+ // filter by sheet and target combination
+ return check.sheet === sheet && check.target === target;
+ }
+ // Otherwise filter by target only
+ return check.target === target;
+ });
};
export const HiddenPlanCheckTypes = new Set<PlanCheckRun_Type>([
diff --git a/frontend/src/components/IssueV1/logic/plan.ts b/frontend/src/components/IssueV1/logic/plan.ts
index 6614fad30f..52f6e5ed8f 100644
--- a/frontend/src/components/IssueV1/logic/plan.ts
+++ b/frontend/src/components/IssueV1/logic/plan.ts
@@ -1,5 +1,9 @@
import { Plan_Spec } from "@/types/proto/v1/rollout_service";
+/**
+ *
+ * @returns empty string if no sheet found
+ */
export const sheetNameForSpec = (spec: Plan_Spec): string => {
return spec.changeDatabaseConfig?.sheet ?? "";
};