Skip to content

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

feat: implement release page skeleton (#13886)

boojack689083e59bc2
diff --git a/backend/api/v1/release_service.go b/backend/api/v1/release_service.go
index 1de4ef0335..dc1f6a0418 100644
--- a/backend/api/v1/release_service.go
+++ b/backend/api/v1/release_service.go
@@ -125,6 +125,11 @@ func (s *ReleaseService) ListReleases(ctx context.Context, request *v1pb.ListRel
}, nil
}
+func (*ReleaseService) UpdateRelease(_ context.Context, _ *v1pb.UpdateReleaseRequest) (*v1pb.Release, error) {
+ // TODO(p0ny): implement me please.
+ return nil, status.Errorf(codes.Unimplemented, "implement me")
+}
+
func convertToReleases(ctx context.Context, s *store.Store, releases []*store.ReleaseMessage) ([]*v1pb.Release, error) {
var rs []*v1pb.Release
for _, release := range releases {
diff --git a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
index 2823fe5a1f..5d430b4646 100644
--- a/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
+++ b/frontend/src/components/Changelist/ChangelistDetail/ChangelistDetail.vue
@@ -44,6 +44,7 @@
import { computed, reactive, watch } from "vue";
import { useI18n } from "vue-i18n";
import { useRoute } from "vue-router";
+import { BBSpin } from "@/bbkit";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
import { PROJECT_V1_ROUTE_CHANGELIST_DETAIL } from "@/router/dashboard/projectV1";
import { pushNotification, useChangelistStore } from "@/store";
@@ -59,7 +60,6 @@ import DeleteChangelistButton from "./DeleteChangelistButton.vue";
import NavBar from "./NavBar";
import RawSQLPanel from "./RawSQLPanel";
import { provideChangelistDetailContext } from "./context";
-import { BBSpin } from "@/bbkit";
const { t } = useI18n();
const route = useRoute();
diff --git a/frontend/src/components/Project/ProjectReleasesPanel.vue b/frontend/src/components/Project/ProjectReleasesPanel.vue
new file mode 100644
index 0000000000..1f7b4b52ac
--- /dev/null
+++ b/frontend/src/components/Project/ProjectReleasesPanel.vue
@@ -0,0 +1,29 @@
+<template>
+ <div class="flex flex-col gap-y-2">
+ <div class="relative min-h-[20rem]">
+ <PagedReleaseTable
+ :session-key="`project-${project}-releases`"
+ :project="project.name"
+ :page-size="50"
+ >
+ <template #table="{ releaseList, loading }">
+ <ReleaseDataTable
+ :bordered="true"
+ :loading="loading"
+ :release-list="releaseList"
+ />
+ </template>
+ </PagedReleaseTable>
+ </div>
+ </div>
+</template>
+
+<script lang="ts" setup>
+import type { ComposedProject } from "@/types";
+import PagedReleaseTable from "../Release/PagedReleaseTable.vue";
+import ReleaseDataTable from "../Release/ReleaseDataTable.vue";
+
+defineProps<{
+ project: ComposedProject;
+}>();
+</script>
diff --git a/frontend/src/components/Project/useProjectSidebar.ts b/frontend/src/components/Project/useProjectSidebar.ts
index 791821ca7d..c113d47e45 100644
--- a/frontend/src/components/Project/useProjectSidebar.ts
+++ b/frontend/src/components/Project/useProjectSidebar.ts
@@ -10,6 +10,7 @@ import {
SearchCodeIcon,
DownloadIcon,
SquareGanttChartIcon,
+ PackageIcon,
} from "lucide-vue-next";
import { computed, h, unref } from "vue";
import type { RouteLocationNormalizedLoaded, RouteRecordRaw } from "vue-router";
@@ -32,12 +33,13 @@ import projectV1Routes, {
PROJECT_V1_ROUTE_EXPORT_CENTER,
PROJECT_V1_ROUTE_AUDIT_LOGS,
PROJECT_V1_ROUTE_REVIEW_CENTER,
+ PROJECT_V1_ROUTE_RELEASES,
} from "@/router/dashboard/projectV1";
import { useAppFeature } from "@/store";
import type { ComposedProject, MaybeRef, Permission } from "@/types";
import { DEFAULT_PROJECT_NAME } from "@/types";
import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
-import { hasProjectPermissionV2 } from "@/utils";
+import { hasProjectPermissionV2, isDev } from "@/utils";
interface ProjectSidebarItem extends SidebarItem {
title: string;
@@ -182,6 +184,16 @@ export const useProjectSidebar = (
isDefaultProject.value ||
databaseChangeMode.value === DatabaseChangeMode.EDITOR,
},
+ {
+ title: "Releases",
+ path: PROJECT_V1_ROUTE_RELEASES,
+ icon: () => h(PackageIcon),
+ type: "div",
+ hide:
+ !isDev() ||
+ isDefaultProject.value ||
+ databaseChangeMode.value === DatabaseChangeMode.EDITOR,
+ },
{
title: t("database.sync-schema.title"),
path: PROJECT_V1_ROUTE_SYNC_SCHEMA,
diff --git a/frontend/src/components/Release/PagedReleaseTable.vue b/frontend/src/components/Release/PagedReleaseTable.vue
new file mode 100644
index 0000000000..a8981f3a4f
--- /dev/null
+++ b/frontend/src/components/Release/PagedReleaseTable.vue
@@ -0,0 +1,171 @@
+<template>
+ <slot
+ name="table"
+ :release-list="state.releaseList"
+ :loading="state.loading"
+ />
+
+ <div
+ v-if="state.loadingMore"
+ class="flex items-center justify-center py-2 text-gray-400 text-sm"
+ >
+ <BBSpin />
+ </div>
+
+ <slot
+ v-if="!state.loadingMore"
+ name="more"
+ :has-more="!!state.paginationToken"
+ :fetch-next-page="fetchNextPage"
+ >
+ <div
+ v-if="!hideLoadMore && pageSize > 0 && state.paginationToken"
+ class="flex items-center justify-center py-2 text-gray-400 text-sm hover:bg-gray-200 cursor-pointer"
+ @click="fetchNextPage"
+ >
+ {{ $t("common.load-more") }}
+ </div>
+ </slot>
+</template>
+
+<script lang="ts" setup>
+import { useSessionStorage } from "@vueuse/core";
+import { computed, reactive, watch } from "vue";
+import { BBSpin } from "@/bbkit";
+import { useIsLoggedIn, useReleaseStore } from "@/store";
+import type { ComposedRelease, Pagination } from "@/types";
+
+type LocalState = {
+ loading: boolean;
+ releaseList: ComposedRelease[];
+ paginationToken: string;
+ loadingMore: boolean;
+};
+
+type SessionState = {
+ // How many times the user clicks the "load more" button.
+ page: number;
+ // Help us to check if the session is outdated.
+ updatedTs: number;
+};
+
+const MAX_PAGE_SIZE = 1000;
+const SESSION_LIFE = 1 * 60 * 1000; // 1 minute
+
+const props = defineProps({
+ // A unique key to identify the session state.
+ sessionKey: {
+ type: String,
+ required: true,
+ },
+ project: {
+ type: String,
+ required: true,
+ },
+ pageSize: {
+ type: Number,
+ default: 50,
+ },
+ hideLoadMore: {
+ type: Boolean,
+ default: false,
+ },
+});
+
+const state = reactive<LocalState>({
+ loading: false,
+ releaseList: [],
+ paginationToken: "",
+ loadingMore: false,
+});
+
+const sessionState = useSessionStorage<SessionState>(
+ `bb.paged-release-data-table.${props.sessionKey}`,
+ {
+ page: 1,
+ updatedTs: 0,
+ }
+);
+
+const releaseStore = useReleaseStore();
+const isLoggedIn = useIsLoggedIn();
+
+const limit = computed(() => {
+ if (props.pageSize <= 0) return MAX_PAGE_SIZE;
+ return props.pageSize;
+});
+
+const latestPagination = computed((): Pagination => {
+ return {
+ pageSize: props.pageSize,
+ pageToken: state.paginationToken,
+ };
+});
+
+const fetchData = (refresh = false) => {
+ if (!isLoggedIn.value) {
+ return;
+ }
+
+ state.loading = true;
+
+ const isFirstFetch = state.paginationToken === "";
+ if (!isFirstFetch) {
+ state.loadingMore = true;
+ }
+ const expectedRowCount = isFirstFetch
+ ? // Load one or more page for the first fetch to restore the session
+ limit.value * sessionState.value.page
+ : // Always load one page if NOT the first fetch
+ limit.value;
+
+ const request = releaseStore.fetchReleasesByProject(
+ props.project,
+ latestPagination.value
+ );
+
+ request
+ .then(({ nextPageToken, releases }) => {
+ if (refresh) {
+ state.releaseList = releases;
+ } else {
+ state.releaseList.push(...releases);
+ }
+
+ if (releases.length >= expectedRowCount && !isFirstFetch) {
+ // If we didn't reach the end, memorize we've clicked the "load more" button.
+ sessionState.value.page++;
+ }
+
+ sessionState.value.updatedTs = Date.now();
+ state.paginationToken = nextPageToken;
+ })
+ .finally(() => {
+ state.loading = false;
+ state.loadingMore = false;
+ });
+};
+
+const resetSession = () => {
+ sessionState.value = {
+ page: 1,
+ updatedTs: 0,
+ };
+};
+
+const fetchNextPage = () => {
+ fetchData(false);
+};
+
+if (Date.now() - sessionState.value.updatedTs > SESSION_LIFE) {
+ // Reset session if it's outdated.
+ resetSession();
+}
+fetchData(true);
+watch(isLoggedIn, () => {
+ // Reset session when logged out.
+ if (!isLoggedIn.value) {
+ resetSession();
+ }
+});
+</script>
diff --git a/frontend/src/components/Release/ReleaseDataTable.vue b/frontend/src/components/Release/ReleaseDataTable.vue
new file mode 100644
index 0000000000..d5b2e35a65
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDataTable.vue
@@ -0,0 +1,126 @@
+<template>
+ <NDataTable
+ size="small"
+ :columns="columnList"
+ :data="sortedReleaseList"
+ :striped="true"
+ :bordered="bordered"
+ :loading="loading"
+ :row-key="(release: ComposedRelease) => release.name"
+ :checked-row-keys="Array.from(state.selectedReleaseNameList)"
+ :row-props="rowProps"
+ @update:checked-row-keys="
+ (val) => (state.selectedReleaseNameList = new Set(val as string[]))
+ "
+ />
+</template>
+
+<script lang="tsx" setup>
+import type { DataTableColumn } from "naive-ui";
+import { NDataTable } from "naive-ui";
+import { reactive, computed, watch } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
+import { BBAvatar } from "@/bbkit";
+import { type ComposedRelease } from "@/types";
+import { humanizeTs } from "@/utils";
+
+interface LocalState {
+ selectedReleaseNameList: Set<string>;
+}
+
+const props = withDefaults(
+ defineProps<{
+ releaseList: ComposedRelease[];
+ bordered?: boolean;
+ loading?: boolean;
+ showSelection?: boolean;
+ }>(),
+ {
+ loading: true,
+ bordered: false,
+ showSelection: false,
+ }
+);
+
+const { t } = useI18n();
+const router = useRouter();
+const state = reactive<LocalState>({
+ selectedReleaseNameList: new Set(),
+});
+
+const columnList = computed((): DataTableColumn<ComposedRelease>[] => {
+ const columns: (DataTableColumn<ComposedRelease> & { hide?: boolean })[] = [
+ {
+ type: "selection",
+ width: 40,
+ cellProps: () => {
+ return {
+ onClick: (e: MouseEvent) => {
+ e.stopPropagation();
+ },
+ };
+ },
+ hide: !props.showSelection,
+ },
+ {
+ key: "title",
+ title: t("common.title"),
+ ellipsis: true,
+ render: (release) => {
+ return <div class="flex items-center space-x-2">{release.title}</div>;
+ },
+ },
+ {
+ key: "createTime",
+ title: t("common.created-at"),
+ width: 150,
+ render: (release) =>
+ humanizeTs((release.createTime?.getTime() ?? 0) / 1000),
+ },
+ {
+ key: "creator",
+ title: t("common.creator"),
+ width: 150,
+ render: (release) => (
+ <div class="flex flex-row items-center overflow-hidden gap-x-2">
+ <BBAvatar size="SMALL" username={release.creatorEntity.title} />
+ <span class="truncate">{release.creatorEntity.title}</span>
+ </div>
+ ),
+ },
+ ];
+ return columns.filter((column) => !column.hide);
+});
+
+const sortedReleaseList = computed(() => {
+ return props.releaseList;
+});
+
+const rowProps = (release: ComposedRelease) => {
+ return {
+ style: "cursor: pointer;",
+ onClick: (e: MouseEvent) => {
+ const url = `/${release.name}`;
+ if (e.ctrlKey || e.metaKey) {
+ window.open(url, "_blank");
+ } else {
+ router.push(url);
+ }
+ },
+ };
+};
+
+watch(
+ () => props.releaseList,
+ (list) => {
+ const oldReleaseNames = Array.from(state.selectedReleaseNameList.values());
+ const newReleaseNames = new Set(list.map((release) => release.name));
+ oldReleaseNames.forEach((name) => {
+ if (!newReleaseNames.has(name)) {
+ state.selectedReleaseNameList.delete(name);
+ }
+ });
+ }
+);
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/MigrationFileTable.vue b/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/MigrationFileTable.vue
new file mode 100644
index 0000000000..45eaf27be5
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/MigrationFileTable.vue
@@ -0,0 +1,50 @@
+<template>
+ <NDataTable
+ size="small"
+ :columns="columnList"
+ :data="migrationFiles"
+ :striped="true"
+ :row-key="(file) => file.version"
+ />
+</template>
+
+<script setup lang="tsx">
+import { NDataTable, type DataTableColumn } from "naive-ui";
+import { computed } from "vue";
+import { Release_File } from "@/types/proto/v1/release_service";
+import { useReleaseDetailContext } from "../context";
+
+const { release } = useReleaseDetailContext();
+
+const migrationFiles = computed(() => release.value.files);
+
+const columnList = computed(() => {
+ const columns: DataTableColumn<Release_File>[] = [
+ {
+ key: "version",
+ title: "Version",
+ ellipsis: true,
+ render: (file) => file.version,
+ },
+ {
+ key: "title",
+ title: "Filename",
+ ellipsis: true,
+ render: (file) => file.name,
+ },
+ {
+ key: "sheeSha1",
+ width: 150,
+ title: "Hash",
+ render: (file) => file.sheetSha1,
+ },
+ {
+ key: "actions",
+ width: 150,
+ title: "Actions",
+ render: (file) => file.sheetSha1,
+ },
+ ];
+ return columns;
+});
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/index.ts b/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/index.ts
new file mode 100644
index 0000000000..d9c9c3c235
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/MigrationFileTable/index.ts
@@ -0,0 +1,3 @@
+import MigrationFileTable from "./MigrationFileTable.vue";
+
+export default MigrationFileTable;
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabaseButton.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabaseButton.vue
new file mode 100644
index 0000000000..395f696115
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabaseButton.vue
@@ -0,0 +1,42 @@
+<template>
+ <ErrorTipsButton
+ style="--n-padding: 0 10px"
+ :errors="errors"
+ :button-props="{
+ type: 'primary',
+ }"
+ @click="state.showApplyToDatabasePanel = true"
+ >
+ {{ $t("changelist.apply-to-database") }}
+ </ErrorTipsButton>
+
+ <ApplyToDatabasePanel
+ v-if="state.showApplyToDatabasePanel"
+ @close="state.showApplyToDatabasePanel = false"
+ />
+</template>
+
+<script setup lang="ts">
+import { computed, reactive } from "vue";
+import { ErrorTipsButton } from "@/components/v2";
+import { useReleaseDetailContext } from "../context";
+import ApplyToDatabasePanel from "./ApplyToDatabasePanel.vue";
+
+interface LocalState {
+ showApplyToDatabasePanel: boolean;
+}
+
+const { release } = useReleaseDetailContext();
+
+const state = reactive<LocalState>({
+ showApplyToDatabasePanel: false,
+});
+
+const errors = computed(() => {
+ const errors: string[] = [];
+ if (release.value.files.length === 0) {
+ errors.push("No migration files to apply");
+ }
+ return errors;
+});
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue
new file mode 100644
index 0000000000..32f15941f4
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/ApplyToDatabasePanel.vue
@@ -0,0 +1,248 @@
+<template>
+ <Drawer @close="emit('close')">
+ <DrawerContent :title="'Apply to databases'">
+ <template #default>
+ <div
+ class="w-[calc(100vw-8rem)] lg:w-[60rem] max-w-[calc(100vw-8rem)] overflow-x-auto"
+ >
+ <div v-if="ready" class="flex flex-col">
+ <div class="mb-4 flex flex-row justify-start items-center gap-2">
+ <span class="textlabel">{{ "Change type" }}:</span>
+ <NRadioGroup v-model:value="state.changeType">
+ <NRadio :value="'DDL'" :label="t('issue.title.edit-schema')" />
+ <NRadio :value="'DML'" :label="t('issue.title.change-data')" />
+ </NRadioGroup>
+ </div>
+
+ <NTabs v-model:value="state.changeSource" type="card">
+ <NTabPane name="DATABASE" :tab="$t('common.databases')">
+ <DatabaseV1Table
+ mode="PROJECT"
+ :database-list="schemaDatabaseList"
+ :show-selection="true"
+ :selected-database-names="state.selectedDatabaseNameList"
+ @update:selected-databases="
+ state.selectedDatabaseNameList = Array.from($event)
+ "
+ />
+ <SchemalessDatabaseTable
+ v-if="
+ state.changeType === 'DDL' &&
+ schemalessDatabaseList.length > 0
+ "
+ mode="PROJECT"
+ :database-list="schemalessDatabaseList"
+ />
+ </NTabPane>
+ <NTabPane name="GROUP" :tab="$t('common.database-groups')">
+ <DatabaseGroupDataTable
+ :database-group-list="dbGroupList"
+ :show-selection="true"
+ :single-selection="true"
+ :selected-database-group-names="
+ state.selectedDatabaseGroup
+ ? [state.selectedDatabaseGroup]
+ : []
+ "
+ @update:selected-database-groups="
+ state.selectedDatabaseGroup = head(Array.from($event))
+ "
+ />
+ </NTabPane>
+ </NTabs>
+ </div>
+ <div
+ v-if="!ready || state.isGenerating"
+ v-zindexable="{ enabled: true }"
+ class="absolute inset-0 flex flex-col items-center justify-center bg-white/50"
+ >
+ <BBSpin />
+ </div>
+ </div>
+ </template>
+
+ <template #footer>
+ <div class="flex-1 flex items-center justify-between">
+ <div>
+ <div
+ v-if="
+ state.changeSource === 'DATABASE' &&
+ flattenSelectedDatabaseNameList.length > 0
+ "
+ class="textinfolabel"
+ >
+ {{
+ $t("database.selected-n-databases", {
+ n: flattenSelectedDatabaseNameList.length,
+ })
+ }}
+ </div>
+ </div>
+
+ <div class="flex items-center justify-end gap-x-3">
+ <NButton @click.prevent="emit('close')">
+ {{ $t("common.cancel") }}
+ </NButton>
+
+ <ErrorTipsButton
+ style="--n-padding: 0 10px"
+ :errors="nextButtonErrors"
+ :button-props="{
+ type: 'primary',
+ }"
+ @click="handleClickNext"
+ >
+ {{ $t("common.next") }}
+ </ErrorTipsButton>
+ </div>
+ </div>
+ </template>
+ </DrawerContent>
+ </Drawer>
+</template>
+
+<script lang="ts" setup>
+import { head } from "lodash-es";
+import { NButton } from "naive-ui";
+import { NRadioGroup, NRadio, NTabs, NTabPane } from "naive-ui";
+import { zindexable as vZindexable } from "vdirs";
+import { computed, reactive } from "vue";
+import { useI18n } from "vue-i18n";
+import { useRouter } from "vue-router";
+import { BBSpin } from "@/bbkit";
+import SchemalessDatabaseTable from "@/components/AlterSchemaPrepForm/SchemalessDatabaseTable.vue";
+import DatabaseGroupDataTable from "@/components/DatabaseGroup/DatabaseGroupDataTable.vue";
+import { Drawer, DrawerContent, ErrorTipsButton } from "@/components/v2";
+import DatabaseV1Table from "@/components/v2/Model/DatabaseV1Table/DatabaseV1Table.vue";
+import { PROJECT_V1_ROUTE_ISSUE_DETAIL } from "@/router/dashboard/projectV1";
+import {
+ useDatabaseV1Store,
+ useDBGroupListByProject,
+ useDBGroupStore,
+} from "@/store";
+import { useDatabaseV1List } from "@/store/modules/v1/databaseList";
+import type { ComposedDatabase } from "@/types";
+import { DEFAULT_PROJECT_NAME } from "@/types";
+import { State } from "@/types/proto/v1/common";
+import { DatabaseGroup } from "@/types/proto/v1/database_group_service";
+import {
+ extractProjectResourceName,
+ generateIssueTitle,
+ instanceV1HasAlterSchema,
+ sortDatabaseV1List,
+} from "@/utils";
+import { useReleaseDetailContext } from "../context";
+
+const emit = defineEmits<{
+ (event: "close"): void;
+}>();
+
+type LocalState = {
+ selectedDatabaseNameList: string[];
+ changeType: "DDL" | "DML";
+ changeSource: "DATABASE" | "GROUP";
+ isGenerating: boolean;
+ selectedDatabaseGroup?: string;
+};
+
+const { t } = useI18n();
+const router = useRouter();
+const databaseStore = useDatabaseV1Store();
+const dbGroupStore = useDBGroupStore();
+const { release, project } = useReleaseDetailContext();
+
+const state = reactive<LocalState>({
+ selectedDatabaseNameList: [],
+ changeType: "DDL",
+ changeSource: "DATABASE",
+ isGenerating: false,
+});
+
+const { ready } = useDatabaseV1List(project.value.name);
+const { dbGroupList } = useDBGroupListByProject(project.value.name);
+
+const databaseList = computed(() => {
+ let list: ComposedDatabase[] = [];
+ list = databaseStore.databaseListByProject(project.value.name);
+
+ list = list.filter(
+ (db) => db.syncState == State.ACTIVE && db.project !== DEFAULT_PROJECT_NAME
+ );
+
+ return sortDatabaseV1List(list);
+});
+
+const schemaDatabaseList = computed(() => {
+ if (state.changeType === "DDL") {
+ return databaseList.value.filter((db) =>
+ instanceV1HasAlterSchema(db.instanceResource)
+ );
+ }
+ return databaseList.value;
+});
+
+const schemalessDatabaseList = computed(() => {
+ return databaseList.value.filter(
+ (db) => !instanceV1HasAlterSchema(db.instanceResource)
+ );
+});
+
+const flattenSelectedDatabaseNameList = computed(() => {
+ return [...state.selectedDatabaseNameList];
+});
+
+const nextButtonErrors = computed(() => {
+ const errors: string[] = [];
+ if (
+ (state.changeSource === "DATABASE" &&
+ flattenSelectedDatabaseNameList.value.length === 0) ||
+ (state.changeSource === "GROUP" && !state.selectedDatabaseGroup)
+ ) {
+ errors.push("Please select at least one database");
+ }
+ return errors;
+});
+
+const handleClickNext = async () => {
+ state.isGenerating = true;
+ try {
+ const databaseList = flattenSelectedDatabaseNameList.value.map((name) =>
+ databaseStore.getDatabaseByName(name)
+ );
+ const databaseGroup = DatabaseGroup.fromPartial({
+ ...dbGroupStore.getDBGroupByName(state.selectedDatabaseGroup || ""),
+ });
+ const query: Record<string, any> = {
+ template:
+ state.changeType === "DDL"
+ ? "bb.issue.database.schema.update"
+ : "bb.issue.database.data.update",
+ name: generateIssueTitle(
+ "bb.issue.database.schema.update",
+ state.changeSource === "DATABASE"
+ ? databaseList.map((db) => db.databaseName)
+ : [databaseGroup?.databasePlaceholder]
+ ),
+ // TODO(steven): handle issue creation for release.
+ release: release.value.name,
+ description: `Apply release [${release.value.title}]`,
+ };
+ if (state.changeSource === "DATABASE") {
+ query.databaseList = databaseList.map((db) => db.name).join(",");
+ } else {
+ query.databaseGroupName = state.selectedDatabaseGroup;
+ }
+
+ router.push({
+ name: PROJECT_V1_ROUTE_ISSUE_DETAIL,
+ params: {
+ projectId: extractProjectResourceName(project.value.name),
+ issueSlug: "create",
+ },
+ query,
+ });
+ } catch {
+ state.isGenerating = false;
+ }
+};
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue
new file mode 100644
index 0000000000..f3332133b2
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/NavBar.vue
@@ -0,0 +1,15 @@
+<template>
+ <div class="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 />
+ </div>
+ </div>
+</template>
+
+<script setup lang="ts">
+import ApplyToDatabaseButton from "./ApplyToDatabaseButton.vue";
+import TitleEditor from "./TitleEditor.vue";
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue b/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue
new file mode 100644
index 0000000000..fa857d89ad
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/TitleEditor.vue
@@ -0,0 +1,92 @@
+<template>
+ <NInput
+ :value="state.title"
+ :style="style"
+ :loading="state.isUpdating"
+ :disabled="state.isUpdating"
+ autosize
+ required
+ @focus="state.isEditing = true"
+ @blur="onBlur"
+ @keyup.enter="onEnter"
+ @update:value="onUpdateValue"
+ />
+</template>
+
+<script setup lang="ts">
+import { NInput } from "naive-ui";
+import type { CSSProperties } from "vue";
+import { computed, reactive, watch } from "vue";
+import { useI18n } from "vue-i18n";
+import { pushNotification, useReleaseStore } from "@/store";
+import { Release } from "@/types/proto/v1/release_service";
+import { useReleaseDetailContext } from "../context";
+
+const { t } = useI18n();
+const { release } = useReleaseDetailContext();
+
+const state = reactive({
+ isEditing: false,
+ isUpdating: false,
+ title: release.value.title,
+});
+
+const style = computed(() => {
+ const style: CSSProperties = {
+ cursor: "default",
+ minWidth: "10rem",
+ "--n-color-disabled": "transparent",
+ "--n-font-size": "20px",
+ };
+ const border = state.isEditing
+ ? "1px solid rgb(var(--color-control-border))"
+ : "none";
+ style["--n-border"] = border;
+ style["--n-border-disabled"] = border;
+
+ return style;
+});
+
+const onBlur = async () => {
+ const cleanup = () => {
+ state.isEditing = false;
+ state.isUpdating = false;
+ };
+
+ if (state.title === release.value.title) {
+ cleanup();
+ return;
+ }
+ try {
+ state.isUpdating = true;
+ const patch = Release.fromPartial({
+ ...release.value,
+ title: state.title,
+ });
+ useReleaseStore().updateRelase(patch, ["title"]);
+ pushNotification({
+ module: "bytebase",
+ style: "SUCCESS",
+ title: t("common.updated"),
+ });
+ } finally {
+ cleanup();
+ }
+};
+
+const onEnter = (e: Event) => {
+ const input = e.target as HTMLInputElement;
+ input.blur();
+};
+
+const onUpdateValue = (title: string) => {
+ state.title = title;
+};
+
+watch(
+ () => release.value.title,
+ (title) => {
+ state.title = title;
+ }
+);
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/NavBar/index.ts b/frontend/src/components/Release/ReleaseDetail/NavBar/index.ts
new file mode 100644
index 0000000000..0a296d688c
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/NavBar/index.ts
@@ -0,0 +1,3 @@
+import NavBar from "./NavBar.vue";
+
+export default NavBar;
diff --git a/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue b/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue
new file mode 100644
index 0000000000..34f7acfbc6
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/ReleaseDetail.vue
@@ -0,0 +1,35 @@
+<template>
+ <div class="flex flex-col items-stretch gap-y-4 relative">
+ <NavBar />
+
+ <MigrationFileTable />
+ </div>
+</template>
+
+<script lang="ts" setup>
+import { computed, watch } from "vue";
+import { useRoute } from "vue-router";
+import { PROJECT_V1_ROUTE_RELEASE_DETAIL } from "@/router/dashboard/projectV1";
+import MigrationFileTable from "./MigrationFileTable";
+import NavBar from "./NavBar";
+import { provideReleaseDetailContext } from "./context";
+
+const route = useRoute();
+const { release } = provideReleaseDetailContext();
+
+const documentTitle = computed(() => {
+ if (route.name !== PROJECT_V1_ROUTE_RELEASE_DETAIL) {
+ return undefined;
+ }
+ return release.value.title;
+});
+watch(
+ documentTitle,
+ (title) => {
+ if (title) {
+ document.title = title;
+ }
+ },
+ { immediate: true }
+);
+</script>
diff --git a/frontend/src/components/Release/ReleaseDetail/context.ts b/frontend/src/components/Release/ReleaseDetail/context.ts
new file mode 100644
index 0000000000..16f3ced92a
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/context.ts
@@ -0,0 +1,63 @@
+import type { InjectionKey, Ref } from "vue";
+import { computed, inject, provide, watchEffect } from "vue";
+import { useRoute } from "vue-router";
+import { useProjectV1Store, useReleaseStore } from "@/store";
+import { projectNamePrefix } from "@/store/modules/v1/common";
+import type { ComposedProject, ComposedRelease } from "@/types";
+import { unknownProject, unknownRelease } from "@/types";
+import { hasPermissionToCreateChangeDatabaseIssueInProject } from "@/utils";
+
+export type ReleaseDetailContext = {
+ release: Ref<ComposedRelease>;
+ project: Ref<ComposedProject>;
+ allowApply: Ref<boolean>;
+};
+
+export const KEY = Symbol(
+ "bb.release.detail"
+) as InjectionKey<ReleaseDetailContext>;
+
+export const useReleaseDetailContext = () => {
+ return inject(KEY)!;
+};
+
+export const provideReleaseDetailContext = () => {
+ const route = useRoute();
+ const projectV1Store = useProjectV1Store();
+ const releaseStore = useReleaseStore();
+
+ const project = computed(() => {
+ const projectId = route.params.projectId as string;
+ if (!projectId) {
+ return unknownProject();
+ }
+
+ return projectV1Store.getProjectByName(`${projectNamePrefix}${projectId}`);
+ });
+
+ const name = computed(() => {
+ return `${project.value.name}/releases/${route.params.releaseId}`;
+ });
+
+ watchEffect(async () => {
+ await releaseStore.fetchReleaseByName(name.value);
+ });
+
+ const release = computed(() => {
+ return releaseStore.getReleaseByName(name.value) ?? unknownRelease();
+ });
+
+ const allowApply = computed(() => {
+ return hasPermissionToCreateChangeDatabaseIssueInProject(project.value);
+ });
+
+ const context: ReleaseDetailContext = {
+ release,
+ project,
+ allowApply,
+ };
+
+ provide(KEY, context);
+
+ return context;
+};
diff --git a/frontend/src/components/Release/ReleaseDetail/index.ts b/frontend/src/components/Release/ReleaseDetail/index.ts
new file mode 100644
index 0000000000..2b0dc1934e
--- /dev/null
+++ b/frontend/src/components/Release/ReleaseDetail/index.ts
@@ -0,0 +1,3 @@
+import ReleaseDetail from "./ReleaseDetail.vue";
+
+export default ReleaseDetail;
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 29608ec839..069e069ce9 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -290,7 +290,8 @@
"back-to-workspace": "Back to workspace",
"override": "Override",
"encoding": "Encoding",
- "finish": "Finish"
+ "finish": "Finish",
+ "title": "Title"
},
"error-page": {
"go-back-home": "Go back home"
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index b14c03ba1a..ef3347e7e4 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -290,7 +290,8 @@
"back-to-workspace": "Volver al espacio de trabajo",
"override": "Anular",
"encoding": "Codificación",
- "finish": "Finalizar"
+ "finish": "Finalizar",
+ "title": "Título"
},
"error-page": {
"go-back-home": "Volver al inicio"
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index c0cb83ede4..fa29a8c641 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -290,7 +290,8 @@
"back-to-workspace": "ワークスペースに戻る",
"override": "オーバーライド",
"encoding": "エンコーディング",
- "finish": "仕上げる"
+ "finish": "仕上げる",
+ "title": "タイトル"
},
"error-page": {
"go-back-home": "ホームページに戻る"
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 421f109571..587dee294d 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -290,7 +290,8 @@
"back-to-workspace": "返回工作空间",
"override": "覆盖",
"encoding": "编码",
- "finish": "完成"
+ "finish": "完成",
+ "title": "标题"
},
"error-page": {
"go-back-home": "回到主页"
diff --git a/frontend/src/router/dashboard/projectV1.ts b/frontend/src/router/dashboard/projectV1.ts
index a4c09b2082..be5c61fac3 100644
--- a/frontend/src/router/dashboard/projectV1.ts
+++ b/frontend/src/router/dashboard/projectV1.ts
@@ -34,6 +34,8 @@ export const PROJECT_V1_ROUTE_MEMBERS = `${PROJECT_V1_ROUTE_DASHBOARD}.members`;
export const PROJECT_V1_ROUTE_SETTINGS = `${PROJECT_V1_ROUTE_DASHBOARD}.settings`;
export const PROJECT_V1_ROUTE_EXPORT_CENTER = `${PROJECT_V1_ROUTE_DASHBOARD}.export-center`;
export const PROJECT_V1_ROUTE_REVIEW_CENTER = `${PROJECT_V1_ROUTE_DASHBOARD}.review-center`;
+export const PROJECT_V1_ROUTE_RELEASES = `${PROJECT_V1_ROUTE_DASHBOARD}.releases`;
+export const PROJECT_V1_ROUTE_RELEASE_DETAIL = `${PROJECT_V1_ROUTE_DASHBOARD}.release.detail`;
const projectV1Routes: RouteRecordRaw[] = [
{
@@ -477,6 +479,39 @@ const projectV1Routes: RouteRecordRaw[] = [
component: () => import("@/views/ReviewCenter/index.vue"),
props: true,
},
+ {
+ path: "releases",
+ meta: {
+ overrideTitle: true,
+ },
+ props: true,
+ children: [
+ {
+ path: "",
+ name: PROJECT_V1_ROUTE_RELEASES,
+ meta: {
+ overrideTitle: true,
+ requiredProjectPermissionList: () => [
+ "bb.projects.get",
+ "bb.issues.list", // TODO(steven): use release related permission instead.
+ ],
+ },
+ component: () =>
+ import("@/views/project/ProjectReleaseDashboard.vue"),
+ props: true,
+ },
+ {
+ path: ":releaseId",
+ name: PROJECT_V1_ROUTE_RELEASE_DETAIL,
+ meta: {
+ overrideTitle: true,
+ requiredProjectPermissionList: () => ["bb.projects.get"],
+ },
+ component: () => import("@/views/project/ProjectReleaseDetail.vue"),
+ props: true,
+ },
+ ],
+ },
],
},
];
diff --git a/frontend/src/store/modules/release.ts b/frontend/src/store/modules/release.ts
index fea5dcf2b7..f2c6756693 100644
--- a/frontend/src/store/modules/release.ts
+++ b/frontend/src/store/modules/release.ts
@@ -3,10 +3,12 @@ import { defineStore } from "pinia";
import { computed, reactive, ref, unref, watch } from "vue";
import { releaseServiceClient } from "@/grpcweb";
import type { MaybeRef, ComposedRelease, Pagination } from "@/types";
-import { isValidDatabaseName, unknownRelease } from "@/types";
+import { isValidDatabaseName, unknownRelease, unknownUser } from "@/types";
import { DEFAULT_PROJECT_NAME } from "@/types";
-import type { Release } from "@/types/proto/v1/release_service";
+import type { DeepPartial, Release } from "@/types/proto/v1/release_service";
+import { extractUserResourceName } from "@/utils";
import { DEFAULT_PAGE_SIZE } from "./common";
+import { useUserStore } from "./user";
import { useProjectV1Store } from "./v1";
import { getProjectNameReleaseId, projectNamePrefix } from "./v1/common";
@@ -51,12 +53,26 @@ export const useReleaseStore = defineStore("release", () => {
return releaseMapByName.get(name) ?? unknownRelease();
};
+ const updateRelase = async (
+ release: DeepPartial<Release>,
+ updateMask: string[]
+ ) => {
+ const resp = await releaseServiceClient.updateRelease({
+ release,
+ updateMask,
+ });
+ const composedRelease = await batchComposeRelease([resp]);
+ releaseMapByName.set(composedRelease[0].name, composedRelease[0]);
+ return composedRelease[0];
+ };
+
return {
releaseList,
fetchReleasesByProject,
fetchReleaseByName,
getReleasesByProject,
getReleaseByName,
+ updateRelase,
};
});
@@ -84,9 +100,13 @@ export const useReleaseByName = (name: MaybeRef<string>) => {
};
export const batchComposeRelease = async (releaseList: Release[]) => {
+ const userStore = useUserStore();
const composedReleaseList = releaseList.map((release) => {
const composed = release as ComposedRelease;
composed.project = `${projectNamePrefix}${head(getProjectNameReleaseId(release.name))}`;
+ composed.creatorEntity =
+ userStore.getUserByEmail(extractUserResourceName(composed.creator)) ??
+ unknownUser();
return composed;
});
const distinctProjectList = uniq(
diff --git a/frontend/src/types/proto/v1/release_service.ts b/frontend/src/types/proto/v1/release_service.ts
index 3414b3105e..b3ee024236 100644
--- a/frontend/src/types/proto/v1/release_service.ts
+++ b/frontend/src/types/proto/v1/release_service.ts
@@ -1,6 +1,7 @@
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
+import { FieldMask } from "../google/protobuf/field_mask";
import { Timestamp } from "../google/protobuf/timestamp";
import { VCSType, vCSTypeFromJSON, vCSTypeToJSON, vCSTypeToNumber } from "./common";
@@ -91,6 +92,15 @@ export interface CreateReleaseRequest {
release: Release | undefined;
}
+export interface UpdateReleaseRequest {
+ /** The release to update. */
+ release:
+ | Release
+ | undefined;
+ /** The list of fields to be updated. */
+ updateMask: string[] | undefined;
+}
+
export interface Release {
/** Format: projects/{project}/releases/{release} */
name: string;
@@ -422,6 +432,82 @@ export const CreateReleaseRequest = {
},
};
+function createBaseUpdateReleaseRequest(): UpdateReleaseRequest {
+ return { release: undefined, updateMask: undefined };
+}
+
+export const UpdateReleaseRequest = {
+ encode(message: UpdateReleaseRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.release !== undefined) {
+ Release.encode(message.release, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.updateMask !== undefined) {
+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateReleaseRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateReleaseRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.release = Release.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): UpdateReleaseRequest {
+ return {
+ release: isSet(object.release) ? Release.fromJSON(object.release) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateReleaseRequest): unknown {
+ const obj: any = {};
+ if (message.release !== undefined) {
+ obj.release = Release.toJSON(message.release);
+ }
+ if (message.updateMask !== undefined) {
+ obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateReleaseRequest>): UpdateReleaseRequest {
+ return UpdateReleaseRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<UpdateReleaseRequest>): UpdateReleaseRequest {
+ const message = createBaseUpdateReleaseRequest();
+ message.release = (object.release !== undefined && object.release !== null)
+ ? Release.fromPartial(object.release)
+ : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
function createBaseRelease(): Release {
return { name: "", title: "", files: [], vcsSource: undefined, creator: "", createTime: undefined };
}
@@ -918,6 +1004,97 @@ export const ReleaseServiceDefinition = {
},
},
},
+ updateRelease: {
+ name: "UpdateRelease",
+ requestType: UpdateReleaseRequest,
+ requestStream: false,
+ responseType: Release,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [
+ new Uint8Array([
+ 19,
+ 114,
+ 101,
+ 108,
+ 101,
+ 97,
+ 115,
+ 101,
+ 44,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ 95,
+ 109,
+ 97,
+ 115,
+ 107,
+ ]),
+ ],
+ 578365826: [
+ new Uint8Array([
+ 51,
+ 58,
+ 7,
+ 114,
+ 101,
+ 108,
+ 101,
+ 97,
+ 115,
+ 101,
+ 50,
+ 40,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 114,
+ 101,
+ 108,
+ 101,
+ 97,
+ 115,
+ 101,
+ 46,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 47,
+ 114,
+ 101,
+ 108,
+ 101,
+ 97,
+ 115,
+ 101,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
},
} as const;
diff --git a/frontend/src/types/release.ts b/frontend/src/types/release.ts
index 108640f7fb..872ae71d82 100644
--- a/frontend/src/types/release.ts
+++ b/frontend/src/types/release.ts
@@ -1,6 +1,8 @@
import { getProjectNameReleaseId } from "@/store/modules/v1/common";
import { EMPTY_ID, UNKNOWN_ID } from "./const";
+import type { User } from "./proto/v1/auth_service";
import { Release } from "./proto/v1/release_service";
+import { emptyUser, unknownUser } from "./v1";
import {
emptyProject,
unknownProject,
@@ -11,6 +13,7 @@ export interface ComposedRelease extends Release {
// Format: projects/{project}
project: string;
projectEntity: ComposedProject;
+ creatorEntity: User;
}
export const UNKNOWN_RELEASE_NAME = `${unknownProject().name}/releases/${UNKNOWN_ID}`;
@@ -26,6 +29,7 @@ export const emptyRelease = (): ComposedRelease => {
...release,
project: projectEntity.name,
projectEntity,
+ creatorEntity: emptyUser(),
};
};
@@ -40,6 +44,7 @@ export const unknownRelease = (): ComposedRelease => {
...release,
project: projectEntity.name,
projectEntity,
+ creatorEntity: unknownUser(),
};
};
diff --git a/frontend/src/views/project/ProjectReleaseDashboard.vue b/frontend/src/views/project/ProjectReleaseDashboard.vue
new file mode 100644
index 0000000000..e6d5a4d763
--- /dev/null
+++ b/frontend/src/views/project/ProjectReleaseDashboard.vue
@@ -0,0 +1,18 @@
+<template>
+ <ProjectReleasesPanel :project="project" />
+</template>
+
+<script lang="ts" setup>
+import { computed } from "vue";
+import ProjectReleasesPanel from "@/components/Project/ProjectReleasesPanel.vue";
+import { useProjectByName } from "@/store";
+import { projectNamePrefix } from "@/store/modules/v1/common";
+
+const props = defineProps<{
+ projectId: string;
+}>();
+
+const { project } = useProjectByName(
+ computed(() => `${projectNamePrefix}${props.projectId}`)
+);
+</script>
diff --git a/frontend/src/views/project/ProjectReleaseDetail.vue b/frontend/src/views/project/ProjectReleaseDetail.vue
new file mode 100644
index 0000000000..5018835a0a
--- /dev/null
+++ b/frontend/src/views/project/ProjectReleaseDetail.vue
@@ -0,0 +1,128 @@
+<template>
+ <div class="-mx-4 h-full relative overflow-x-hidden">
+ <template v-if="ready">
+ <GrantRequestIssueDetailPage v-if="isGrantRequestIssue(issue)" />
+ <DataExportIssueDetailPage v-else-if="isDatabaseDataExportIssue(issue)" />
+ <IssueDetailPage v-else />
+ </template>
+ <div v-else class="w-full h-full flex flex-col items-center justify-center">
+ <NSpin />
+ </div>
+ </div>
+ <FeatureModal
+ :open="state.showFeatureModal"
+ feature="bb.feature.multi-tenancy"
+ @cancel="state.showFeatureModal = false"
+ />
+</template>
+
+<script lang="ts" setup>
+import { useTitle } from "@vueuse/core";
+import Emittery from "emittery";
+import { NSpin } from "naive-ui";
+import { computed, onMounted, reactive, toRef } from "vue";
+import { useI18n } from "vue-i18n";
+import { FeatureModal } from "@/components/FeatureGuard";
+import {
+ DataExportIssueDetailPage,
+ GrantRequestIssueDetailPage,
+ IssueDetailPage,
+ provideIssueContext,
+ useBaseIssueContext,
+ useInitializeIssue,
+} from "@/components/IssueV1";
+import {
+ providePlanCheckRunContext,
+ type PlanCheckRunEvents,
+} from "@/components/PlanCheckRun/context";
+import { useBodyLayoutContext } from "@/layouts/common";
+import { useUIStateStore } from "@/store";
+import {
+ isGrantRequestIssue,
+ isDatabaseDataExportIssue,
+ isValidIssueName,
+} from "@/utils";
+
+interface LocalState {
+ showFeatureModal: boolean;
+}
+
+defineOptions({
+ inheritAttrs: false,
+});
+
+const props = defineProps<{
+ projectId: string;
+ issueSlug: string;
+}>();
+
+const { t } = useI18n();
+
+const state = reactive<LocalState>({
+ showFeatureModal: false,
+});
+
+const { isCreating, issue, isInitializing, reInitialize, allowEditIssue } =
+ useInitializeIssue(toRef(props, "issueSlug"), toRef(props, "projectId"));
+const ready = computed(() => {
+ return !isInitializing.value && !!issue.value;
+});
+const uiStateStore = useUIStateStore();
+
+const issueBaseContext = useBaseIssueContext({
+ isCreating,
+ ready,
+ issue,
+});
+
+provideIssueContext(
+ {
+ isCreating,
+ issue,
+ ready,
+ reInitialize,
+ allowEditIssue,
+ ...issueBaseContext,
+ },
+ true /* root */
+);
+
+providePlanCheckRunContext(
+ {
+ events: (() => {
+ const emittery: PlanCheckRunEvents = new Emittery();
+ emittery.on("status-changed", () => {
+ // If the status of plan checks changes, trigger a refresh.
+ issueBaseContext.events?.emit("status-changed", { eager: true });
+ });
+ return emittery;
+ })(),
+ },
+ true /* root */
+);
+
+const { overrideMainContainerClass } = useBodyLayoutContext();
+
+overrideMainContainerClass("!py-0");
+
+onMounted(() => {
+ if (!uiStateStore.getIntroStateByKey("issue.visit")) {
+ uiStateStore.saveIntroStateByKey({
+ key: "issue.visit",
+ newState: true,
+ });
+ }
+});
+
+const documentTitle = computed(() => {
+ if (isCreating.value) {
+ return t("issue.new-issue");
+ } else {
+ if (ready.value && isValidIssueName(issue.value.name)) {
+ return issue.value.title;
+ }
+ }
+ return t("common.loading");
+});
+useTitle(documentTitle);
+</script>
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 4260d9ea2e..2e88d36e23 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -5407,6 +5407,48 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/Status'
+ patch:
+ tags:
+ - ReleaseService
+ operationId: ReleaseService_UpdateRelease
+ parameters:
+ - name: project
+ in: path
+ description: The project id.
+ required: true
+ schema:
+ type: string
+ - name: release
+ in: path
+ description: The release id.
+ required: true
+ schema:
+ type: string
+ - name: updateMask
+ in: query
+ description: The list of fields to be updated.
+ schema:
+ type: string
+ format: field-mask
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Release'
+ required: true
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Release'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
/v1/projects/{project}/rollouts:
post:
tags:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index b23889575a..0088d07243 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -72,6 +72,7 @@
- [Release](#bytebase-v1-Release)
- [Release.File](#bytebase-v1-Release-File)
- [Release.VCSSource](#bytebase-v1-Release-VCSSource)
+ - [UpdateReleaseRequest](#bytebase-v1-UpdateReleaseRequest)
- [ReleaseFileType](#bytebase-v1-ReleaseFileType)
@@ -1696,6 +1697,22 @@ When paginating, all other parameters provided to `ListReleasesRequest` must mat
+
+<a name="bytebase-v1-UpdateReleaseRequest"></a>
+
+### UpdateReleaseRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| release | [Release](#bytebase-v1-Release) | | The release to update. |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. |
+
+
+
+
+
@@ -1725,6 +1742,7 @@ When paginating, all other parameters provided to `ListReleasesRequest` must mat
| GetRelease | [GetReleaseRequest](#bytebase-v1-GetReleaseRequest) | [Release](#bytebase-v1-Release) | |
| ListReleases | [ListReleasesRequest](#bytebase-v1-ListReleasesRequest) | [ListReleasesResponse](#bytebase-v1-ListReleasesResponse) | |
| CreateRelease | [CreateReleaseRequest](#bytebase-v1-CreateReleaseRequest) | [Release](#bytebase-v1-Release) | |
+| UpdateRelease | [UpdateReleaseRequest](#bytebase-v1-UpdateReleaseRequest) | [Release](#bytebase-v1-Release) | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 7a065e5439..cc01de325d 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -442,6 +442,10 @@
<a href="#bytebase.v1.Release.VCSSource"><span class="badge">M</span>Release.VCSSource</a>
</li>
+ <li>
+ <a href="#bytebase.v1.UpdateReleaseRequest"><span class="badge">M</span>UpdateReleaseRequest</a>
+ </li>
+
<li>
<a href="#bytebase.v1.ReleaseFileType"><span class="badge">E</span>ReleaseFileType</a>
@@ -5578,6 +5582,37 @@ Format: projects/{project}/sheets/{sheet} </p></td>
+ <h3 id="bytebase.v1.UpdateReleaseRequest">UpdateReleaseRequest</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>release</td>
+ <td><a href="#bytebase.v1.Release">Release</a></td>
+ <td></td>
+ <td><p>The release to update. </p></td>
+ </tr>
+
+ <tr>
+ <td>update_mask</td>
+ <td><a href="#google.protobuf.FieldMask">google.protobuf.FieldMask</a></td>
+ <td></td>
+ <td><p>The list of fields to be updated. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.ReleaseFileType">ReleaseFileType</h3>
@@ -5636,6 +5671,13 @@ Format: projects/{project}/sheets/{sheet} </p></td>
<td><p></p></td>
</tr>
+ <tr>
+ <td>UpdateRelease</td>
+ <td><a href="#bytebase.v1.UpdateReleaseRequest">UpdateReleaseRequest</a></td>
+ <td><a href="#bytebase.v1.Release">Release</a></td>
+ <td><p></p></td>
+ </tr>
+
</tbody>
</table>
@@ -5684,6 +5726,16 @@ Format: projects/{project}/sheets/{sheet} </p></td>
</tr>
+
+
+ <tr>
+ <td>UpdateRelease</td>
+ <td>PATCH</td>
+ <td>/v1/{release.name=projects/*/releases/*}</td>
+ <td>release</td>
+ </tr>
+
+
</tbody>
</table>
diff --git a/proto/generated-go/v1/release_service.pb.go b/proto/generated-go/v1/release_service.pb.go
index 40b84a2698..e5fde81364 100644
--- a/proto/generated-go/v1/release_service.pb.go
+++ b/proto/generated-go/v1/release_service.pb.go
@@ -10,6 +10,7 @@ import (
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
@@ -302,6 +303,63 @@ func (x *CreateReleaseRequest) GetRelease() *Release {
return nil
}
+type UpdateReleaseRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The release to update.
+ Release *Release `protobuf:"bytes,1,opt,name=release,proto3" json:"release,omitempty"`
+ // The list of fields to be updated.
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateReleaseRequest) Reset() {
+ *x = UpdateReleaseRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_release_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateReleaseRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateReleaseRequest) ProtoMessage() {}
+
+func (x *UpdateReleaseRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_release_service_proto_msgTypes[4]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use UpdateReleaseRequest.ProtoReflect.Descriptor instead.
+func (*UpdateReleaseRequest) Descriptor() ([]byte, []int) {
+ return file_v1_release_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *UpdateReleaseRequest) GetRelease() *Release {
+ if x != nil {
+ return x.Release
+ }
+ return nil
+}
+
+func (x *UpdateReleaseRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
type Release struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -320,7 +378,7 @@ type Release struct {
func (x *Release) Reset() {
*x = Release{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_release_service_proto_msgTypes[4]
+ mi := &file_v1_release_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -333,7 +391,7 @@ func (x *Release) String() string {
func (*Release) ProtoMessage() {}
func (x *Release) ProtoReflect() protoreflect.Message {
- mi := &file_v1_release_service_proto_msgTypes[4]
+ mi := &file_v1_release_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -346,7 +404,7 @@ func (x *Release) ProtoReflect() protoreflect.Message {
// Deprecated: Use Release.ProtoReflect.Descriptor instead.
func (*Release) Descriptor() ([]byte, []int) {
- return file_v1_release_service_proto_rawDescGZIP(), []int{4}
+ return file_v1_release_service_proto_rawDescGZIP(), []int{5}
}
func (x *Release) GetName() string {
@@ -411,7 +469,7 @@ type Release_File struct {
func (x *Release_File) Reset() {
*x = Release_File{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_release_service_proto_msgTypes[5]
+ mi := &file_v1_release_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -424,7 +482,7 @@ func (x *Release_File) String() string {
func (*Release_File) ProtoMessage() {}
func (x *Release_File) ProtoReflect() protoreflect.Message {
- mi := &file_v1_release_service_proto_msgTypes[5]
+ mi := &file_v1_release_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -437,7 +495,7 @@ func (x *Release_File) ProtoReflect() protoreflect.Message {
// Deprecated: Use Release_File.ProtoReflect.Descriptor instead.
func (*Release_File) Descriptor() ([]byte, []int) {
- return file_v1_release_service_proto_rawDescGZIP(), []int{4, 0}
+ return file_v1_release_service_proto_rawDescGZIP(), []int{5, 0}
}
func (x *Release_File) GetName() string {
@@ -487,7 +545,7 @@ type Release_VCSSource struct {
func (x *Release_VCSSource) Reset() {
*x = Release_VCSSource{}
if protoimpl.UnsafeEnabled {
- mi := &file_v1_release_service_proto_msgTypes[6]
+ mi := &file_v1_release_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -500,7 +558,7 @@ func (x *Release_VCSSource) String() string {
func (*Release_VCSSource) ProtoMessage() {}
func (x *Release_VCSSource) ProtoReflect() protoreflect.Message {
- mi := &file_v1_release_service_proto_msgTypes[6]
+ mi := &file_v1_release_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -513,7 +571,7 @@ func (x *Release_VCSSource) ProtoReflect() protoreflect.Message {
// Deprecated: Use Release_VCSSource.ProtoReflect.Descriptor instead.
func (*Release_VCSSource) Descriptor() ([]byte, []int) {
- return file_v1_release_service_proto_rawDescGZIP(), []int{4, 1}
+ return file_v1_release_service_proto_rawDescGZIP(), []int{5, 1}
}
func (x *Release_VCSSource) GetVcsType() VCSType {
@@ -542,109 +600,130 @@ var file_v1_release_service_proto_rawDesc = []byte{
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64,
0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f,
- 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67,
- 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65,
- 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f,
- 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46, 0x0a, 0x11,
- 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x12, 0x31, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
- 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06,
+ 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c,
+ 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69,
+ 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76,
+ 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x46,
+ 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x31, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
+ 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35,
+ 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d,
+ 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70,
+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69,
+ 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69,
+ 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x22, 0x70, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x52, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e,
+ 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f,
+ 0x6b, 0x65, 0x6e, 0x22, 0x83, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41,
0x01, 0x02, 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x63, 0x6f, 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72,
- 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
- 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
- 0x70, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x52,
- 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52,
- 0x08, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,
- 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,
- 0x6e, 0x22, 0x83, 0x01, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x61,
- 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1d, 0xe2, 0x41, 0x01, 0x02,
- 0xfa, 0x41, 0x16, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f,
- 0x6d, 0x2f, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
- 0x74, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x07,
- 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0xed, 0x04, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2f, 0x0a,
- 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3d,
- 0x0a, 0x0a, 0x76, 0x63, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72,
- 0x63, 0x65, 0x52, 0x09, 0x76, 0x63, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a,
- 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,
- 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a,
- 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04,
- 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65,
- 0x1a, 0xba, 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
- 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a,
- 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa, 0x41,
- 0x14, 0x0a, 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
- 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0a,
- 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
- 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x09, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x68, 0x61,
- 0x31, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32,
- 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65,
- 0x6c, 0x65, 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
- 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a,
- 0x09, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x76, 0x63,
- 0x73, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x54, 0x79,
- 0x70, 0x65, 0x52, 0x07, 0x76, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x70,
- 0x75, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18,
- 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x55, 0x72, 0x6c, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x12, 0x25, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72,
- 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x7d, 0x2a, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59,
- 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
- 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x32,
- 0x9d, 0x03, 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69,
- 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
- 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47,
- 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52,
- 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65,
- 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74,
- 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x65, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02,
+ 0x52, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x89, 0x01, 0x0a, 0x14, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x12, 0x34, 0x0a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
+ 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
+ 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0xed, 0x04, 0x0a, 0x07, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x05, 0x66,
+ 0x69, 0x6c, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x0a,
+ 0x76, 0x63, 0x73, 0x5f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52,
+ 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x56, 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x52, 0x09, 0x76, 0x63, 0x73, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1e, 0x0a, 0x07, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41,
+ 0x01, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x0b, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
+ 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0xe2, 0x41,
+ 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0xba,
+ 0x01, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2d, 0x0a, 0x05, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x17, 0xfa, 0x41, 0x14, 0x0a,
+ 0x12, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x68,
+ 0x65, 0x65, 0x74, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0a, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x5f, 0x73, 0x68, 0x61, 0x31, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,
+ 0xe2, 0x41, 0x01, 0x03, 0x52, 0x09, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x68, 0x61, 0x31, 0x12,
+ 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65,
+ 0x61, 0x73, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,
+ 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x1a, 0x66, 0x0a, 0x09, 0x56,
+ 0x43, 0x53, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x76, 0x63, 0x73, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x14, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x43, 0x53, 0x54, 0x79, 0x70, 0x65,
+ 0x52, 0x07, 0x76, 0x63, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x75, 0x6c,
+ 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x55, 0x72, 0x6c, 0x3a, 0x40, 0xea, 0x41, 0x3d, 0x0a, 0x14, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x25,
+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x7d, 0x2a, 0x36, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x46, 0x69, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45,
+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d,
+ 0x0a, 0x09, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x32, 0xb9, 0x04,
+ 0x0a, 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x12, 0x73, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x1e,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,
+ 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73,
+ 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74,
- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x6c,
- 0x65, 0x61, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda,
- 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20,
- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
- 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73,
- 0x12, 0x8c, 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61,
- 0x73, 0x65, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x42, 0xda, 0x41, 0x0e,
- 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x20, 0x2f,
- 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65,
- 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x42,
- 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f,
- 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x06,
+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,
+ 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x8c,
+ 0x01, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65,
+ 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x42, 0xda, 0x41, 0x0e, 0x70, 0x61,
+ 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x2b, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x20, 0x2f, 0x76, 0x31,
+ 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x12, 0x99, 0x01,
+ 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x12,
+ 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x13, 0x72, 0x65, 0x6c,
+ 0x65, 0x61, 0x73, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x07, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x32,
+ 0x28, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x72, 0x65,
+ 0x6c, 0x65, 0x61, 0x73, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -660,38 +739,44 @@ func file_v1_release_service_proto_rawDescGZIP() []byte {
}
var file_v1_release_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
-var file_v1_release_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
+var file_v1_release_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
var file_v1_release_service_proto_goTypes = []any{
(ReleaseFileType)(0), // 0: bytebase.v1.ReleaseFileType
(*GetReleaseRequest)(nil), // 1: bytebase.v1.GetReleaseRequest
(*ListReleasesRequest)(nil), // 2: bytebase.v1.ListReleasesRequest
(*ListReleasesResponse)(nil), // 3: bytebase.v1.ListReleasesResponse
(*CreateReleaseRequest)(nil), // 4: bytebase.v1.CreateReleaseRequest
- (*Release)(nil), // 5: bytebase.v1.Release
- (*Release_File)(nil), // 6: bytebase.v1.Release.File
- (*Release_VCSSource)(nil), // 7: bytebase.v1.Release.VCSSource
- (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp
- (VCSType)(0), // 9: bytebase.v1.VCSType
+ (*UpdateReleaseRequest)(nil), // 5: bytebase.v1.UpdateReleaseRequest
+ (*Release)(nil), // 6: bytebase.v1.Release
+ (*Release_File)(nil), // 7: bytebase.v1.Release.File
+ (*Release_VCSSource)(nil), // 8: bytebase.v1.Release.VCSSource
+ (*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask
+ (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp
+ (VCSType)(0), // 11: bytebase.v1.VCSType
}
var file_v1_release_service_proto_depIdxs = []int32{
- 5, // 0: bytebase.v1.ListReleasesResponse.releases:type_name -> bytebase.v1.Release
- 5, // 1: bytebase.v1.CreateReleaseRequest.release:type_name -> bytebase.v1.Release
- 6, // 2: bytebase.v1.Release.files:type_name -> bytebase.v1.Release.File
- 7, // 3: bytebase.v1.Release.vcs_source:type_name -> bytebase.v1.Release.VCSSource
- 8, // 4: bytebase.v1.Release.create_time:type_name -> google.protobuf.Timestamp
- 0, // 5: bytebase.v1.Release.File.type:type_name -> bytebase.v1.ReleaseFileType
- 9, // 6: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType
- 1, // 7: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest
- 2, // 8: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest
- 4, // 9: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest
- 5, // 10: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release
- 3, // 11: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse
- 5, // 12: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release
- 10, // [10:13] is the sub-list for method output_type
- 7, // [7:10] is the sub-list for method input_type
- 7, // [7:7] is the sub-list for extension type_name
- 7, // [7:7] is the sub-list for extension extendee
- 0, // [0:7] is the sub-list for field type_name
+ 6, // 0: bytebase.v1.ListReleasesResponse.releases:type_name -> bytebase.v1.Release
+ 6, // 1: bytebase.v1.CreateReleaseRequest.release:type_name -> bytebase.v1.Release
+ 6, // 2: bytebase.v1.UpdateReleaseRequest.release:type_name -> bytebase.v1.Release
+ 9, // 3: bytebase.v1.UpdateReleaseRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 7, // 4: bytebase.v1.Release.files:type_name -> bytebase.v1.Release.File
+ 8, // 5: bytebase.v1.Release.vcs_source:type_name -> bytebase.v1.Release.VCSSource
+ 10, // 6: bytebase.v1.Release.create_time:type_name -> google.protobuf.Timestamp
+ 0, // 7: bytebase.v1.Release.File.type:type_name -> bytebase.v1.ReleaseFileType
+ 11, // 8: bytebase.v1.Release.VCSSource.vcs_type:type_name -> bytebase.v1.VCSType
+ 1, // 9: bytebase.v1.ReleaseService.GetRelease:input_type -> bytebase.v1.GetReleaseRequest
+ 2, // 10: bytebase.v1.ReleaseService.ListReleases:input_type -> bytebase.v1.ListReleasesRequest
+ 4, // 11: bytebase.v1.ReleaseService.CreateRelease:input_type -> bytebase.v1.CreateReleaseRequest
+ 5, // 12: bytebase.v1.ReleaseService.UpdateRelease:input_type -> bytebase.v1.UpdateReleaseRequest
+ 6, // 13: bytebase.v1.ReleaseService.GetRelease:output_type -> bytebase.v1.Release
+ 3, // 14: bytebase.v1.ReleaseService.ListReleases:output_type -> bytebase.v1.ListReleasesResponse
+ 6, // 15: bytebase.v1.ReleaseService.CreateRelease:output_type -> bytebase.v1.Release
+ 6, // 16: bytebase.v1.ReleaseService.UpdateRelease:output_type -> bytebase.v1.Release
+ 13, // [13:17] is the sub-list for method output_type
+ 9, // [9:13] is the sub-list for method input_type
+ 9, // [9:9] is the sub-list for extension type_name
+ 9, // [9:9] is the sub-list for extension extendee
+ 0, // [0:9] is the sub-list for field type_name
}
func init() { file_v1_release_service_proto_init() }
@@ -750,7 +835,7 @@ func file_v1_release_service_proto_init() {
}
}
file_v1_release_service_proto_msgTypes[4].Exporter = func(v any, i int) any {
- switch v := v.(*Release); i {
+ switch v := v.(*UpdateReleaseRequest); i {
case 0:
return &v.state
case 1:
@@ -762,7 +847,7 @@ func file_v1_release_service_proto_init() {
}
}
file_v1_release_service_proto_msgTypes[5].Exporter = func(v any, i int) any {
- switch v := v.(*Release_File); i {
+ switch v := v.(*Release); i {
case 0:
return &v.state
case 1:
@@ -774,6 +859,18 @@ func file_v1_release_service_proto_init() {
}
}
file_v1_release_service_proto_msgTypes[6].Exporter = func(v any, i int) any {
+ switch v := v.(*Release_File); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_release_service_proto_msgTypes[7].Exporter = func(v any, i int) any {
switch v := v.(*Release_VCSSource); i {
case 0:
return &v.state
@@ -792,7 +889,7 @@ func file_v1_release_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_release_service_proto_rawDesc,
NumEnums: 1,
- NumMessages: 7,
+ NumMessages: 8,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/proto/generated-go/v1/release_service.pb.gw.go b/proto/generated-go/v1/release_service.pb.gw.go
index 6e0e95cc13..33c81c3512 100644
--- a/proto/generated-go/v1/release_service.pb.gw.go
+++ b/proto/generated-go/v1/release_service.pb.gw.go
@@ -213,6 +213,106 @@ func local_request_ReleaseService_CreateRelease_0(ctx context.Context, marshaler
}
+var (
+ filter_ReleaseService_UpdateRelease_0 = &utilities.DoubleArray{Encoding: map[string]int{"release": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
+)
+
+func request_ReleaseService_UpdateRelease_0(ctx context.Context, marshaler runtime.Marshaler, client ReleaseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateReleaseRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Release); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Release); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["release.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "release.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release.name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ReleaseService_UpdateRelease_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.UpdateRelease(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_ReleaseService_UpdateRelease_0(ctx context.Context, marshaler runtime.Marshaler, server ReleaseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateReleaseRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Release); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Release); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["release.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "release.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "release.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "release.name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ReleaseService_UpdateRelease_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.UpdateRelease(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
// RegisterReleaseServiceHandlerServer registers the http handlers for service ReleaseService to "mux".
// UnaryRPC :call ReleaseServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -295,6 +395,31 @@ func RegisterReleaseServiceHandlerServer(ctx context.Context, mux *runtime.Serve
})
+ mux.Handle("PATCH", pattern_ReleaseService_UpdateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ReleaseService/UpdateRelease", runtime.WithHTTPPathPattern("/v1/{release.name=projects/*/releases/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_ReleaseService_UpdateRelease_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ReleaseService_UpdateRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -402,6 +527,28 @@ func RegisterReleaseServiceHandlerClient(ctx context.Context, mux *runtime.Serve
})
+ mux.Handle("PATCH", pattern_ReleaseService_UpdateRelease_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ReleaseService/UpdateRelease", runtime.WithHTTPPathPattern("/v1/{release.name=projects/*/releases/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_ReleaseService_UpdateRelease_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_ReleaseService_UpdateRelease_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
return nil
}
@@ -411,6 +558,8 @@ var (
pattern_ReleaseService_ListReleases_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "releases"}, ""))
pattern_ReleaseService_CreateRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "releases"}, ""))
+
+ pattern_ReleaseService_UpdateRelease_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "releases", "release.name"}, ""))
)
var (
@@ -419,4 +568,6 @@ var (
forward_ReleaseService_ListReleases_0 = runtime.ForwardResponseMessage
forward_ReleaseService_CreateRelease_0 = runtime.ForwardResponseMessage
+
+ forward_ReleaseService_UpdateRelease_0 = runtime.ForwardResponseMessage
)
diff --git a/proto/generated-go/v1/release_service_grpc.pb.go b/proto/generated-go/v1/release_service_grpc.pb.go
index be601f4f27..4d7e79637b 100644
--- a/proto/generated-go/v1/release_service_grpc.pb.go
+++ b/proto/generated-go/v1/release_service_grpc.pb.go
@@ -22,6 +22,7 @@ const (
ReleaseService_GetRelease_FullMethodName = "/bytebase.v1.ReleaseService/GetRelease"
ReleaseService_ListReleases_FullMethodName = "/bytebase.v1.ReleaseService/ListReleases"
ReleaseService_CreateRelease_FullMethodName = "/bytebase.v1.ReleaseService/CreateRelease"
+ ReleaseService_UpdateRelease_FullMethodName = "/bytebase.v1.ReleaseService/UpdateRelease"
)
// ReleaseServiceClient is the client API for ReleaseService service.
@@ -31,6 +32,7 @@ type ReleaseServiceClient interface {
GetRelease(ctx context.Context, in *GetReleaseRequest, opts ...grpc.CallOption) (*Release, error)
ListReleases(ctx context.Context, in *ListReleasesRequest, opts ...grpc.CallOption) (*ListReleasesResponse, error)
CreateRelease(ctx context.Context, in *CreateReleaseRequest, opts ...grpc.CallOption) (*Release, error)
+ UpdateRelease(ctx context.Context, in *UpdateReleaseRequest, opts ...grpc.CallOption) (*Release, error)
}
type releaseServiceClient struct {
@@ -71,6 +73,16 @@ func (c *releaseServiceClient) CreateRelease(ctx context.Context, in *CreateRele
return out, nil
}
+func (c *releaseServiceClient) UpdateRelease(ctx context.Context, in *UpdateReleaseRequest, opts ...grpc.CallOption) (*Release, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(Release)
+ err := c.cc.Invoke(ctx, ReleaseService_UpdateRelease_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
// ReleaseServiceServer is the server API for ReleaseService service.
// All implementations must embed UnimplementedReleaseServiceServer
// for forward compatibility.
@@ -78,6 +90,7 @@ type ReleaseServiceServer interface {
GetRelease(context.Context, *GetReleaseRequest) (*Release, error)
ListReleases(context.Context, *ListReleasesRequest) (*ListReleasesResponse, error)
CreateRelease(context.Context, *CreateReleaseRequest) (*Release, error)
+ UpdateRelease(context.Context, *UpdateReleaseRequest) (*Release, error)
mustEmbedUnimplementedReleaseServiceServer()
}
@@ -97,6 +110,9 @@ func (UnimplementedReleaseServiceServer) ListReleases(context.Context, *ListRele
func (UnimplementedReleaseServiceServer) CreateRelease(context.Context, *CreateReleaseRequest) (*Release, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateRelease not implemented")
}
+func (UnimplementedReleaseServiceServer) UpdateRelease(context.Context, *UpdateReleaseRequest) (*Release, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateRelease not implemented")
+}
func (UnimplementedReleaseServiceServer) mustEmbedUnimplementedReleaseServiceServer() {}
func (UnimplementedReleaseServiceServer) testEmbeddedByValue() {}
@@ -172,6 +188,24 @@ func _ReleaseService_CreateRelease_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
+func _ReleaseService_UpdateRelease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateReleaseRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(ReleaseServiceServer).UpdateRelease(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: ReleaseService_UpdateRelease_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(ReleaseServiceServer).UpdateRelease(ctx, req.(*UpdateReleaseRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
// ReleaseService_ServiceDesc is the grpc.ServiceDesc for ReleaseService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -191,6 +225,10 @@ var ReleaseService_ServiceDesc = grpc.ServiceDesc{
MethodName: "CreateRelease",
Handler: _ReleaseService_CreateRelease_Handler,
},
+ {
+ MethodName: "UpdateRelease",
+ Handler: _ReleaseService_UpdateRelease_Handler,
+ },
},
Streams: []grpc.StreamDesc{},
Metadata: "v1/release_service.proto",
diff --git a/proto/v1/release_service.proto b/proto/v1/release_service.proto
index 1a0ca6fa3e..bb624298a7 100644
--- a/proto/v1/release_service.proto
+++ b/proto/v1/release_service.proto
@@ -6,6 +6,7 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
+import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "v1/common.proto";
@@ -27,6 +28,13 @@ service ReleaseService {
};
option (google.api.method_signature) = "parent,release";
}
+ rpc UpdateRelease(UpdateReleaseRequest) returns (Release) {
+ option (google.api.http) = {
+ patch: "/v1/{release.name=projects/*/releases/*}"
+ body: "release"
+ };
+ option (google.api.method_signature) = "release,update_mask";
+ }
}
message GetReleaseRequest {
@@ -76,6 +84,14 @@ message CreateReleaseRequest {
Release release = 2 [(google.api.field_behavior) = REQUIRED];
}
+message UpdateReleaseRequest {
+ // The release to update.
+ Release release = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to be updated.
+ google.protobuf.FieldMask update_mask = 2;
+}
+
message Release {
option (google.api.resource) = {
type: "bytebase.com/Release"