Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: fe connect rpc migration (#16722)
p0ny5e731c9eb824
diff --git a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorSQLCheckButton/SchemaEditorSQLCheckButton.vue b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorSQLCheckButton/SchemaEditorSQLCheckButton.vueindex 25377febbd..deb31f9c51 100644--- a/frontend/src/components/AlterSchemaPrepForm/SchemaEditorSQLCheckButton/SchemaEditorSQLCheckButton.vue+++ b/frontend/src/components/AlterSchemaPrepForm/SchemaEditorSQLCheckButton/SchemaEditorSQLCheckButton.vue@@ -16,7 +16,7 @@import { toRef } from "vue";import { SQLCheckButton } from "@/components/SQLCheck";import type { ComposedDatabase } from "@/types";-import { Release_File_ChangeType } from "@/types/proto/v1/release_service";+import { Release_File_ChangeType } from "@/types/proto-es/v1/release_service_pb";import { useSchemaEditorSQLCheck } from "./useSchemaEditorSQLCheck";const props = defineProps<{diff --git a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDashboard.vue b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDashboard.vueindex e0552b47ef..1ef96ddb2d 100644--- a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDashboard.vue+++ b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDashboard.vue@@ -18,7 +18,7 @@ import { computed, onMounted, ref } from "vue";import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";import { useChangelistStore } from "@/store";import type { ComposedProject } from "@/types";-import type { Changelist } from "@/types/proto/v1/changelist_service";+import type { Changelist } from "@/types/proto-es/v1/changelist_service_pb";import { hasProjectPermissionV2 } from "@/utils";import ChangelistDataTable from "./ChangelistDataTable.vue";import CreateChangelistPanel from "./CreateChangelistPanel.vue";diff --git a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vueindex d970dccb4a..e6714a660c 100644--- a/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue+++ b/frontend/src/components/Changelist/ChangelistDashboard/ChangelistDataTable.vue@@ -23,8 +23,8 @@ import { useRouter } from "vue-router";import { BBAvatar } from "@/bbkit";import HumanizeDate from "@/components/misc/HumanizeDate.vue";import { useUserStore } from "@/store";-import { getDateForPbTimestamp } from "@/types";-import type { Changelist } from "@/types/proto/v1/changelist_service";+import { getDateForPbTimestampProtoEs } from "@/types";+import type { Changelist } from "@/types/proto-es/v1/changelist_service_pb";import { extractChangelistResourceName } from "@/utils";import { projectForChangelist } from "../ChangelistDetail/common";@@ -76,7 +76,7 @@ const columnList = computed((): ChangelistDataTableColumn[] => {width: 256,render: (changelist) => {return (- <HumanizeDate date={getDateForPbTimestamp(changelist.updateTime)} />+ <HumanizeDate date={getDateForPbTimestampProtoEs(changelist.updateTime)} />);},},diff --git a/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue b/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vueindex e5f343e8d3..5a1291ce03 100644--- a/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue+++ b/frontend/src/components/Changelist/ChangelistDashboard/CreateChangelistPanel.vue@@ -154,6 +154,7 @@ import { zindexable as vZindexable } from "vdirs";import { computed, reactive, ref, watch } from "vue";import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";+import { create as createProto } from "@bufbuild/protobuf";import { BBSpin } from "@/bbkit";import ErrorList from "@/components/misc/ErrorList.vue";import {@@ -166,9 +167,10 @@ import { pushNotification, useChangelistStore, useSheetV1Store } from "@/store";import type { ResourceId } from "@/types";import type { ComposedProject } from "@/types";import {- Changelist,- Changelist_Change as Change,-} from "@/types/proto/v1/changelist_service";+ ChangelistSchema,+ Changelist_ChangeSchema as ChangeSchema,+ CreateChangelistRequestSchema,+} from "@/types/proto-es/v1/changelist_service_pb";import { Engine } from "@/types/proto-es/v1/common_pb";import { Sheet } from "@/types/proto/v1/sheet_service";import { convertEngineToOld } from "@/utils/v1/common-conversions";@@ -282,19 +284,21 @@ const doCreate = async () => {}));const changes = createdSheets.map((sheet) =>- Change.fromPartial({+ createProto(ChangeSchema, {sheet: sheet.name,}));- const created = await useChangelistStore().createChangelist({- parent: projectName.value,- changelist: Changelist.fromPartial({- description: title.value,- changes,- }),- changelistId: resourceId.value,- });+ const created = await useChangelistStore().createChangelist(+ createProto(CreateChangelistRequestSchema, {+ parent: projectName.value,+ changelist: createProto(ChangelistSchema, {+ description: title.value,+ changes,+ }),+ changelistId: resourceId.value,+ })+ );showCreatePanel.value = false;pushNotification({module: "bytebase",diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vueindex ed152b0aa7..700274e665 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/AddChangePanel.vue@@ -73,6 +73,7 @@<script setup lang="ts">import { asyncComputed } from "@vueuse/core";+import { create } from "@bufbuild/protobuf";import { FileIcon, HistoryIcon } from "lucide-vue-next";import { NButton, NRadio, NRadioGroup } from "naive-ui";import { zindexable as vZindexable } from "vdirs";@@ -86,8 +87,8 @@ import {useChangelogStore,useLocalSheetStore,} from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";-import { Changelist } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";+import { ChangelistSchema } from "@/types/proto-es/v1/changelist_service_pb";import { ChangelogView } from "@/types/proto-es/v1/database_service_pb";import {getChangelistChangeSourceType,@@ -170,10 +171,10 @@ const doAddChange = async () => {await createSheetForPendingAddChange(pendingAddChanges.value[i]));}- const changelistPatch = {- ...Changelist.fromPartial(changelist.value),+ const changelistPatch = create(ChangelistSchema, {+ ...changelist.value,changes: [...changelist.value.changes, ...newChanges],- };+ });await useChangelistStore().patchChangelist(changelistPatch, ["changes"]);pushNotification({module: "bytebase",diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/context.ts b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/context.tsindex 752da386cb..68ef10afa5 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/context.ts+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/context.ts@@ -2,7 +2,7 @@ import Emittery from "emittery";import type { InjectionKey, Ref } from "vue";import { inject, provide, ref } from "vue";import type { Changelist_Change_Source as ChangeSource } from "@/types";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { useChangelistDetailContext } from "../context";import { emptyRawSQLChange } from "./utils";diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vueindex 5b592f26c5..6406168e53 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogChangeItem.vue@@ -54,7 +54,7 @@ import { NButton, NTag } from "naive-ui";import { computed } from "vue";import { RichDatabaseName } from "@/components/v2";import { useChangelogStore, useDatabaseV1ByName } from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { ChangelogSchema } from "@/types/proto-es/v1/database_service_pb";import { extractDatabaseResourceName, extractIssueUID } from "@/utils";import { getChangelogChangeType } from "@/utils/v1/changelog";diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vueindex a516fa5b7d..ab6a41f456 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/form/ChangelogForm.vue@@ -48,6 +48,7 @@import { orderBy } from "lodash-es";import { NCheckbox, NCheckboxGroup } from "naive-ui";import { computed, reactive, watch } from "vue";+import { create } from "@bufbuild/protobuf";import { ChangelogDataTable } from "@/components/Changelog";import { DatabaseSelect } from "@/components/v2";import {@@ -61,9 +62,9 @@ import {EmptyAffectedTable,} from "@/types";import {- Changelist_Change,+ Changelist_ChangeSchema,type Changelist_Change as Change,-} from "@/types/proto/v1/changelist_service";+} from "@/types/proto-es/v1/changelist_service_pb";import type { Changelog } from "@/types/proto-es/v1/database_service_pb";import {Changelog_Status,@@ -134,7 +135,7 @@ const selectedChangelogList = computed<string[]>({[(c) => parseInt(extractIssueUID(c.issue), 10)],["asc"]).map<Change>((changelog) =>- Changelist_Change.fromPartial({+ create(Changelist_ChangeSchema, {sheet: changelog.statementSheet,source: changelog.name,})diff --git a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/utils.ts b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/utils.tsindex 158dc60b90..dc1b6b4412 100644--- a/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/utils.ts+++ b/frontend/src/components/Changelist/ChangelistDetail/AddChangePanel/utils.ts@@ -1,10 +1,11 @@import { reactive } from "vue";+import { create } from "@bufbuild/protobuf";import { useLocalSheetStore } from "@/store";-import { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import { Changelist_ChangeSchema } from "@/types/proto-es/v1/changelist_service_pb";export const emptyRawSQLChange = (project: string) => {return reactive(- Change.fromPartial({+ create(Changelist_ChangeSchema, {sheet: `${project}/sheets/${useLocalSheetStore().nextUID()}`,source: "",})diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ChangeTable.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ChangeTable.vueindex eac6c1109d..7f8164b697 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ChangeTable.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ChangeTable.vue@@ -14,7 +14,7 @@ import { NDataTable } from "naive-ui";import type { DataTableColumn } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import DatabaseForChange from "./DatabaseForChange.vue";import RemoveChangeButton from "./RemoveChangeButton.vue";import ReorderButtons from "./ReorderButtons.vue";diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vueindex cf217ae9f0..292da541ca 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/DatabaseForChange.vue@@ -13,7 +13,7 @@import { asyncComputed } from "@vueuse/core";import { RichDatabaseName } from "@/components/v2";import { useDatabaseV1Store } from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { extractDatabaseResourceName, isChangelogChangeSource } from "@/utils";const props = defineProps<{diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ReorderButtons.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ReorderButtons.vueindex 6a2da203ee..0c10c802b2 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ReorderButtons.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/ReorderButtons.vue@@ -24,7 +24,7 @@<script lang="ts" setup>import { NButton } from "naive-ui";import { computed } from "vue";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";const props = defineProps<{changes: Change[];diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/SQL.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/SQL.vueindex 0819bf3b0c..17b13acd45 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/SQL.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/SQL.vue@@ -13,7 +13,7 @@import { computed } from "vue";import TextOverflowPopover from "@/components/misc/TextOverflowPopover.vue";import { useSheetV1Store } from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { getSheetStatement } from "@/utils";const props = defineProps<{diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vueindex 6b31a0c9b4..d8322f2dae 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangeTable/Source.vue@@ -40,7 +40,7 @@ import { computedAsync } from "@vueuse/core";import { FileIcon, HistoryIcon } from "lucide-vue-next";import { computed } from "vue";import { useChangelogStore } from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { extractIssueUID, getChangelistChangeSourceType } from "@/utils";const props = defineProps<{diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vueindex 4eea918887..f884a60336 100644--- a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue@@ -37,6 +37,7 @@</template><script lang="ts" setup>+import { create } from "@bufbuild/protobuf";import { computed, reactive, watch } from "vue";import { useI18n } from "vue-i18n";import { useRoute } from "vue-router";@@ -44,8 +45,8 @@ import { BBSpin } from "@/bbkit";import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";import { PROJECT_V1_ROUTE_CHANGELIST_DETAIL } from "@/router/dashboard/projectV1";import { pushNotification, useChangelistStore } from "@/store";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";-import { Changelist } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";+import { ChangelistSchema } from "@/types/proto-es/v1/changelist_service_pb";import { getChangelistChangeSourceType } from "@/utils";import AddChangePanel from "./AddChangePanel";import ApplyToDatabasePanel from "./ApplyToDatabasePanel";@@ -68,10 +69,10 @@ const state = reactive({});const patchChanges = async (changes: Change[]) => {- const patch = {- ...Changelist.fromPartial(changelist.value),+ const patch = create(ChangelistSchema, {+ ...changelist.value,changes,- };+ });try {isUpdating.value = true;await useChangelistStore().patchChangelist(patch, ["changes"]);diff --git a/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue b/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vueindex 83ef1d9acd..870df072c7 100644--- a/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/NavBar/ImportButton.vue@@ -20,15 +20,16 @@</template><script setup lang="ts">+import { create } from "@bufbuild/protobuf";import { UploadIcon } from "lucide-vue-next";import { NButton, NTooltip } from "naive-ui";import { useI18n } from "vue-i18n";import UploadFilesButton from "@/components/UploadFilesButton.vue";import { pushNotification, useChangelistStore, useSheetV1Store } from "@/store";import {- Changelist_Change as Change,- Changelist,-} from "@/types/proto/v1/changelist_service";+ Changelist_ChangeSchema,+ ChangelistSchema,+} from "@/types/proto-es/v1/changelist_service_pb";import { Sheet } from "@/types/proto/v1/sheet_service";import { setSheetStatement } from "@/utils";import { useChangelistDetailContext } from "../context";@@ -53,11 +54,11 @@ const onUploadFiles = async (}));const newChanges = createdSheets.map((sheet) =>- Change.fromPartial({+ create(Changelist_ChangeSchema, {sheet: sheet.name,}));- const changelistPatch = Changelist.fromPartial({+ const changelistPatch = create(ChangelistSchema, {...changelist.value,changes: [...changelist.value.changes, ...newChanges],});diff --git a/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue b/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vueindex 836375fdfb..ed6ba27b17 100644--- a/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue+++ b/frontend/src/components/Changelist/ChangelistDetail/NavBar/TitleEditor.vue@@ -18,12 +18,13 @@</template><script setup lang="ts">+import { create } from "@bufbuild/protobuf";import { NInput } from "naive-ui";import type { CSSProperties } from "vue";import { computed, reactive, watch } from "vue";import { useI18n } from "vue-i18n";import { pushNotification, useChangelistStore } from "@/store";-import { Changelist } from "@/types/proto/v1/changelist_service";+import { ChangelistSchema } from "@/types/proto-es/v1/changelist_service_pb";import { useChangelistDetailContext } from "../context";const { t } = useI18n();@@ -63,7 +64,7 @@ const onBlur = async () => {}try {state.isUpdating = true;- const patch = Changelist.fromPartial({+ const patch = create(ChangelistSchema, {...changelist.value,description: state.title,});diff --git a/frontend/src/components/Changelist/ChangelistDetail/NavBar/export.ts b/frontend/src/components/Changelist/ChangelistDetail/NavBar/export.tsindex 4124c54fdb..9efa459d53 100644--- a/frontend/src/components/Changelist/ChangelistDetail/NavBar/export.ts+++ b/frontend/src/components/Changelist/ChangelistDetail/NavBar/export.ts@@ -6,7 +6,7 @@ import {getDateForPbTimestampProtoEs,type Changelist_Change_Source as ChangeSource,} from "@/types";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { ChangelogView } from "@/types/proto-es/v1/database_service_pb";import {escapeFilename,diff --git a/frontend/src/components/Changelist/ChangelistDetail/common.ts b/frontend/src/components/Changelist/ChangelistDetail/common.tsindex cfea2f62c3..af3b71a8f2 100644--- a/frontend/src/components/Changelist/ChangelistDetail/common.ts+++ b/frontend/src/components/Changelist/ChangelistDetail/common.ts@@ -1,6 +1,6 @@import { useProjectV1Store } from "@/store";import { projectNamePrefix } from "@/store/modules/v1/common";-import type { Changelist } from "@/types/proto/v1/changelist_service";+import type { Changelist } from "@/types/proto-es/v1/changelist_service_pb";import { extractProjectResourceName } from "@/utils";export const projectForChangelist = (changelist: Changelist) => {diff --git a/frontend/src/components/Changelist/ChangelistDetail/context.ts b/frontend/src/components/Changelist/ChangelistDetail/context.tsindex 8313aa0267..60c13e3689 100644--- a/frontend/src/components/Changelist/ChangelistDetail/context.ts+++ b/frontend/src/components/Changelist/ChangelistDetail/context.ts@@ -15,7 +15,7 @@ import { unknownChangelist, unknownProject, isValidProjectName } from "@/types";import type {Changelist,Changelist_Change as Change,-} from "@/types/proto/v1/changelist_service";+} from "@/types/proto-es/v1/changelist_service_pb";import {hasPermissionToCreateChangeDatabaseIssueInProject,hasProjectPermissionV2,diff --git a/frontend/src/components/Database/DatabaseRevisionPanel.vue b/frontend/src/components/Database/DatabaseRevisionPanel.vueindex 79163cd6d1..de050ef413 100644--- a/frontend/src/components/Database/DatabaseRevisionPanel.vue+++ b/frontend/src/components/Database/DatabaseRevisionPanel.vue@@ -25,7 +25,6 @@ import { revisionServiceClientConnect } from "@/grpcweb";import { ListRevisionsRequestSchema } from "@/types/proto-es/v1/revision_service_pb";import type { ComposedDatabase } from "@/types";import { useDatabaseDetailContext } from "./context";-import { convertNewRevisionToOld } from "@/utils/v1/revision-conversions";const props = defineProps<{database: ComposedDatabase;@@ -49,7 +48,7 @@ const fetchRevisionList = async ({await revisionServiceClientConnect.listRevisions(request);return {nextPageToken,- list: revisions.map(convertNewRevisionToOld),+ list: revisions,};};</script>diff --git a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vueindex acbe26526f..b3cb1960b4 100644--- a/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue+++ b/frontend/src/components/IssueV1/components/HeaderSection/Actions/create/CreateButton.vue@@ -31,7 +31,7 @@:project="issue.project":database="databaseForTask(project, selectedTask)":advices="- checkResultMap[databaseForTask(project, selectedTask).name].advices+ convertNewAdviceArrayToOld(checkResultMap[databaseForTask(project, selectedTask).name].advices)":affected-rows="checkResultMap[databaseForTask(project, selectedTask).name].affectedRows@@ -79,6 +79,7 @@ import { emitWindowEvent } from "@/plugins";import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";import { useSheetV1Store, useCurrentProjectV1 } from "@/store";import { dialectOfEngineV1, languageOfEngineV1 } from "@/types";+import type { Engine } from "@/types/proto-es/v1/common_pb";import { CreateIssueRequestSchema } from "@/types/proto-es/v1/issue_service_pb";import { CreatePlanRequestSchema } from "@/types/proto-es/v1/plan_service_pb";import {@@ -86,7 +87,6 @@ import {ReleaseFileType,} from "@/types/proto-es/v1/release_service_pb";import { CreateRolloutRequestSchema } from "@/types/proto-es/v1/rollout_service_pb";-import type { Engine } from "@/types/proto-es/v1/common_pb";import { Issue, Issue_Type } from "@/types/proto/v1/issue_service";import type { Plan_ExportDataConfig } from "@/types/proto/v1/plan_service";import { type Plan_ChangeDatabaseConfig } from "@/types/proto/v1/plan_service";@@ -105,6 +105,7 @@ import {sheetNameOfTaskV1,type Defer,} from "@/utils";+import { convertEngineToOld } from "@/utils/v1/common-conversions";import {convertOldIssueToNew,convertNewIssueToOld,@@ -113,11 +114,7 @@ import {convertOldPlanToNew,convertNewPlanToOld,} from "@/utils/v1/plan-conversions";-import { convertEngineToOld } from "@/utils/v1/common-conversions";-import {- convertNewCheckReleaseResponseToOld,- convertOldChangeTypeToNew,-} from "@/utils/v1/release-conversions";+import { convertNewAdviceArrayToOld, convertNewAdviceStatusToOld } from "@/utils/v1/sql-conversions";const MAX_FORMATTABLE_STATEMENT_SIZE = 10000; // 10K characters@@ -350,10 +347,8 @@ const runSQLCheckForIssue = async () => {version: "0",type: ReleaseFileType.VERSIONED,statement: new TextEncoder().encode(statement),- changeType: convertOldChangeTypeToNew(- getSpecChangeType(- specForTask(issue.value.planEntity, selectedTask.value)- )+ changeType: getSpecChangeType(+ specForTask(issue.value.planEntity, selectedTask.value)),},],@@ -361,16 +356,15 @@ const runSQLCheckForIssue = async () => {targets: targets,});const response = await releaseServiceClientConnect.checkRelease(request);- const result = convertNewCheckReleaseResponseToOld(response);// Upsert check result for each target.- for (const r of result?.results || []) {+ for (const r of response.results) {upsertCheckResult(r.target, r);}}for (const checkResult of Object.values(checkResultMap.value)) {const hasErrors = checkResult.advices.some((advice) => {- return advice.status === Advice_Status.ERROR;+ return convertNewAdviceStatusToOld(advice.status) === Advice_Status.ERROR;});// Focus on the first task with error.if (hasErrors) {diff --git a/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue b/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vueindex 03cd67c85a..7ff2339a70 100644--- a/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue+++ b/frontend/src/components/IssueV1/components/Sidebar/ReleaseInfo.vue@@ -9,7 +9,7 @@target="_blank"class="normal-link truncate":class="{- 'line-through opacity-60': release.state === convertStateToOld(State.DELETED),+ 'line-through opacity-60': release.state === State.DELETED,}">{{ release.title || release.name }}@@ -24,7 +24,6 @@ import { specForTask, useIssueContext } from "@/components/IssueV1";import { useReleaseByName } from "@/store";import { isValidReleaseName } from "@/types";import { State } from "@/types/proto-es/v1/common_pb";-import { convertStateToOld } from "@/utils/v1/common-conversions";const { issue, selectedTask } = useIssueContext();diff --git a/frontend/src/components/IssueV1/components/StatementSection/StatementSection.vue b/frontend/src/components/IssueV1/components/StatementSection/StatementSection.vueindex 16d6033a68..2bef2d7af1 100644--- a/frontend/src/components/IssueV1/components/StatementSection/StatementSection.vue+++ b/frontend/src/components/IssueV1/components/StatementSection/StatementSection.vue@@ -13,6 +13,7 @@ import { usePlanSQLCheckContext } from "@/components/Plan/components/SQLCheckSecimport { databaseForTask } from "@/components/Rollout/RolloutDetail";import { useCurrentProjectV1 } from "@/store";import { TaskTypeListWithStatement } from "@/types";+import { convertNewAdviceArrayToOld } from "@/utils/v1/sql-conversions";import { isValidTaskName } from "@/utils";import { useEventListener } from "@vueuse/core";import { computed, nextTick, ref } from "vue";@@ -31,7 +32,8 @@ const editorViewRef = ref<InstanceType<typeof EditorView>>();const advices = computed(() => {const database = databaseForTask(project.value, selectedTask.value);- return resultMap.value[database.name]?.advices || [];+ const newAdvices = resultMap.value[database.name]?.advices || [];+ return convertNewAdviceArrayToOld(newAdvices);});type ViewMode = "NONE" | "EDITOR";diff --git a/frontend/src/components/IssueV1/components/TaskListSection/filter.ts b/frontend/src/components/IssueV1/components/TaskListSection/filter.tsindex 9c1457741a..dee4b9967c 100644--- a/frontend/src/components/IssueV1/components/TaskListSection/filter.ts+++ b/frontend/src/components/IssueV1/components/TaskListSection/filter.ts@@ -1,7 +1,8 @@import { planCheckRunSummaryForCheckRunList } from "@/components/PlanCheckRun/common";-import type { CheckReleaseResponse_CheckResult } from "@/types/proto/v1/release_service";+import type { CheckReleaseResponse_CheckResult } from "@/types/proto-es/v1/release_service_pb";import type { Task, Task_Status } from "@/types/proto/v1/rollout_service";import { Advice_Status } from "@/types/proto/v1/sql_service";+import { convertNewAdviceStatusToOld } from "@/utils/v1/sql-conversions";import { type IssueContext } from "../../logic";export const filterTask = (@@ -31,7 +32,7 @@ export const filterTask = (}return (result &&- result.advices.some((advice) => advice.status === adviceStatus)+ result.advices.some((advice) => convertNewAdviceStatusToOld(advice.status) === adviceStatus));} else {const summary = planCheckRunSummaryForCheckRunList(diff --git a/frontend/src/components/IssueV1/components/TaskStatusIcon.vue b/frontend/src/components/IssueV1/components/TaskStatusIcon.vueindex d7a670c077..8b8dbb6859 100644--- a/frontend/src/components/IssueV1/components/TaskStatusIcon.vue+++ b/frontend/src/components/IssueV1/components/TaskStatusIcon.vue@@ -65,6 +65,7 @@ import { PlanCheckRun_Result_Status } from "@/types/proto/v1/plan_service";import type { Task } from "@/types/proto/v1/rollout_service";import { Task_Status } from "@/types/proto/v1/rollout_service";import { Advice_Status } from "@/types/proto/v1/sql_service";+import { convertNewAdviceStatusToOld } from "@/utils/v1/sql-conversions";import { planCheckStatusForTask, useIssueContext } from "../logic";const props = defineProps<{@@ -87,13 +88,13 @@ const checkStatus = computed(() => {if (checkResult.advices.some(- (advice) => advice.status === Advice_Status.ERROR+ (advice) => convertNewAdviceStatusToOld(advice.status) === Advice_Status.ERROR)) {return PlanCheckRun_Result_Status.ERROR;} else if (checkResult.advices.some(- (advice) => advice.status === Advice_Status.WARNING+ (advice) => convertNewAdviceStatusToOld(advice.status) === Advice_Status.WARNING)) {return PlanCheckRun_Result_Status.WARNING;diff --git a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vueindex aa84ab729e..1f07481f59 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue+++ b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckButton.vue@@ -58,10 +58,11 @@ import { SQLCheckPanel } from "@/components/SQLCheck";import { STATEMENT_SKIP_CHECK_THRESHOLD } from "@/components/SQLCheck/common";import ErrorList from "@/components/misc/ErrorList.vue";import { releaseServiceClientConnect } from "@/grpcweb";-import { CheckReleaseResponse } from "@/types/proto/v1/release_service";-import { CheckReleaseRequestSchema, ReleaseFileType } from "@/types/proto-es/v1/release_service_pb";-import { convertNewCheckReleaseResponseToOld, convertOldChangeTypeToNew } from "@/utils/v1/release-conversions";-import { Advice, Advice_Status } from "@/types/proto/v1/sql_service";+import type { CheckReleaseResponse } from "@/types/proto-es/v1/release_service_pb";+import { CheckReleaseRequestSchema, CheckReleaseResponseSchema, ReleaseFileType } from "@/types/proto-es/v1/release_service_pb";+import { AdviceSchema, Advice_Status as ProtoESAdvice_Status } from "@/types/proto-es/v1/sql_service_pb";+import { convertNewAdviceArrayToOld } from "@/utils/v1/sql-conversions";+import { Advice_Status } from "@/types/proto/v1/sql_service";import type { Defer, VueStyle } from "@/utils";import { defer } from "@/utils";import { useSpecSheet } from "../StatementSection/useSpecSheet";@@ -91,7 +92,8 @@ const confirmDialog = ref<Defer<boolean>>();const checkResult = ref<CheckReleaseResponse | undefined>();const advices = computed(() => {- return checkResult.value?.results.flatMap((r) => r.advices);+ const newAdvices = checkResult.value?.results.flatMap((r) => r.advices);+ return newAdvices ? convertNewAdviceArrayToOld(newAdvices) : undefined;});const changeType = computed(() => getSpecChangeType(selectedSpec.value));@@ -116,15 +118,14 @@ const runCheckInternal = async (statement: string) => {version: "0",type: ReleaseFileType.VERSIONED,statement: new TextEncoder().encode(statement),- changeType: convertOldChangeTypeToNew(changeType.value),+ changeType: changeType.value,},],},targets: [database.value.name],});const response = await releaseServiceClientConnect.checkRelease(request);- const result = convertNewCheckReleaseResponseToOld(response);- return result;+ return response;};const handleButtonClick = async () => {@@ -145,13 +146,13 @@ const runChecks = async () => {const handleErrors = (errors: string[]) => {// Mock the pre-check errors to advices.- checkResult.value = CheckReleaseResponse.fromPartial({+ checkResult.value = create(CheckReleaseResponseSchema, {results: [{advices: errors.map((err) =>- Advice.fromPartial({+ create(AdviceSchema, {title: "Pre check",- status: Advice_Status.WARNING,+ status: ProtoESAdvice_Status.WARNING,content: err,})),diff --git a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vueindex 671e32524d..2260caf732 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue+++ b/frontend/src/components/Plan/components/SQLCheckSection/SQLCheckSection.vue@@ -38,6 +38,7 @@import { NTag, NTooltip } from "naive-ui";import { computed } from "vue";import { isValidDatabaseName } from "@/types";+import { convertNewAdviceArrayToOld } from "@/utils/v1/sql-conversions";import SQLCheckBadge from "./SQLCheckBadge.vue";import SQLCheckButton from "./SQLCheckButton.vue";import { usePlanSQLCheckContext } from "./context";@@ -45,6 +46,12 @@ import { usePlanSQLCheckContext } from "./context";const { database, resultMap } = usePlanSQLCheckContext();const checkResult = computed(() => {- return resultMap.value[database.value.name] || undefined;+ const result = resultMap.value[database.value.name] || undefined;+ if (!result) return undefined;++ return {+ ...result,+ advices: convertNewAdviceArrayToOld(result.advices)+ };});</script>diff --git a/frontend/src/components/Plan/components/SQLCheckSection/common.ts b/frontend/src/components/Plan/components/SQLCheckSection/common.tsindex c7c3e1c9f9..355c29c7f2 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/common.ts+++ b/frontend/src/components/Plan/components/SQLCheckSection/common.ts@@ -2,7 +2,7 @@ import {Plan_ChangeDatabaseConfig_Type,Plan_Spec,} from "@/types/proto/v1/plan_service";-import { Release_File_ChangeType } from "@/types/proto/v1/release_service";+import { Release_File_ChangeType } from "@/types/proto-es/v1/release_service_pb";export const getSpecChangeType = (spec?: Plan_Specdiff --git a/frontend/src/components/Plan/components/SQLCheckSection/context.ts b/frontend/src/components/Plan/components/SQLCheckSection/context.tsindex 39d7e98eba..9fc7791b04 100644--- a/frontend/src/components/Plan/components/SQLCheckSection/context.ts+++ b/frontend/src/components/Plan/components/SQLCheckSection/context.ts@@ -3,7 +3,7 @@ import { computed, inject, provide, ref } from "vue";import { databaseForTask } from "@/components/Rollout/RolloutDetail";import { unknownDatabase, type ComposedProject } from "@/types";import type { Plan, Plan_Spec } from "@/types/proto/v1/plan_service";-import type { CheckReleaseResponse_CheckResult } from "@/types/proto/v1/release_service";+import type { CheckReleaseResponse_CheckResult } from "@/types/proto-es/v1/release_service_pb";import type { Task } from "@/types/proto/v1/rollout_service";import { databaseForSpec } from "../../logic";diff --git a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vueindex 64c89dea8c..873dd20f34 100644--- a/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue+++ b/frontend/src/components/Plan/components/SQLCheckV1Section/SQLCheckV1Section.vue@@ -142,13 +142,10 @@ import { Plan_ChangeDatabaseConfig_Type } from "@/types/proto/v1/plan_service";import {Release_File_ChangeType,type CheckReleaseResponse_CheckResult,-} from "@/types/proto/v1/release_service";+} from "@/types/proto-es/v1/release_service_pb";import { Advice_Status, type Advice } from "@/types/proto/v1/sql_service";import { getSheetStatement, isNullOrUndefined } from "@/utils";-import {- convertNewCheckReleaseResponseToOld,- convertOldChangeTypeToNew,-} from "@/utils/v1/release-conversions";+import { convertNewAdviceArrayToOld } from "@/utils/v1/sql-conversions";import { usePlanContext } from "../../logic/context";import { targetsForSpec } from "../../logic/plan";import { usePlanSpecContext } from "../SpecDetailView/context";@@ -191,7 +188,8 @@ const allAdvices = computed(() => {}const advices: AdviceWithTarget[] = [];for (const result of checkResults.value) {- for (const advice of result.advices) {+ const oldAdvices = convertNewAdviceArrayToOld(result.advices);+ for (const advice of oldAdvices) {advices.push({...advice,target: result.target,@@ -264,20 +262,17 @@ const runChecks = async () => {version: "0",type: ReleaseFileType.VERSIONED,statement: new TextEncoder().encode(statement),- changeType: convertOldChangeTypeToNew(- config.type === Plan_ChangeDatabaseConfig_Type.DATA- ? Release_File_ChangeType.DML- : Release_File_ChangeType.DDL- ),+ changeType: config.type === Plan_ChangeDatabaseConfig_Type.DATA+ ? Release_File_ChangeType.DML+ : Release_File_ChangeType.DDL,},],},targets,});const response = await releaseServiceClientConnect.checkRelease(request);- const result = convertNewCheckReleaseResponseToOld(response);- checkResults.value = result.results || [];+ checkResults.value = response.results || [];} finally {isRunningChecks.value = false;}diff --git a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vueindex 53032eb008..651b1cd2fd 100644--- a/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue+++ b/frontend/src/components/Plan/components/StatementSection/ReleaseView/ReleaseView.vue@@ -111,7 +111,7 @@<div class="text-xs"><span class="text-gray-500">{{- getVCSTypeText(convertVCSTypeToNew(release.vcsSource.vcsType))+ getVCSTypeText(release.vcsSource.vcsType)}}:</span><a@@ -127,7 +127,7 @@<div class="text-xs text-gray-500">{{- dayjs(getDateForPbTimestamp(release.createTime)).format(+ dayjs(getDateForPbTimestampProtoEs(release.createTime)).format("YYYY-MM-DD HH:mm:ss")}}@@ -160,11 +160,10 @@ import { computed } from "vue";import { useI18n } from "vue-i18n";import { BBSpin } from "@/bbkit";import { useReleaseByName } from "@/store";-import { isValidReleaseName, getDateForPbTimestamp } from "@/types";+import { isValidReleaseName, getDateForPbTimestampProtoEs } from "@/types";import { VCSType } from "@/types/proto-es/v1/common_pb";-import { ReleaseFileType } from "@/types/proto/v1/release_service";-import type { Release_File_ChangeType } from "@/types/proto/v1/release_service";-import { convertVCSTypeToNew } from "@/utils/v1/common-conversions";+import { ReleaseFileType } from "@/types/proto-es/v1/release_service_pb";+import { Release_File_ChangeType } from "@/types/proto-es/v1/release_service_pb";import { usePlanSpecContext } from "../../SpecDetailView/context";const { t } = useI18n();@@ -197,11 +196,11 @@ const displayedFiles = computed(() => {const getChangeTypeText = (changeType: Release_File_ChangeType) => {switch (changeType) {- case "DDL":+ case Release_File_ChangeType.DDL:return t("release.change-type.ddl");- case "DDL_GHOST":+ case Release_File_ChangeType.DDL_GHOST:return t("release.change-type.ddl-ghost");- case "DML":+ case Release_File_ChangeType.DML:return t("release.change-type.dml");default:return t("release.change-type.unspecified");diff --git a/frontend/src/components/Release/ReleaseDataTable.vue b/frontend/src/components/Release/ReleaseDataTable.vueindex 28cffc4903..dd124ca3d5 100644--- a/frontend/src/components/Release/ReleaseDataTable.vue+++ b/frontend/src/components/Release/ReleaseDataTable.vue@@ -20,10 +20,9 @@ import { reactive, computed, watch } from "vue";import { useI18n } from "vue-i18n";import { useRouter } from "vue-router";import { BBAvatar } from "@/bbkit";-import { getTimeForPbTimestamp, type ComposedRelease } from "@/types";+import { getTimeForPbTimestampProtoEs, type ComposedRelease } from "@/types";import { State } from "@/types/proto-es/v1/common_pb";import { getReleaseFileStatement, humanizeTs } from "@/utils";-import { convertStateToOld } from "@/utils/v1/common-conversions";interface LocalState {selectedReleaseNameList: Set<string>;@@ -63,7 +62,7 @@ const columnList = computed(return (<p class="inline-flex w-full"><span class="shrink truncate">{release.title}</span>- {release.state === convertStateToOld(State.DELETED) && (+ {release.state === State.DELETED && (<NTag class="shrink-0" type="warning" size="small" round>{t("common.archived")}</NTag>@@ -113,7 +112,7 @@ const columnList = computed(title: t("common.created-at"),width: 128,render: (release) =>- humanizeTs(getTimeForPbTimestamp(release.createTime, 0) / 1000),+ humanizeTs(getTimeForPbTimestampProtoEs(release.createTime, 0) / 1000),},];return columns.filter((column) => !column.hide);diff --git a/frontend/src/components/Release/ReleaseDetail/BasicInfo.vue b/frontend/src/components/Release/ReleaseDetail/BasicInfo.vueindex a06a8ae54d..f6c04e2d34 100644--- a/frontend/src/components/Release/ReleaseDetail/BasicInfo.vue+++ b/frontend/src/components/Release/ReleaseDetail/BasicInfo.vue@@ -7,14 +7,14 @@<div class="flex items-center gap-1"><Clock4Icon class="w-4 h-auto textinfolabel" /><span class="textlabel">{{- humanizeDate(getDateForPbTimestamp(release.createTime))+ humanizeDate(getDateForPbTimestampProtoEs(release.createTime))}}</span></div><div- v-if="vcsSource && vcsSource?.vcsType !== convertVCSTypeToOld(VCSType.VCS_TYPE_UNSPECIFIED)"+ v-if="vcsSource && vcsSource?.vcsType !== VCSType.VCS_TYPE_UNSPECIFIED"class="flex flex-row items-center gap-1">- <VCSIcon custom-class="h-4" :type="convertVCSTypeToNew(vcsSource.vcsType)" />+ <VCSIcon custom-class="h-4" :type="vcsSource.vcsType" /><EllipsisText><a:href="vcsSource.url"@@ -34,9 +34,8 @@ import { computed } from "vue";import { BBAvatar } from "@/bbkit";import EllipsisText from "@/components/EllipsisText.vue";import VCSIcon from "@/components/VCS/VCSIcon.vue";-import { getDateForPbTimestamp } from "@/types";+import { getDateForPbTimestampProtoEs } from "@/types";import { VCSType } from "@/types/proto-es/v1/common_pb";-import { convertVCSTypeToNew, convertVCSTypeToOld } from "@/utils/v1/common-conversions";import { humanizeDate } from "@/utils";import { useReleaseDetailContext } from "./context";diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vueindex 0eec691dcc..ef63e079c7 100644--- a/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue@@ -1,11 +1,11 @@<template>- <ArchiveBanner v-if="release.state === convertStateToOld(State.DELETED)" />+ <ArchiveBanner v-if="release.state === State.DELETED" /><div class="w-full flex flex-row items-center justify-between gap-x-4"><div class="flex-1 p-0.5 overflow-hidden truncate"><TitleEditor /></div><div class="flex items-center justify-end gap-x-3">- <ApplyToDatabaseButton v-if="release.state === convertStateToOld(State.ACTIVE)" />+ <ApplyToDatabaseButton v-if="release.state === State.ACTIVE" /></div></div></template>@@ -14,7 +14,6 @@import ArchiveBanner from "@/components/ArchiveBanner.vue";import { State } from "@/types/proto-es/v1/common_pb";import { useReleaseDetailContext } from "../context";-import { convertStateToOld } from "@/utils/v1/common-conversions";import ApplyToDatabaseButton from "./ApplyToDatabaseButton.vue";import TitleEditor from "./TitleEditor.vue";diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vueindex a98d13b4f5..852f0c52ba 100644--- a/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue@@ -5,7 +5,7 @@:style="style":loading="state.isUpdating":disabled="state.isUpdating"- :readonly="release.state !== convertStateToOld(State.ACTIVE)"+ :readonly="release.state !== State.ACTIVE"autosizerequired@focus="state.isEditing = true"@@ -20,11 +20,11 @@ import { NInput } from "naive-ui";import type { CSSProperties } from "vue";import { computed, reactive, watch } from "vue";import { useI18n } from "vue-i18n";+import { create } from "@bufbuild/protobuf";import { pushNotification, useReleaseStore } from "@/store";import { State } from "@/types/proto-es/v1/common_pb";-import { Release } from "@/types/proto/v1/release_service";+import { ReleaseSchema } from "@/types/proto-es/v1/release_service_pb";import { useReleaseDetailContext } from "../context";-import { convertStateToOld } from "@/utils/v1/common-conversions";const { t } = useI18n();const { release } = useReleaseDetailContext();@@ -63,7 +63,7 @@ const onBlur = async () => {}try {state.isUpdating = true;- const patch = Release.fromPartial({+ const patch = create(ReleaseSchema, {...release.value,title: state.title,});diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseArchiveRestoreButton.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseArchiveRestoreButton.vueindex 1767614f28..db4a33c09e 100644--- a/frontend/src/components/Release/ReleaseDetail/ReleaseArchiveRestoreButton.vue+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseArchiveRestoreButton.vue@@ -1,6 +1,6 @@<template><BBButtonConfirm- v-if="convertStateToNew(release.state) === State.ACTIVE"+ v-if="release.state === State.ACTIVE":type="'ARCHIVE'":button-text="$t('release.archive-this-release')":require-confirm="true"@@ -11,7 +11,7 @@@confirm="archiveOrRestoreRelease(true)"/><BBButtonConfirm- v-else-if="convertStateToNew(release.state) === State.DELETED"+ v-else-if="release.state === State.DELETED":type="'RESTORE'":button-text="$t('common.restore')":require-confirm="false"@@ -24,7 +24,6 @@import { BBButtonConfirm } from "@/bbkit";import { useReleaseStore } from "@/store";import { State } from "@/types/proto-es/v1/common_pb";-import { convertStateToNew } from "@/utils/v1/common-conversions";import { useReleaseDetailContext } from "./context";const { release } = useReleaseDetailContext();diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vueindex c9782c1ae4..c4e44d5f22 100644--- a/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue@@ -34,7 +34,7 @@ import { computed, reactive, watch } from "vue";import { useRoute } from "vue-router";import { Drawer, DrawerContent } from "@/components/v2";import { PROJECT_V1_ROUTE_RELEASE_DETAIL } from "@/router/dashboard/projectV1";-import type { Release_File } from "@/types/proto/v1/release_service";+import type { Release_File } from "@/types/proto-es/v1/release_service_pb";import BasicInfo from "./BasicInfo.vue";import NavBar from "./NavBar";import ReleaseArchiveRestoreButton from "./ReleaseArchiveRestoreButton.vue";diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileDetailPanel.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileDetailPanel.vueindex 4a61059bb1..31af1354cb 100644--- a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileDetailPanel.vue+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileDetailPanel.vue@@ -36,7 +36,7 @@ import { computed } from "vue";import { MonacoEditor } from "@/components/MonacoEditor";import { CopyButton } from "@/components/v2";import { type ComposedRelease } from "@/types";-import type { Release_File } from "@/types/proto/v1/release_service";+import type { Release_File } from "@/types/proto-es/v1/release_service_pb";import { getReleaseFileStatement } from "@/utils";const props = defineProps<{diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vueindex 6e18c62dc2..38ebbb1257 100644--- a/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseFileTable/ReleaseFileTable.vue@@ -14,7 +14,7 @@import { NDataTable, type DataTableColumn } from "naive-ui";import { computed } from "vue";import { useI18n } from "vue-i18n";-import { Release_File } from "@/types/proto/v1/release_service";+import type { Release_File } from "@/types/proto-es/v1/release_service_pb";import { bytesToString, getReleaseFileStatement } from "@/utils";const props = withDefaults(@@ -71,7 +71,7 @@ const columnList = computed(() => {title: t("common.statement-size"),width: 128,ellipsis: true,- render: (file) => bytesToString(file.statementSize.toNumber()),+ render: (file) => bytesToString(Number(file.statementSize)),},{key: "statement",diff --git a/frontend/src/components/Revision/RevisionDataTable.vue b/frontend/src/components/Revision/RevisionDataTable.vueindex 1bd47b17e1..08352fb24e 100644--- a/frontend/src/components/Revision/RevisionDataTable.vue+++ b/frontend/src/components/Revision/RevisionDataTable.vue@@ -33,8 +33,8 @@ import { computed, reactive } from "vue";import { useI18n } from "vue-i18n";import { RouterLink, useRouter } from "vue-router";import { useRevisionStore } from "@/store";-import { getDateForPbTimestamp } from "@/types";-import type { Revision } from "@/types/proto/v1/revision_service";+import { getDateForPbTimestampProtoEs } from "@/types";+import type { Revision } from "@/types/proto-es/v1/revision_service_pb";import { extractIssueUID } from "@/utils";import { useDatabaseDetailContext } from "../Database/context";import HumanizeDate from "../misc/HumanizeDate.vue";@@ -128,7 +128,7 @@ const columnList = computed(() => {width: 128,resizable: true,render: (revision) => (- <HumanizeDate date={getDateForPbTimestamp(revision.createTime)} />+ <HumanizeDate date={getDateForPbTimestampProtoEs(revision.createTime)} />),},];diff --git a/frontend/src/components/Revision/RevisionDetailPanel.vue b/frontend/src/components/Revision/RevisionDetailPanel.vueindex 98519d606a..3202a2b2fc 100644--- a/frontend/src/components/Revision/RevisionDetailPanel.vue+++ b/frontend/src/components/Revision/RevisionDetailPanel.vue@@ -11,7 +11,7 @@><span>{{ $t("database.revision.applied-at") }}:- <HumanizeDate :date="getDateForPbTimestamp(revision.createTime)" />+ <HumanizeDate :date="getDateForPbTimestampProtoEs(revision.createTime)" /></span><span v-if="relatedIssueUID">{{ $t("common.issue") }}:@@ -57,7 +57,7 @@ import { MonacoEditor } from "@/components/MonacoEditor";import { CopyButton } from "@/components/v2";import { rolloutServiceClientConnect } from "@/grpcweb";import { useRevisionStore, useSheetV1Store } from "@/store";-import { getDateForPbTimestamp, type ComposedDatabase } from "@/types";+import { getDateForPbTimestampProtoEs, type ComposedDatabase } from "@/types";import type { TaskRun } from "@/types/proto/v1/rollout_service";import { extractIssueUID, getSheetStatement } from "@/utils";import TaskRunLogTable from "../IssueV1/components/TaskRunSection/TaskRunLogTable/TaskRunLogTable.vue";diff --git a/frontend/src/components/SQLCheck/SQLCheckButton.vue b/frontend/src/components/SQLCheck/SQLCheckButton.vueindex b41d5cedb7..975175d56c 100644--- a/frontend/src/components/SQLCheck/SQLCheckButton.vue+++ b/frontend/src/components/SQLCheck/SQLCheckButton.vue@@ -66,26 +66,35 @@</template><script lang="ts" setup>+import { create } from "@bufbuild/protobuf";import { asyncComputed } from "@vueuse/core";import type { ButtonProps } from "naive-ui";import { NButton, NPopover } from "naive-ui";import { computed, onUnmounted, ref, watch } from "vue";import { onMounted } from "vue";import { useI18n } from "vue-i18n";-import { create } from "@bufbuild/protobuf";import { BBSpin } from "@/bbkit";import { releaseServiceClientConnect } from "@/grpcweb";import type { ComposedDatabase } from "@/types";import type { DatabaseMetadata } from "@/types/proto-es/v1/database_service_pb";+import type { CheckReleaseResponse } from "@/types/proto-es/v1/release_service_pb";import {- CheckReleaseResponse,+ CheckReleaseRequestSchema,+ CheckReleaseResponseSchema,+ ReleaseFileType,Release_File_ChangeType,-} from "@/types/proto/v1/release_service";-import { CheckReleaseRequestSchema, ReleaseFileType } from "@/types/proto-es/v1/release_service_pb";-import { convertNewCheckReleaseResponseToOld, convertOldChangeTypeToNew } from "@/utils/v1/release-conversions";-import { Advice, Advice_Status } from "@/types/proto/v1/sql_service";+} from "@/types/proto-es/v1/release_service_pb";+import type { Advice } from "@/types/proto/v1/sql_service";+import {+ Advice as AdviceProto,+ Advice_Status,+} from "@/types/proto/v1/sql_service";import type { Defer, VueStyle } from "@/utils";import { defer } from "@/utils";+import {+ convertNewAdviceArrayToOld,+ convertOldAdviceArrayToNew,+} from "@/utils/v1/sql-conversions";import ErrorList from "../misc/ErrorList.vue";import SQLCheckPanel from "./SQLCheckPanel.vue";import SQLCheckSummary from "./SQLCheckSummary.vue";@@ -133,10 +142,12 @@ const checkResult = ref<CheckReleaseResponse | undefined>();const filteredAdvices = computed(() => {const { adviceFilter } = props;const advices = checkResult.value?.results.flatMap((r) => r.advices);+ if (!advices) return undefined;+ const oldAdvices = convertNewAdviceArrayToOld(advices);if (!adviceFilter) {- return advices;+ return oldAdvices;}- return advices?.filter(adviceFilter);+ return oldAdvices?.filter(adviceFilter);});const statementErrors = asyncComputed(async () => {@@ -165,15 +176,14 @@ const runCheckInternal = async (statement: string) => {type: ReleaseFileType.VERSIONED,statement: new TextEncoder().encode(statement),// Default to DDL change type.- changeType: convertOldChangeTypeToNew(changeType || Release_File_ChangeType.DDL),+ changeType: changeType || Release_File_ChangeType.DDL,},],},targets: [database.name],});const response = await releaseServiceClientConnect.checkRelease(request);- const result = convertNewCheckReleaseResponseToOld(response);- return result;+ return response;};const handleButtonClick = async () => {@@ -194,15 +204,17 @@ const runChecks = async () => {const handleErrors = (errors: string[]) => {// Mock the pre-check errors to advices.- checkResult.value = CheckReleaseResponse.fromPartial({+ checkResult.value = create(CheckReleaseResponseSchema, {results: [{- advices: errors.map((err) =>- Advice.fromPartial({- title: "Pre check",- status: Advice_Status.WARNING,- content: err,- })+ advices: convertOldAdviceArrayToNew(+ errors.map((err) =>+ AdviceProto.fromPartial({+ title: "Pre check",+ status: Advice_Status.WARNING,+ content: err,+ })+ )),},],diff --git a/frontend/src/components/SQLCheck/SQLCheckPanel.vue b/frontend/src/components/SQLCheck/SQLCheckPanel.vueindex bd9e4e1e81..658d04ebc7 100644--- a/frontend/src/components/SQLCheck/SQLCheckPanel.vue+++ b/frontend/src/components/SQLCheck/SQLCheckPanel.vue@@ -69,7 +69,7 @@ import {PlanCheckRun_Result_SqlReviewReport,PlanCheckRun_Status,} from "@/types/proto/v1/plan_service";-import { CheckReleaseResponse_RiskLevel } from "@/types/proto/v1/release_service";+import { CheckReleaseResponse_RiskLevel } from "@/types/proto-es/v1/release_service_pb";import type { Advice } from "@/types/proto/v1/sql_service";import { Advice_Status } from "@/types/proto/v1/sql_service";import type { Defer } from "@/utils";diff --git a/frontend/src/store/modules/release.ts b/frontend/src/store/modules/release.tsindex 1a7320a0c5..c25f03cf92 100644--- a/frontend/src/store/modules/release.ts+++ b/frontend/src/store/modules/release.ts@@ -7,10 +7,9 @@ import { releaseServiceClientConnect } from "@/grpcweb";import { silentContextKey } from "@/grpcweb/context-key";import type { MaybeRef, ComposedRelease, Pagination } from "@/types";import { isValidReleaseName, unknownRelease, unknownUser } from "@/types";-import type { DeepPartial, Release } from "@/types/proto/v1/release_service";-import { Release as ReleaseProto } from "@/types/proto/v1/release_service";+import type { Release } from "@/types/proto-es/v1/release_service_pb";+import { ReleaseSchema } from "@/types/proto-es/v1/release_service_pb";import { State } from "@/types/proto-es/v1/common_pb";-import { convertStateToOld } from "@/utils/v1/common-conversions";import {GetReleaseRequestSchema,ListReleasesRequestSchema,@@ -18,7 +17,6 @@ import {DeleteReleaseRequestSchema,UndeleteReleaseRequestSchema} from "@/types/proto-es/v1/release_service_pb";-import { convertNewReleaseToOld, convertOldReleaseToNew } from "@/utils/v1/release-conversions";import { DEFAULT_PAGE_SIZE } from "./common";import { useUserStore } from "./user";import { useProjectV1Store, batchGetOrFetchProjects } from "./v1";@@ -43,8 +41,7 @@ export const useReleaseStore = defineStore("release", () => {showDeleted: Boolean(showDeleted),});const resp = await releaseServiceClientConnect.listReleases(request);- const oldReleases = resp.releases.map(convertNewReleaseToOld);- const composedReleaseList = await batchComposeRelease(oldReleases);+ const composedReleaseList = await batchComposeRelease(resp.releases);composedReleaseList.forEach((release) => {releaseMapByName.set(release.name, release);});@@ -59,8 +56,7 @@ export const useReleaseStore = defineStore("release", () => {const response = await releaseServiceClientConnect.getRelease(request, {contextValues: createContextValues().set(silentContextKey, silent),});- const release = convertNewReleaseToOld(response);- const [composedRelease] = await batchComposeRelease([release]);+ const [composedRelease] = await batchComposeRelease([response]);releaseMapByName.set(composedRelease.name, composedRelease);return composedRelease;};@@ -74,20 +70,20 @@ export const useReleaseStore = defineStore("release", () => {};const updateRelase = async (- release: DeepPartial<Release>,+ release: Partial<Release>,updateMask: string[]) => {- // Convert the partial release to the new format for the request- const fullRelease = ReleaseProto.fromPartial(release);- const newRelease = convertOldReleaseToNew(fullRelease);+ const fullRelease = {+ ...create(ReleaseSchema, {}),+ ...release,+ };const request = create(UpdateReleaseRequestSchema, {- release: newRelease,+ release: fullRelease,updateMask: { paths: updateMask },});const resp = await releaseServiceClientConnect.updateRelease(request);- const oldRelease = convertNewReleaseToOld(resp);- const composedRelease = await batchComposeRelease([oldRelease]);+ const composedRelease = await batchComposeRelease([resp]);releaseMapByName.set(composedRelease[0].name, composedRelease[0]);return composedRelease[0];};@@ -96,15 +92,14 @@ export const useReleaseStore = defineStore("release", () => {const request = create(DeleteReleaseRequestSchema, { name });await releaseServiceClientConnect.deleteRelease(request);if (releaseMapByName.get(name)) {- releaseMapByName.get(name)!.state = convertStateToOld(State.DELETED);+ releaseMapByName.get(name)!.state = State.DELETED;}};const undeleteRelease = async (name: string) => {const request = create(UndeleteReleaseRequestSchema, { name });const response = await releaseServiceClientConnect.undeleteRelease(request);- const release = convertNewReleaseToOld(response);- const composedRelease = await batchComposeRelease([release]);+ const composedRelease = await batchComposeRelease([response]);releaseMapByName.set(composedRelease[0].name, composedRelease[0]);};@@ -147,7 +142,7 @@ export const useReleaseByName = (name: MaybeRef<string>) => {};};-export const batchComposeRelease = async (releaseList: Release[]) => {+export const batchComposeRelease = async (releaseList: Release[]): Promise<ComposedRelease[]> => {const userStore = useUserStore();await userStore.batchGetUsers(releaseList.map((release) => release.creator));diff --git a/frontend/src/store/modules/revision.ts b/frontend/src/store/modules/revision.tsindex 95d15034c9..5da3e2f4e1 100644--- a/frontend/src/store/modules/revision.ts+++ b/frontend/src/store/modules/revision.ts@@ -3,8 +3,7 @@ import { computed, reactive } from "vue";import { create } from "@bufbuild/protobuf";import { revisionServiceClientConnect } from "@/grpcweb";import type { Pagination } from "@/types";-import { Revision } from "@/types/proto/v1/revision_service";-import { convertNewRevisionToOld } from "@/utils/v1/revision-conversions";+import type { Revision } from "@/types/proto-es/v1/revision_service_pb";import {ListRevisionsRequestSchema,GetRevisionRequestSchema,@@ -31,13 +30,9 @@ export const useRevisionStore = defineStore("revision", () => {});const resp = await revisionServiceClientConnect.listRevisions(request);resp.revisions.forEach((revision) => {- const oldRevision = convertNewRevisionToOld(revision);- revisionMapByName.set(oldRevision.name, oldRevision);+ revisionMapByName.set(revision.name, revision);});- return {- ...resp,- revisions: resp.revisions.map(convertNewRevisionToOld),- };+ return resp;};const getRevisionsByDatabase = (database: string) => {@@ -53,9 +48,8 @@ export const useRevisionStore = defineStore("revision", () => {const request = create(GetRevisionRequestSchema, { name });const revision = await revisionServiceClientConnect.getRevision(request);- const oldRevision = convertNewRevisionToOld(revision);- revisionMapByName.set(oldRevision.name, oldRevision);- return oldRevision;+ revisionMapByName.set(revision.name, revision);+ return revision;};const getRevisionByName = (name: string) => {diff --git a/frontend/src/store/modules/v1/changelist.ts b/frontend/src/store/modules/v1/changelist.tsindex 47d707e64b..8d0e712d0a 100644--- a/frontend/src/store/modules/v1/changelist.ts+++ b/frontend/src/store/modules/v1/changelist.ts@@ -8,21 +8,15 @@ import type {Changelist,Changelist_Change as Change,CreateChangelistRequest,- DeepPartial,ListChangelistsRequest,-} from "@/types/proto/v1/changelist_service";+} from "@/types/proto-es/v1/changelist_service_pb";import {GetChangelistRequestSchema,- CreateChangelistRequestSchema,ListChangelistsRequestSchema,UpdateChangelistRequestSchema,DeleteChangelistRequestSchema,} from "@/types/proto-es/v1/changelist_service_pb";import { ResourceComposer, isChangelogChangeSource } from "@/utils";-import {- convertNewChangelistToOld,- convertOldChangelistToNew,-} from "@/utils/v1/changelist-conversions";import { useUserStore } from "../user";import { useChangelogStore } from "./changelog";import { useSheetV1Store } from "./sheet";@@ -56,9 +50,8 @@ export const useChangelistStore = defineStore("changelist", () => {request,{ contextValues: createContextValues().set(silentContextKey, silent) });- const oldChangelist = convertNewChangelistToOld(changelist);- await upsertChangelistMap([oldChangelist], true /* compose */);- return oldChangelist;+ await upsertChangelistMap([changelist], true /* compose */);+ return changelist;};const getOrFetchChangelistByName = async (name: string, silent = false) => {@@ -71,42 +64,31 @@ export const useChangelistStore = defineStore("changelist", () => {};const createChangelist = async (request: CreateChangelistRequest) => {- // Convert the changelist in the request if it exists- const connectRequest = create(CreateChangelistRequestSchema, {- ...request,- changelist: request.changelist ? convertOldChangelistToNew(request.changelist) : undefined,- });- const created = await changelistServiceClientConnect.createChangelist(connectRequest);- const oldCreated = convertNewChangelistToOld(created);- await upsertChangelistMap([oldCreated], true /* compose */);- return oldCreated;+ const created = await changelistServiceClientConnect.createChangelist(request);+ await upsertChangelistMap([created], true /* compose */);+ return created;};const fetchChangelists = async (- request: DeepPartial<ListChangelistsRequest>+ request: Partial<ListChangelistsRequest>) => {- const connectRequest = create(ListChangelistsRequestSchema, request);+ const connectRequest = create(ListChangelistsRequestSchema, request as any);const response = await changelistServiceClientConnect.listChangelists(connectRequest);- const oldChangelists = response.changelists.map(convertNewChangelistToOld);- await upsertChangelistMap(oldChangelists, false /* !compose */);- return {- ...response,- changelists: oldChangelists,- };+ await upsertChangelistMap(response.changelists, false /* !compose */);+ return response;};const patchChangelist = async (- changelist: DeepPartial<Changelist>,+ changelist: Changelist,updateMask: string[]) => {const connectRequest = create(UpdateChangelistRequestSchema, {- changelist: changelist as any, // Type assertion needed for partial type compatibility+ changelist: changelist,updateMask: { paths: updateMask },});const updated = await changelistServiceClientConnect.updateChangelist(connectRequest);- const oldUpdated = convertNewChangelistToOld(updated);- await upsertChangelistMap([oldUpdated], true /* compose */);- return oldUpdated;+ await upsertChangelistMap([updated], true /* compose */);+ return updated;};const deleteChangelist = async (name: string) => {diff --git a/frontend/src/types/release.ts b/frontend/src/types/release.tsindex c20e3c91d2..58bc0ada25 100644--- a/frontend/src/types/release.ts+++ b/frontend/src/types/release.ts@@ -1,6 +1,8 @@+import { create } from "@bufbuild/protobuf";import { getProjectNameReleaseId } from "@/store/modules/v1/common";import { UNKNOWN_ID } from "./const";-import { Release } from "./proto/v1/release_service";+import type { Release } from "./proto-es/v1/release_service_pb";+import { ReleaseSchema } from "./proto-es/v1/release_service_pb";import type { User } from "./proto-es/v1/user_service_pb";import { unknownUser } from "./v1";import {@@ -20,7 +22,7 @@ export const UNKNOWN_RELEASE_NAME = `${UNKNOWN_PROJECT_NAME}/releases/${UNKNOWN_export const unknownRelease = (): ComposedRelease => {const projectEntity = unknownProject();- const release = Release.fromPartial({+ const release = create(ReleaseSchema, {name: `${projectEntity.name}/releases/${UNKNOWN_ID}`,});return {diff --git a/frontend/src/types/v1/changelist.ts b/frontend/src/types/v1/changelist.tsindex 23ab9483a3..1aa71a51a8 100644--- a/frontend/src/types/v1/changelist.ts+++ b/frontend/src/types/v1/changelist.ts@@ -1,10 +1,11 @@import { SYSTEM_BOT_USER_NAME } from "@/types";-import { Changelist } from "@/types/proto/v1/changelist_service";+import { ChangelistSchema } from "@/types/proto-es/v1/changelist_service_pb";+import { create } from "@bufbuild/protobuf";export const UNKNOWN_CHANGELIST_NAME = "projects/-1/changelists/-1";export const unknownChangelist = () => {- return Changelist.fromPartial({+ return create(ChangelistSchema, {name: UNKNOWN_CHANGELIST_NAME,description: "<<Unknown Changelist>>",creator: SYSTEM_BOT_USER_NAME,diff --git a/frontend/src/utils/release.ts b/frontend/src/utils/release.tsindex f0223c8da6..6471df2bcf 100644--- a/frontend/src/utils/release.ts+++ b/frontend/src/utils/release.ts@@ -1,4 +1,4 @@-import type { Release_File } from "@/types/proto/v1/release_service";+import type { Release_File } from "@/types/proto-es/v1/release_service_pb";export const getReleaseFileStatement = (file: Release_File) => {return new TextDecoder().decode(file.statement);diff --git a/frontend/src/utils/v1/changelist.ts b/frontend/src/utils/v1/changelist.tsindex 91987729c6..7a9abb12fd 100644--- a/frontend/src/utils/v1/changelist.ts+++ b/frontend/src/utils/v1/changelist.ts@@ -1,6 +1,6 @@import { useSheetV1Store } from "@/store";import type { Changelist_Change_Source } from "@/types";-import type { Changelist_Change as Change } from "@/types/proto/v1/changelist_service";+import type { Changelist_Change as Change } from "@/types/proto-es/v1/changelist_service_pb";import { getSheetStatement } from "./sheet";export const extractChangelistResourceName = (name: string) => {diff --git a/frontend/src/utils/v1/common-conversions.ts b/frontend/src/utils/v1/common-conversions.tsindex 84c68abb13..58e68086df 100644--- a/frontend/src/utils/v1/common-conversions.ts+++ b/frontend/src/utils/v1/common-conversions.ts@@ -19,9 +19,15 @@ import {Duration as OldDuration,} from "@/types/proto/google/protobuf/duration"+import {+ Timestamp as OldTimestamp,+} from "@/types/proto/google/protobuf/timestamp";+import {DurationSchema as NewDurationSchema,type Duration as NewDuration,+ TimestampSchema as NewTimestampSchema,+ type Timestamp as NewTimestamp,} from "@bufbuild/protobuf/wkt"// Expr type imports@@ -465,4 +471,24 @@ export const convertExprToOld = (expr: NewExpr): OldExpr => {description: expr.description,location: expr.location,});+};++/**+ * Convert proto-es Timestamp to old proto Timestamp+ */+export const convertTimestampToOld = (timestamp: NewTimestamp): OldTimestamp => {+ return OldTimestamp.fromPartial({+ seconds: Number(timestamp.seconds),+ nanos: timestamp.nanos,+ });+};++/**+ * Convert old proto Timestamp to proto-es Timestamp+ */+export const convertTimestampToNew = (timestamp: OldTimestamp): NewTimestamp => {+ return create(NewTimestampSchema, {+ seconds: timestamp.seconds.toBigInt(),+ nanos: timestamp.nanos,+ });};\ No newline at end of filediff --git a/frontend/src/utils/v1/sql-conversions.ts b/frontend/src/utils/v1/sql-conversions.tsindex 8ded4708ec..027fb620c7 100644--- a/frontend/src/utils/v1/sql-conversions.ts+++ b/frontend/src/utils/v1/sql-conversions.ts@@ -12,7 +12,9 @@ import type {SearchQueryHistoriesResponse as OldSearchQueryHistoriesResponse,AICompletionRequest as OldAICompletionRequest,AICompletionResponse as OldAICompletionResponse,+ Advice as OldAdvice,} from "@/types/proto/v1/sql_service";+import { Advice_Status as OldAdvice_Status } from "@/types/proto/v1/sql_service";import {QueryRequest as OldQueryRequestProto,QueryResponse as OldQueryResponseProto,@@ -40,7 +42,9 @@ import type {SearchQueryHistoriesResponse as NewSearchQueryHistoriesResponse,AICompletionRequest as NewAICompletionRequest,AICompletionResponse as NewAICompletionResponse,+ Advice as NewAdvice,} from "@/types/proto-es/v1/sql_service_pb";+import { Advice_Status as NewAdvice_Status } from "@/types/proto-es/v1/sql_service_pb";import {QueryRequestSchema,QueryResponseSchema,@@ -126,4 +130,56 @@ export const convertOldAICompletionRequestToNew = (oldRequest: OldAICompletionReexport const convertNewAICompletionResponseToOld = (newResponse: NewAICompletionResponse): OldAICompletionResponse => {const json = toJson(AICompletionResponseSchema, newResponse);return OldAICompletionResponseProto.fromJSON(json);+};++// Convert proto-es Advice_Status to old+export const convertNewAdviceStatusToOld = (newStatus: NewAdvice_Status): OldAdvice_Status => {+ switch (newStatus) {+ case NewAdvice_Status.STATUS_UNSPECIFIED:+ return OldAdvice_Status.STATUS_UNSPECIFIED;+ case NewAdvice_Status.SUCCESS:+ return OldAdvice_Status.SUCCESS;+ case NewAdvice_Status.WARNING:+ return OldAdvice_Status.WARNING;+ case NewAdvice_Status.ERROR:+ return OldAdvice_Status.ERROR;+ default:+ return OldAdvice_Status.STATUS_UNSPECIFIED;+ }+};++// Convert old Advice_Status to proto-es+export const convertOldAdviceStatusToNew = (oldStatus: OldAdvice_Status): NewAdvice_Status => {+ switch (oldStatus) {+ case OldAdvice_Status.STATUS_UNSPECIFIED:+ return NewAdvice_Status.STATUS_UNSPECIFIED;+ case OldAdvice_Status.SUCCESS:+ return NewAdvice_Status.SUCCESS;+ case OldAdvice_Status.WARNING:+ return NewAdvice_Status.WARNING;+ case OldAdvice_Status.ERROR:+ return NewAdvice_Status.ERROR;+ default:+ return NewAdvice_Status.STATUS_UNSPECIFIED;+ }+};++// Convert proto-es Advice array to old+export const convertNewAdviceArrayToOld = (newAdvices: NewAdvice[]): OldAdvice[] => {+ return newAdvices.map(advice => {+ return {+ ...advice,+ status: convertNewAdviceStatusToOld(advice.status)+ } as OldAdvice;+ });+};++// Convert old Advice array to proto-es+export const convertOldAdviceArrayToNew = (oldAdvices: OldAdvice[]): NewAdvice[] => {+ return oldAdvices.map(advice => {+ return {+ ...advice,+ status: convertOldAdviceStatusToNew(advice.status)+ } as NewAdvice;+ });};\ No newline at end of file