Skip to content

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

feat(fe): plan use specs than steps (#16248)

p0nyfc550b1801e2
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index d5a74f1d83..f08d772e39 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -243,8 +243,12 @@ func (s *PlanService) CreatePlan(ctx context.Context, request *v1pb.CreatePlanRe
if project == nil {
return nil, status.Errorf(codes.NotFound, "project not found for id: %v", projectID)
}
- if err := validateSteps(request.Plan.Steps); err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to validate plan steps, error: %v", err)
+ // Convert steps to specs if needed for backward compatibility
+ convertStepsToSpecs(request.Plan)
+
+ // Validate plan specs
+ if err := validateSpecs(request.Plan.Specs); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to validate plan specs, error: %v", err)
}
planMessage := &store.PlanMessage{
@@ -354,12 +358,9 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
case "deployment":
convertedDeployment := convertPlanDeployment(request.Plan.Deployment)
planUpdate.Deployment = &convertedDeployment
- case "steps":
- // Convert steps to specs for internal storage
- var allSpecs []*storepb.PlanConfig_Spec
- for _, step := range request.GetPlan().GetSteps() {
- allSpecs = append(allSpecs, convertPlanSpecs(step.Specs)...)
- }
+ case "specs":
+ // Use specs directly for internal storage
+ allSpecs := convertPlanSpecs(request.GetPlan().GetSpecs())
planUpdate.Specs = &allSpecs
if _, err := GetPipelineCreate(ctx,
@@ -373,17 +374,10 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
return nil, status.Errorf(codes.InvalidArgument, "failed to get pipeline from the plan, please check you request, error: %v", err)
}
- // Convert old specs back to steps for comparison
- oldSteps := []*v1pb.Plan_Step{{
- Title: "",
- Specs: convertToPlanSpecs(oldPlan.Config.Specs),
- }}
- issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{PlanUID: &oldPlan.UID})
- if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to get issue: %v", err)
- }
+ // Compare specs directly
+ oldSpecs := convertToPlanSpecs(oldPlan.Config.Specs)
- removed, added, updated := diffSpecs(oldSteps, request.Plan.Steps)
+ removed, added, updated := diffSpecsDirectly(oldSpecs, request.Plan.Specs)
if len(removed) > 0 {
return nil, status.Errorf(codes.InvalidArgument, "cannot remove specs from plan")
}
@@ -395,10 +389,8 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
}
oldSpecsByID := make(map[string]*v1pb.Plan_Spec)
- for _, step := range oldSteps {
- for _, spec := range step.Specs {
- oldSpecsByID[spec.Id] = spec
- }
+ for _, spec := range oldSpecs {
+ oldSpecsByID[spec.Id] = spec
}
updatedByID := make(map[string]*v1pb.Plan_Spec)
@@ -406,10 +398,16 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
updatedByID[spec.Id] = spec
}
+ // Handle task updates for specs
tasksMap := map[int]*store.TaskMessage{}
var taskPatchList []*store.TaskPatch
var issueCommentCreates []*store.IssueCommentMessage
+ issue, err := s.store.GetIssueV2(ctx, &store.FindIssueMessage{PlanUID: &oldPlan.UID})
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get issue: %v", err)
+ }
+
if oldPlan.PipelineUID != nil {
tasks, err := s.store.ListTasks(ctx, &store.TaskFind{PipelineID: oldPlan.PipelineUID})
if err != nil {
@@ -1186,98 +1184,75 @@ func convertReleaseFileChangeTypeToPlanSpecType(t storepb.ReleasePayload_File_Ch
// diffSpecs check if there are any specs removed, added or updated in the new plan.
// Only updating sheet is taken into account.
-func diffSpecs(oldSteps []*v1pb.Plan_Step, newSteps []*v1pb.Plan_Step) ([]*v1pb.Plan_Spec, []*v1pb.Plan_Spec, []*v1pb.Plan_Spec) {
- oldSpecs := make(map[string]*v1pb.Plan_Spec)
- newSpecs := make(map[string]*v1pb.Plan_Spec)
+func diffSpecsDirectly(oldSpecs []*v1pb.Plan_Spec, newSpecs []*v1pb.Plan_Spec) ([]*v1pb.Plan_Spec, []*v1pb.Plan_Spec, []*v1pb.Plan_Spec) {
+ oldSpecsMap := make(map[string]*v1pb.Plan_Spec)
+ newSpecsMap := make(map[string]*v1pb.Plan_Spec)
var removed, added, updated []*v1pb.Plan_Spec
- for _, step := range oldSteps {
- for _, spec := range step.Specs {
- oldSpecs[spec.Id] = spec
- }
- }
- for _, step := range newSteps {
- for _, spec := range step.Specs {
- newSpecs[spec.Id] = spec
- }
+
+ for _, spec := range oldSpecs {
+ oldSpecsMap[spec.Id] = spec
}
- for _, step := range oldSteps {
- for _, spec := range step.Specs {
- if _, ok := newSpecs[spec.Id]; !ok {
- removed = append(removed, spec)
- }
- }
+ for _, spec := range newSpecs {
+ newSpecsMap[spec.Id] = spec
}
- for _, step := range newSteps {
- for _, spec := range step.Specs {
- if _, ok := oldSpecs[spec.Id]; !ok {
- added = append(added, spec)
- }
+
+ for _, spec := range oldSpecs {
+ if _, ok := newSpecsMap[spec.Id]; !ok {
+ removed = append(removed, spec)
}
}
- for _, step := range newSteps {
- for _, spec := range step.Specs {
- if oldSpec, ok := oldSpecs[spec.Id]; ok {
- if !cmp.Equal(oldSpec, spec, protocmp.Transform()) {
- updated = append(updated, spec)
- }
- }
+
+ for _, spec := range newSpecs {
+ if oldSpec, ok := oldSpecsMap[spec.Id]; !ok {
+ added = append(added, spec)
+ } else if !cmp.Equal(oldSpec, spec, protocmp.Transform()) {
+ updated = append(updated, spec)
}
}
+
return removed, added, updated
}
-func validateSteps(steps []*v1pb.Plan_Step) error {
- if len(steps) == 0 {
- return errors.Errorf("the plan has zero step")
+func validateSpecs(specs []*v1pb.Plan_Spec) error {
+ if len(specs) == 0 {
+ return errors.Errorf("the plan has zero spec")
}
var databaseTarget, databaseGroupTarget int
configTypeCount := map[string]int{}
seenID := map[string]bool{}
- for _, step := range steps {
- if len(step.Specs) == 0 {
- return errors.Errorf("the plan step has zero spec")
+
+ for _, spec := range specs {
+ id := spec.GetId()
+ if id == "" {
+ return errors.Errorf("spec id cannot be empty")
}
- seenIDInStep := map[string]bool{}
- for _, spec := range step.Specs {
- id := spec.GetId()
- if id == "" {
- return errors.Errorf("spec id cannot be empty")
- }
- if seenID[id] {
- return errors.Errorf("found duplicate spec id %q", spec.GetId())
- }
- seenID[id] = true
- seenIDInStep[id] = true
- switch config := spec.Config.(type) {
- case *v1pb.Plan_Spec_ChangeDatabaseConfig:
- configTypeCount["ChangeDatabaseConfig"]++
- c := config.ChangeDatabaseConfig
- if _, _, err := common.GetInstanceDatabaseID(c.Target); err == nil {
- databaseTarget++
- } else if _, _, err := common.GetProjectIDDatabaseGroupID(c.Target); err == nil {
- databaseGroupTarget++
- } else {
- return errors.Errorf("unknown target %q", c.Target)
- }
- case *v1pb.Plan_Spec_CreateDatabaseConfig:
- configTypeCount["CreateDatabaseConfig"]++
- case *v1pb.Plan_Spec_ExportDataConfig:
- configTypeCount["ExportDataConfig"]++
- default:
- return errors.Errorf("unexpected config type %T", spec.Config)
- }
+ if seenID[id] {
+ return errors.Errorf("found duplicate spec id %v", id)
}
- }
-
- if len(configTypeCount) > 1 {
- msg := "expect one kind of config, found"
- for k, v := range configTypeCount {
- msg += fmt.Sprintf(" %v %v", v, k)
+ seenID[id] = true
+
+ switch config := spec.Config.(type) {
+ case *v1pb.Plan_Spec_CreateDatabaseConfig:
+ configTypeCount["create_database"]++
+ case *v1pb.Plan_Spec_ChangeDatabaseConfig:
+ target := config.ChangeDatabaseConfig.Target
+ if _, _, err := common.GetInstanceDatabaseID(target); err == nil {
+ databaseTarget++
+ configTypeCount["change_database"]++
+ } else if _, _, err := common.GetProjectIDDatabaseGroupID(target); err == nil {
+ databaseGroupTarget++
+ configTypeCount["change_database_group"]++
+ } else {
+ return errors.Errorf("invalid target %v", target)
+ }
+ case *v1pb.Plan_Spec_ExportDataConfig:
+ configTypeCount["export_data"]++
+ default:
+ return errors.Errorf("invalid spec type")
}
- return errors.New(msg)
}
- if databaseGroupTarget > 0 && databaseTarget > 0 {
+ if databaseTarget > 0 && databaseGroupTarget > 0 {
return errors.Errorf("found databaseGroupTarget and databaseTarget, expect only one kind")
}
return nil
@@ -1370,3 +1345,15 @@ func getTaskTypeFromSpec(spec *v1pb.Plan_Spec) (base.TaskType, error) {
}
return "", errors.Errorf("unknown spec config type")
}
+
+// convertStepsToSpecs converts deprecated Plan.Steps to Plan.Specs for backward compatibility.
+//
+//nolint:staticcheck // SA1019: deprecated field used for backward compatibility
+func convertStepsToSpecs(plan *v1pb.Plan) {
+ if len(plan.Specs) == 0 && len(plan.Steps) > 0 {
+ //nolint:staticcheck // SA1019: deprecated field used for backward compatibility
+ for _, step := range plan.Steps {
+ plan.Specs = append(plan.Specs, step.Specs...)
+ }
+ }
+}
diff --git a/backend/api/v1/rollout_service.go b/backend/api/v1/rollout_service.go
index ff8135d7cc..5a42867169 100644
--- a/backend/api/v1/rollout_service.go
+++ b/backend/api/v1/rollout_service.go
@@ -76,15 +76,15 @@ func (s *RolloutService) PreviewRollout(ctx context.Context, request *v1pb.Previ
return nil, status.Errorf(codes.NotFound, "project %q not found", projectID)
}
- if err := validateSteps(request.Plan.Steps); err != nil {
- return nil, status.Errorf(codes.InvalidArgument, "failed to validate plan steps, error: %v", err)
- }
- // Convert steps to specs
- var specs []*storepb.PlanConfig_Spec
- for _, step := range request.Plan.Steps {
- specs = append(specs, convertPlanSpecs(step.Specs)...)
+ convertStepsToSpecs(request.Plan)
+
+ // Validate plan specs
+ if err := validateSpecs(request.Plan.Specs); err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "failed to validate plan specs, error: %v", err)
}
+ specs := convertPlanSpecs(request.Plan.Specs)
+
rollout, err := GetPipelineCreate(ctx, s.store, s.sheetManager, s.dbFactory, request.GetPlan().GetName(), specs, nil /* snapshot */, project)
if err != nil {
return nil, status.Errorf(codes.InvalidArgument, "failed to get pipeline create, error: %v", err)
diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.go
index 16bd51820d..dc8f3bf19a 100644
--- a/backend/api/v1/rollout_service_converter.go
+++ b/backend/api/v1/rollout_service_converter.go
@@ -31,18 +31,12 @@ func convertToPlans(ctx context.Context, s *store.Store, plans []*store.PlanMess
}
func convertToPlan(ctx context.Context, s *store.Store, plan *store.PlanMessage) (*v1pb.Plan, error) {
- // Convert flattened specs back to steps for API compatibility
- steps := []*v1pb.Plan_Step{{
- Title: "",
- Specs: convertToPlanSpecs(plan.Config.Specs),
- }}
-
p := &v1pb.Plan{
Name: common.FormatPlan(plan.ProjectID, plan.UID),
Issue: "",
Title: plan.Name,
Description: plan.Description,
- Steps: steps,
+ Specs: convertToPlanSpecs(plan.Config.Specs), // Use specs field for output
Deployment: convertToPlanDeployment(plan.Config.Deployment),
ReleaseSource: &v1pb.Plan_ReleaseSource{
Release: plan.Config.GetReleaseSource().GetRelease(),
@@ -189,13 +183,11 @@ func convertPlan(plan *v1pb.Plan) *storepb.PlanConfig {
if plan == nil {
return nil
}
- // Flatten specs from steps
- var allSpecs []*storepb.PlanConfig_Spec
- for _, step := range plan.Steps {
- allSpecs = append(allSpecs, convertPlanSpecs(step.Specs)...)
- }
+
+ // At this point, plan.Specs should always be populated
+ // (either originally or converted from steps at API entry point)
return &storepb.PlanConfig{
- Specs: allSpecs,
+ Specs: convertPlanSpecs(plan.Specs),
ReleaseSource: convertPlanReleaseSource(plan.ReleaseSource),
Deployment: nil,
}
diff --git a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
index 5b8c2515ed..bf7dfd50fd 100644
--- a/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
+++ b/frontend/src/components/IssueV1/components/DataExportSection/ExportOptionSection/ExportOptionSection.vue
@@ -89,7 +89,7 @@ const refreshKey = ref(0);
const spec = computed(
() =>
- head(issue.value.planEntity?.steps.flatMap((step) => step.specs)) ||
+ head(issue.value.planEntity?.specs) ||
Plan_Spec.fromPartial({})
);
@@ -131,8 +131,7 @@ const handleSaveEdit = async () => {
}
const distinctSpecIds = new Set([spec.value.id]);
- const specsToPatch = planPatch.steps
- .flatMap((step) => step.specs)
+ const specsToPatch = (planPatch.specs || [])
.filter((spec) => distinctSpecIds.has(spec.id));
for (let i = 0; i < specsToPatch.length; i++) {
const spec = specsToPatch[i];
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
index 7bf3fc79a3..19a2a7ece5 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue
@@ -126,9 +126,7 @@ const issueCreateErrorList = computed(() => {
} else {
if (issue.value.planEntity) {
if (
- !issue.value.planEntity.steps.every((step) =>
- step.specs.every((spec) => isValidSpec(spec))
- )
+ !issue.value.planEntity.specs.every((spec) => isValidSpec(spec))
) {
errorList.push("Missing SQL statement in some specs");
}
@@ -193,10 +191,7 @@ const doCreateIssue = async () => {
// Create sheets for spec configs and update their resource names.
const createSheets = async () => {
- const steps = issue.value.planEntity?.steps ?? [];
- const flattenSpecList = steps.flatMap((step) => {
- return step.specs;
- });
+ const flattenSpecList = issue.value.planEntity?.specs ?? [];
const configWithSheetList: (
| Plan_ChangeDatabaseConfig
diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/ExportArchiveDownloadButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/ExportArchiveDownloadButton.vue
index de69f4ea44..9140cf8238 100644
--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/ExportArchiveDownloadButton.vue
+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/request/ExportArchiveDownloadButton.vue
@@ -55,7 +55,7 @@ const taskRun = computed(() => {
const exportDataConfig = computed(() => {
return (
(
- head(issue.value.planEntity?.steps.flatMap((step) => step.specs)) ||
+ head(issue.value.planEntity?.specs) ||
Plan_Spec.fromPartial({})
).exportDataConfig || Plan_ExportDataConfig.fromPartial({})
);
diff --git a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
index 141abb1869..863f202c51 100644
--- a/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/IssueV1/components/StatementSection/EditorView/EditorView.vue
@@ -627,8 +627,7 @@ const updateStatement = async (statement: string) => {
throw new Error("No valid specs found for the selected task(s).");
}
- const specsToPatch = planPatch.steps
- .flatMap((step) => step.specs)
+ const specsToPatch = (planPatch.specs || [])
.filter((spec) => distinctSpecsIds.has(spec.id));
const sheet = Sheet.fromPartial({
...createEmptyLocalSheet(),
diff --git a/frontend/src/components/IssueV1/logic/utils.ts b/frontend/src/components/IssueV1/logic/utils.ts
index 35a5c2ef0d..bb1c8bdd50 100644
--- a/frontend/src/components/IssueV1/logic/utils.ts
+++ b/frontend/src/components/IssueV1/logic/utils.ts
@@ -22,7 +22,6 @@ import { Task, Task_Status, Task_Type } from "@/types/proto/v1/rollout_service";
import {
defer,
extractDatabaseResourceName,
- flattenSpecList,
flattenTaskV1List,
isValidIssueName,
} from "@/utils";
@@ -130,7 +129,7 @@ export const extractCoreDatabaseInfoFromDatabaseCreateTask = (
export const specForTask = (plan: Plan | undefined, task: Task) => {
if (!plan) return undefined;
- return flattenSpecList(plan).find((spec) => spec.id === task.specId);
+ return (plan.specs || []).find((spec) => spec.id === task.specId);
};
export const stageForTask = (issue: ComposedIssue, task: Task) => {
diff --git a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
index 2396b856f3..a79edcddbd 100644
--- a/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
+++ b/frontend/src/components/Plan/components/HeaderSection/Actions/create/CreateButton.vue
@@ -55,7 +55,6 @@ import type { ComposedPlan } from "@/types/v1/issue/plan";
import {
extractProjectResourceName,
extractSheetUID,
- flattenSpecList,
getSheetStatement,
hasProjectPermissionV2,
planV1Slug,
@@ -79,7 +78,7 @@ const planCreateErrorList = computed(() => {
if (!plan.value.title.trim()) {
errorList.push("Missing plan title");
}
- if (!flattenSpecList(plan.value).every((spec) => isValidSpec(spec))) {
+ if (!(plan.value?.specs || []).every((spec) => isValidSpec(spec))) {
errorList.push("Missing SQL statement in some tasks");
}
@@ -120,12 +119,12 @@ const doCreatePlan = async () => {
// Create sheets for spec configs and update their resource names.
const createSheets = async () => {
- const flattenSpecList = plan.value.steps.flatMap((step) => step.specs);
+ const specs = plan.value.specs || [];
const configWithSheetList: Plan_ChangeDatabaseConfig[] = [];
const pendingCreateSheetMap = new Map<string, Sheet>();
- for (let i = 0; i < flattenSpecList.length; i++) {
- const spec = flattenSpecList[i];
+ for (let i = 0; i < specs.length; i++) {
+ const spec = specs[i];
const config = spec.changeDatabaseConfig;
if (!config) continue;
configWithSheetList.push(config);
diff --git a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostFlagsPanel.vue b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostFlagsPanel.vue
index d183a8a689..5260b421c8 100644
--- a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostFlagsPanel.vue
+++ b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostFlagsPanel.vue
@@ -46,7 +46,6 @@ import ErrorList from "@/components/misc/ErrorList.vue";
import { Drawer, DrawerContent } from "@/components/v2";
import { planServiceClient } from "@/grpcweb";
import { pushNotification } from "@/store";
-import { flattenSpecList } from "@/utils";
import FlagsForm from "./FlagsForm";
import { useGhostSettingContext } from "./context";
@@ -101,7 +100,7 @@ const trySave = async () => {
selectedSpec.value.changeDatabaseConfig.ghostFlags = cloneDeep(flags.value);
} else {
const planPatch = cloneDeep(plan.value);
- const spec = flattenSpecList(planPatch).find((spec) => {
+ const spec = (planPatch?.specs || []).find((spec) => {
return spec.id === selectedSpec.value?.id;
});
if (!planPatch || !spec || !spec.changeDatabaseConfig) {
diff --git a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSwitch.vue b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSwitch.vue
index 4ab1f187b0..f7c517f481 100644
--- a/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSwitch.vue
+++ b/frontend/src/components/Plan/components/Sidebar/GhostSection/GhostSwitch.vue
@@ -24,7 +24,7 @@ import { planServiceClient } from "@/grpcweb";
import { pushNotification } from "@/store";
import { Engine } from "@/types/proto/v1/common";
import { Plan_ChangeDatabaseConfig_Type } from "@/types/proto/v1/plan_service";
-import { engineNameV1, flattenSpecList } from "@/utils";
+import { engineNameV1 } from "@/utils";
import {
allowGhostForDatabase,
MIN_GHOST_SUPPORT_MARIADB_VERSION,
@@ -88,7 +88,7 @@ const toggleChecked = async (on: boolean) => {
: Plan_ChangeDatabaseConfig_Type.MIGRATE;
} else {
const planPatch = cloneDeep(plan.value);
- const spec = flattenSpecList(planPatch).find((spec) => {
+ const spec = (planPatch?.specs || []).find((spec) => {
return spec.id === selectedSpec.value?.id;
});
if (!planPatch || !spec || !spec.changeDatabaseConfig) {
diff --git a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts b/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts
index 46cdd52160..e429f13a39 100644
--- a/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts
+++ b/frontend/src/components/Plan/components/Sidebar/PreBackupSection/context.ts
@@ -26,7 +26,6 @@ import {
type Rollout,
} from "@/types/proto/v1/rollout_service";
import {
- flattenSpecList,
flattenTaskV1List,
hasProjectPermissionV2,
isNullOrUndefined,
@@ -172,7 +171,7 @@ export const providePreBackupSettingContext = (refs: {
}
} else {
const planPatch = cloneDeep(unref(plan));
- const spec = flattenSpecList(planPatch).find((s) => {
+ const spec = (planPatch?.specs || []).find((s) => {
return s.id === selectedSpec.value?.id;
});
if (!planPatch || !spec || !spec.changeDatabaseConfig) {
diff --git a/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue b/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
index 9df20ed326..4990bcf455 100644
--- a/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
+++ b/frontend/src/components/Plan/components/SpecListSection/SpecListSection.vue
@@ -66,7 +66,7 @@ import {
} from "@/store";
import { DEBOUNCE_SEARCH_DELAY } from "@/types";
import type { Advice_Status } from "@/types/proto/v1/sql_service";
-import { flattenSpecList, isDev } from "@/utils";
+import { isDev } from "@/utils";
import {
databaseForSpec,
isDatabaseChangeSpec,
@@ -106,7 +106,7 @@ const state = reactive<LocalState>({
const specBar = ref<HTMLDivElement>();
const specBarScrollState = useVerticalScrollState(specBar, MAX_LIST_HEIGHT);
-const specList = computed(() => flattenSpecList(plan.value));
+const specList = computed(() => plan.value?.specs || []);
const filteredSpecList = computed(() => {
return specList.value.filter((spec) => {
diff --git a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
index 1b311794e1..f77b7dca9e 100644
--- a/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
+++ b/frontend/src/components/Plan/components/StatementSection/EditorView/EditorView.vue
@@ -229,7 +229,6 @@ import {
setSheetStatement,
useInstanceV1EditorLanguage,
getStatementSize,
- flattenSpecList,
} from "@/utils";
import { usePlanSQLCheckContext } from "../../SQLCheckSection/context";
import { useSQLAdviceMarkers } from "../useSQLAdviceMarkers";
@@ -379,7 +378,7 @@ const chooseUpdateStatementTarget = () => {
const targets: Record<Target, Plan_Spec[]> = {
CANCELED: [],
SPEC: [selectedSpec.value],
- ALL: flattenSpecList(plan.value),
+ ALL: plan.value?.specs || [],
};
// If there is only one spec, we don't need to ask the user to choose.
diff --git a/frontend/src/components/Plan/logic/base.ts b/frontend/src/components/Plan/logic/base.ts
index 017c9c79df..11022e83d3 100644
--- a/frontend/src/components/Plan/logic/base.ts
+++ b/frontend/src/components/Plan/logic/base.ts
@@ -7,7 +7,6 @@ import { PROJECT_V1_ROUTE_REVIEW_CENTER_DETAIL } from "@/router/dashboard/projec
import { useUIStateStore } from "@/store";
import type { Plan_Spec } from "@/types/proto/v1/plan_service";
import { emptyPlanSpec } from "@/types/v1/issue/plan";
-import { flattenSpecList } from "@/utils";
import type { PlanContext, PlanEvents } from "./context";
export const useBasePlanContext = (
@@ -21,7 +20,7 @@ export const useBasePlanContext = (
const events: PlanEvents = new Emittery();
- const specs = computed(() => flattenSpecList(plan.value));
+ const specs = computed(() => plan.value?.specs || []);
const selectedSpec = computed((): Plan_Spec => {
// Check if spec is selected from URL.
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue
index 6e284442d8..95cd188adb 100644
--- a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue
@@ -145,11 +145,7 @@ const stepList = computed(() => [
]);
const flattenSpecList = computed((): Plan_Spec[] => {
- return (
- state.previewPlanResult?.plan?.steps.flatMap((step) => {
- return step.specs;
- }) || []
- );
+ return state.previewPlanResult?.plan?.specs || [];
});
const nextButtonErrors = computed(() => {
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/PreviewPlanDetail.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/PreviewPlanDetail.vue
index 61583268c9..d47327fdc5 100644
--- a/frontend/src/components/Release/ReleaseDetail/NavBar/PreviewPlanDetail.vue
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/PreviewPlanDetail.vue
@@ -149,11 +149,7 @@ const databaseStore = useDatabaseV1Store();
const databaseGroupStore = useDBGroupStore();
const flattenSpecList = computed((): Plan_Spec[] => {
- return (
- props.previewPlanResult.plan?.steps.flatMap((step) => {
- return step.specs;
- }) || []
- );
+ return props.previewPlanResult.plan?.specs || [];
});
const targetDatabases = computed(() => {
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index a0f028c9e4..480dad3038 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -144,7 +144,9 @@ export interface Plan {
issue: string;
title: string;
description: string;
+ /** Deprecated: use specs instead. */
steps: Plan_Step[];
+ specs: Plan_Spec[];
/** Format: users/[email protected] */
creator: string;
createTime: Timestamp | undefined;
@@ -1239,6 +1241,7 @@ function createBasePlan(): Plan {
title: "",
description: "",
steps: [],
+ specs: [],
creator: "",
createTime: undefined,
updateTime: undefined,
@@ -1265,6 +1268,9 @@ export const Plan: MessageFns<Plan> = {
for (const v of message.steps) {
Plan_Step.encode(v!, writer.uint32(50).fork()).join();
}
+ for (const v of message.specs) {
+ Plan_Spec.encode(v!, writer.uint32(114).fork()).join();
+ }
if (message.creator !== "") {
writer.uint32(66).string(message.creator);
}
@@ -1333,6 +1339,14 @@ export const Plan: MessageFns<Plan> = {
message.steps.push(Plan_Step.decode(reader, reader.uint32()));
continue;
}
+ case 14: {
+ if (tag !== 114) {
+ break;
+ }
+
+ message.specs.push(Plan_Spec.decode(reader, reader.uint32()));
+ continue;
+ }
case 8: {
if (tag !== 66) {
break;
@@ -1410,6 +1424,9 @@ export const Plan: MessageFns<Plan> = {
if (message.steps?.length) {
obj.steps = message.steps.map((e) => Plan_Step.toJSON(e));
}
+ if (message.specs?.length) {
+ obj.specs = message.specs.map((e) => Plan_Spec.toJSON(e));
+ }
if (message.creator !== "") {
obj.creator = message.creator;
}
@@ -1447,6 +1464,7 @@ export const Plan: MessageFns<Plan> = {
message.title = object.title ?? "";
message.description = object.description ?? "";
message.steps = object.steps?.map((e) => Plan_Step.fromPartial(e)) || [];
+ message.specs = object.specs?.map((e) => Plan_Spec.fromPartial(e)) || [];
message.creator = object.creator ?? "";
message.createTime = (object.createTime !== undefined && object.createTime !== null)
? Timestamp.fromPartial(object.createTime)
diff --git a/frontend/src/types/v1/issue/plan.ts b/frontend/src/types/v1/issue/plan.ts
index 2e8ed7781b..63bf7b5cf7 100644
--- a/frontend/src/types/v1/issue/plan.ts
+++ b/frontend/src/types/v1/issue/plan.ts
@@ -3,7 +3,6 @@ import {
Plan,
PlanCheckRun,
Plan_Spec,
- Plan_Step,
} from "@/types/proto/v1/plan_service";
import { EMPTY_PROJECT_NAME, UNKNOWN_PROJECT_NAME } from "../project";
@@ -33,12 +32,6 @@ export const unknownPlan = (): ComposedPlan => {
};
};
-export const emptyPlanStep = () => {
- return Plan_Step.fromPartial({
- specs: [],
- });
-};
-
export const emptyPlanSpec = () => {
return Plan_Spec.fromPartial({
id: String(EMPTY_ID),
diff --git a/frontend/src/utils/v1/issue/issue.ts b/frontend/src/utils/v1/issue/issue.ts
index e9a55526d2..c4fa7c6ab9 100644
--- a/frontend/src/utils/v1/issue/issue.ts
+++ b/frontend/src/utils/v1/issue/issue.ts
@@ -3,7 +3,6 @@ import slug from "slug";
import { t } from "@/plugins/i18n";
import { EMPTY_ID, UNKNOWN_ID, type ComposedIssue } from "@/types";
import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";
-import type { Plan } from "@/types/proto/v1/plan_service";
import type { Rollout } from "@/types/proto/v1/rollout_service";
import { Task_Type } from "@/types/proto/v1/rollout_service";
@@ -29,10 +28,6 @@ export const flattenTaskV1List = (rollout: Rollout | undefined) => {
return rollout?.stages.flatMap((stage) => stage.tasks) || [];
};
-export const flattenSpecList = (plan: Plan | undefined) => {
- return plan?.steps.flatMap((step) => step.specs) || [];
-};
-
const DATABASE_RELATED_TASK_TYPE_LIST = [
Task_Type.DATABASE_CREATE,
Task_Type.DATABASE_SCHEMA_UPDATE,
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 80236e55fe..20e3bcbdfb 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -11083,6 +11083,11 @@ components:
type: array
items:
$ref: '#/components/schemas/Plan_Step'
+ description: 'Deprecated: use specs instead.'
+ specs:
+ type: array
+ items:
+ $ref: '#/components/schemas/Plan_Spec'
creator:
readOnly: true
type: string
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 0bcf4e5ea3..cbb1fbb7c1 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -7313,7 +7313,8 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| issue | [string](#string) | | The issue associated with the plan. Can be empty. Format: projects/{project}/issues/{issue} |
| title | [string](#string) | | |
| description | [string](#string) | | |
-| steps | [Plan.Step](#bytebase-v1-Plan-Step) | repeated | |
+| steps | [Plan.Step](#bytebase-v1-Plan-Step) | repeated | Deprecated: use specs instead. |
+| specs | [Plan.Spec](#bytebase-v1-Plan-Spec) | repeated | |
| creator | [string](#string) | | Format: users/[email protected] |
| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 8017a279fc..6cebd8653e 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -20411,6 +20411,13 @@ Format: projects/{project}/issues/{issue} </p></td>
<td>steps</td>
<td><a href="#bytebase.v1.Plan.Step">Plan.Step</a></td>
<td>repeated</td>
+ <td><p>Deprecated: use specs instead. </p></td>
+ </tr>
+
+ <tr>
+ <td>specs</td>
+ <td><a href="#bytebase.v1.Plan.Spec">Plan.Spec</a></td>
+ <td>repeated</td>
<td><p> </p></td>
</tr>
diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.go
index 42884820b1..03d6361463 100644
--- a/proto/generated-go/v1/plan_service.pb.go
+++ b/proto/generated-go/v1/plan_service.pb.go
@@ -690,10 +690,12 @@ type Plan struct {
// The issue associated with the plan.
// Can be empty.
// Format: projects/{project}/issues/{issue}
- Issue string `protobuf:"bytes,3,opt,name=issue,proto3" json:"issue,omitempty"`
- Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
- Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
- Steps []*Plan_Step `protobuf:"bytes,6,rep,name=steps,proto3" json:"steps,omitempty"`
+ Issue string `protobuf:"bytes,3,opt,name=issue,proto3" json:"issue,omitempty"`
+ Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
+ Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"`
+ // Deprecated: use specs instead.
+ Steps []*Plan_Step `protobuf:"bytes,6,rep,name=steps,proto3" json:"steps,omitempty"`
+ Specs []*Plan_Spec `protobuf:"bytes,14,rep,name=specs,proto3" json:"specs,omitempty"`
// Format: users/[email protected]
Creator string `protobuf:"bytes,8,opt,name=creator,proto3" json:"creator,omitempty"`
CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
@@ -775,6 +777,13 @@ func (x *Plan) GetSteps() []*Plan_Step {
return nil
}
+func (x *Plan) GetSpecs() []*Plan_Spec {
+ if x != nil {
+ return x.Specs
+ }
+ return nil
+}
+
func (x *Plan) GetCreator() string {
if x != nil {
return x.Creator
@@ -2393,13 +2402,14 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x11UpdatePlanRequest\x12+\n" +
"\x04plan\x18\x01 \x01(\v2\x11.bytebase.v1.PlanB\x04\xe2A\x01\x02R\x04plan\x12A\n" +
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x04\xe2A\x01\x02R\n" +
- "updateMask\"\xc9\x14\n" +
+ "updateMask\"\xf7\x14\n" +
"\x04Plan\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
"\x05issue\x18\x03 \x01(\tR\x05issue\x12\x14\n" +
"\x05title\x18\x04 \x01(\tR\x05title\x12 \n" +
"\vdescription\x18\x05 \x01(\tR\vdescription\x12,\n" +
- "\x05steps\x18\x06 \x03(\v2\x16.bytebase.v1.Plan.StepR\x05steps\x12\x1e\n" +
+ "\x05steps\x18\x06 \x03(\v2\x16.bytebase.v1.Plan.StepR\x05steps\x12,\n" +
+ "\x05specs\x18\x0e \x03(\v2\x16.bytebase.v1.Plan.SpecR\x05specs\x12\x1e\n" +
"\acreator\x18\b \x01(\tB\x04\xe2A\x01\x03R\acreator\x12A\n" +
"\vcreate_time\x18\t \x01(\v2\x1a.google.protobuf.TimestampB\x04\xe2A\x01\x03R\n" +
"createTime\x12A\n" +
@@ -2630,58 +2640,59 @@ var file_v1_plan_service_proto_depIdxs = []int32{
11, // 3: bytebase.v1.UpdatePlanRequest.plan:type_name -> bytebase.v1.Plan
37, // 4: bytebase.v1.UpdatePlanRequest.update_mask:type_name -> google.protobuf.FieldMask
21, // 5: bytebase.v1.Plan.steps:type_name -> bytebase.v1.Plan.Step
- 38, // 6: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp
- 38, // 7: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp
- 23, // 8: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry
- 28, // 9: bytebase.v1.Plan.release_source:type_name -> bytebase.v1.Plan.ReleaseSource
- 27, // 10: bytebase.v1.Plan.deployment:type_name -> bytebase.v1.Plan.Deployment
- 20, // 11: bytebase.v1.ListPlanCheckRunsResponse.plan_check_runs:type_name -> bytebase.v1.PlanCheckRun
- 11, // 12: bytebase.v1.PreviewPlanResponse.plan:type_name -> bytebase.v1.Plan
- 33, // 13: bytebase.v1.PreviewPlanResponse.out_of_order_files:type_name -> bytebase.v1.PreviewPlanResponse.DatabaseFiles
- 33, // 14: bytebase.v1.PreviewPlanResponse.applied_but_modified_files:type_name -> bytebase.v1.PreviewPlanResponse.DatabaseFiles
- 1, // 15: bytebase.v1.PlanCheckRun.type:type_name -> bytebase.v1.PlanCheckRun.Type
- 2, // 16: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status
- 34, // 17: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
- 38, // 18: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
- 22, // 19: bytebase.v1.Plan.Step.specs:type_name -> bytebase.v1.Plan.Spec
- 29, // 20: bytebase.v1.Plan.Spec.spec_release_source:type_name -> bytebase.v1.Plan.SpecReleaseSource
- 24, // 21: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
- 25, // 22: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
- 26, // 23: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
- 0, // 24: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.Type
- 30, // 25: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
- 31, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail
- 39, // 27: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
- 32, // 28: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping
- 3, // 29: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status
- 35, // 30: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
- 36, // 31: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
- 40, // 32: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources
- 41, // 33: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
- 41, // 34: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
- 4, // 35: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
- 5, // 36: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
- 7, // 37: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
- 9, // 38: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
- 10, // 39: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
- 12, // 40: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest
- 14, // 41: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
- 16, // 42: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest
- 18, // 43: bytebase.v1.PlanService.PreviewPlan:input_type -> bytebase.v1.PreviewPlanRequest
- 11, // 44: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
- 6, // 45: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
- 8, // 46: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
- 11, // 47: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
- 11, // 48: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
- 13, // 49: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse
- 15, // 50: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
- 17, // 51: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse
- 19, // 52: bytebase.v1.PlanService.PreviewPlan:output_type -> bytebase.v1.PreviewPlanResponse
- 44, // [44:53] is the sub-list for method output_type
- 35, // [35:44] is the sub-list for method input_type
- 35, // [35:35] is the sub-list for extension type_name
- 35, // [35:35] is the sub-list for extension extendee
- 0, // [0:35] is the sub-list for field type_name
+ 22, // 6: bytebase.v1.Plan.specs:type_name -> bytebase.v1.Plan.Spec
+ 38, // 7: bytebase.v1.Plan.create_time:type_name -> google.protobuf.Timestamp
+ 38, // 8: bytebase.v1.Plan.update_time:type_name -> google.protobuf.Timestamp
+ 23, // 9: bytebase.v1.Plan.plan_check_run_status_count:type_name -> bytebase.v1.Plan.PlanCheckRunStatusCountEntry
+ 28, // 10: bytebase.v1.Plan.release_source:type_name -> bytebase.v1.Plan.ReleaseSource
+ 27, // 11: bytebase.v1.Plan.deployment:type_name -> bytebase.v1.Plan.Deployment
+ 20, // 12: bytebase.v1.ListPlanCheckRunsResponse.plan_check_runs:type_name -> bytebase.v1.PlanCheckRun
+ 11, // 13: bytebase.v1.PreviewPlanResponse.plan:type_name -> bytebase.v1.Plan
+ 33, // 14: bytebase.v1.PreviewPlanResponse.out_of_order_files:type_name -> bytebase.v1.PreviewPlanResponse.DatabaseFiles
+ 33, // 15: bytebase.v1.PreviewPlanResponse.applied_but_modified_files:type_name -> bytebase.v1.PreviewPlanResponse.DatabaseFiles
+ 1, // 16: bytebase.v1.PlanCheckRun.type:type_name -> bytebase.v1.PlanCheckRun.Type
+ 2, // 17: bytebase.v1.PlanCheckRun.status:type_name -> bytebase.v1.PlanCheckRun.Status
+ 34, // 18: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
+ 38, // 19: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
+ 22, // 20: bytebase.v1.Plan.Step.specs:type_name -> bytebase.v1.Plan.Spec
+ 29, // 21: bytebase.v1.Plan.Spec.spec_release_source:type_name -> bytebase.v1.Plan.SpecReleaseSource
+ 24, // 22: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
+ 25, // 23: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
+ 26, // 24: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
+ 0, // 25: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.Type
+ 30, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
+ 31, // 27: bytebase.v1.Plan.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail
+ 39, // 28: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
+ 32, // 29: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping
+ 3, // 30: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status
+ 35, // 31: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
+ 36, // 32: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
+ 40, // 33: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources
+ 41, // 34: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
+ 41, // 35: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
+ 4, // 36: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
+ 5, // 37: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
+ 7, // 38: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
+ 9, // 39: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
+ 10, // 40: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
+ 12, // 41: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest
+ 14, // 42: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
+ 16, // 43: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest
+ 18, // 44: bytebase.v1.PlanService.PreviewPlan:input_type -> bytebase.v1.PreviewPlanRequest
+ 11, // 45: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
+ 6, // 46: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
+ 8, // 47: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
+ 11, // 48: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
+ 11, // 49: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
+ 13, // 50: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse
+ 15, // 51: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
+ 17, // 52: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse
+ 19, // 53: bytebase.v1.PlanService.PreviewPlan:output_type -> bytebase.v1.PreviewPlanResponse
+ 45, // [45:54] is the sub-list for method output_type
+ 36, // [36:45] is the sub-list for method input_type
+ 36, // [36:36] is the sub-list for extension type_name
+ 36, // [36:36] is the sub-list for extension extendee
+ 0, // [0:36] is the sub-list for field type_name
}
func init() { file_v1_plan_service_proto_init() }
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index de6eb1ffef..d018ff77c5 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -229,8 +229,11 @@ message Plan {
string title = 4;
string description = 5;
+ // Deprecated: use specs instead.
repeated Step steps = 6;
+ repeated Spec specs = 14;
+
message Step {
string title = 2;
repeated Spec specs = 1;