Skip to content

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

feat(proto): approval (#5101)

p0ny08c9d5c0d77c
diff --git a/frontend/src/types/proto/store/approval.ts b/frontend/src/types/proto/store/approval.ts
new file mode 100644
index 0000000000..9e7d733ccd
--- /dev/null
+++ b/frontend/src/types/proto/store/approval.ts
@@ -0,0 +1,613 @@
+/* eslint-disable */
+import * as _m0 from "protobufjs/minimal";
+
+export const protobufPackage = "bytebase.store";
+
+/**
+ * IssuePayloadApproval is a part of the payload of an issue.
+ * IssuePayloadApproval records the approval template used and the approval history.
+ */
+export interface IssuePayloadApproval {
+ approvalTemplates: ApprovalTemplate[];
+ approvers: IssuePayloadApproval_Approver[];
+}
+
+export interface IssuePayloadApproval_Approver {
+ /** The new status. */
+ status: IssuePayloadApproval_Approver_Status;
+ /** The principal id of the approver. */
+ principalId: number;
+}
+
+export enum IssuePayloadApproval_Approver_Status {
+ STATUS_UNSPECIFIED = 0,
+ PENDING = 1,
+ APPROVED = 2,
+ UNRECOGNIZED = -1,
+}
+
+export function issuePayloadApproval_Approver_StatusFromJSON(object: any): IssuePayloadApproval_Approver_Status {
+ switch (object) {
+ case 0:
+ case "STATUS_UNSPECIFIED":
+ return IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED;
+ case 1:
+ case "PENDING":
+ return IssuePayloadApproval_Approver_Status.PENDING;
+ case 2:
+ case "APPROVED":
+ return IssuePayloadApproval_Approver_Status.APPROVED;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return IssuePayloadApproval_Approver_Status.UNRECOGNIZED;
+ }
+}
+
+export function issuePayloadApproval_Approver_StatusToJSON(object: IssuePayloadApproval_Approver_Status): string {
+ switch (object) {
+ case IssuePayloadApproval_Approver_Status.STATUS_UNSPECIFIED:
+ return "STATUS_UNSPECIFIED";
+ case IssuePayloadApproval_Approver_Status.PENDING:
+ return "PENDING";
+ case IssuePayloadApproval_Approver_Status.APPROVED:
+ return "APPROVED";
+ case IssuePayloadApproval_Approver_Status.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export interface ApprovalTemplate {
+ flow?: ApprovalFlow;
+ title: string;
+ description: string;
+ creatorId: number;
+}
+
+export interface ApprovalFlow {
+ steps: ApprovalStep[];
+}
+
+export interface ApprovalStep {
+ type: ApprovalStep_Type;
+ nodes: ApprovalNode[];
+}
+
+/**
+ * Type of the ApprovalStep
+ * ALL means every node must be approved to proceed.
+ * ANY means approving any node will proceed.
+ */
+export enum ApprovalStep_Type {
+ TYPE_UNSPECIFIED = 0,
+ ALL = 1,
+ ANY = 2,
+ UNRECOGNIZED = -1,
+}
+
+export function approvalStep_TypeFromJSON(object: any): ApprovalStep_Type {
+ switch (object) {
+ case 0:
+ case "TYPE_UNSPECIFIED":
+ return ApprovalStep_Type.TYPE_UNSPECIFIED;
+ case 1:
+ case "ALL":
+ return ApprovalStep_Type.ALL;
+ case 2:
+ case "ANY":
+ return ApprovalStep_Type.ANY;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ApprovalStep_Type.UNRECOGNIZED;
+ }
+}
+
+export function approvalStep_TypeToJSON(object: ApprovalStep_Type): string {
+ switch (object) {
+ case ApprovalStep_Type.TYPE_UNSPECIFIED:
+ return "TYPE_UNSPECIFIED";
+ case ApprovalStep_Type.ALL:
+ return "ALL";
+ case ApprovalStep_Type.ANY:
+ return "ANY";
+ case ApprovalStep_Type.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export interface ApprovalNode {
+ type: ApprovalNode_Type;
+ groupValue?: ApprovalNode_GroupValue | undefined;
+}
+
+/**
+ * Type of the ApprovalNode.
+ * type determines who should approve this node.
+ * ANY_IN_GROUP means the ApprovalNode can be approved by an user from our predefined user group.
+ * See GroupValue below for the predefined user groups.
+ */
+export enum ApprovalNode_Type {
+ TYPE_UNSPECIFIED = 0,
+ ANY_IN_GROUP = 1,
+ UNRECOGNIZED = -1,
+}
+
+export function approvalNode_TypeFromJSON(object: any): ApprovalNode_Type {
+ switch (object) {
+ case 0:
+ case "TYPE_UNSPECIFIED":
+ return ApprovalNode_Type.TYPE_UNSPECIFIED;
+ case 1:
+ case "ANY_IN_GROUP":
+ return ApprovalNode_Type.ANY_IN_GROUP;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ApprovalNode_Type.UNRECOGNIZED;
+ }
+}
+
+export function approvalNode_TypeToJSON(object: ApprovalNode_Type): string {
+ switch (object) {
+ case ApprovalNode_Type.TYPE_UNSPECIFIED:
+ return "TYPE_UNSPECIFIED";
+ case ApprovalNode_Type.ANY_IN_GROUP:
+ return "ANY_IN_GROUP";
+ case ApprovalNode_Type.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+/**
+ * GroupValue is used if ApprovalNode Type is ANY_IN_GROUP
+ * The predefined user groups are:
+ * - WORKSPACE_OWNER
+ * - WORKSPACE_DBA
+ * - PROJECT_OWNER
+ * - PROJECT_MEMBER
+ */
+export enum ApprovalNode_GroupValue {
+ GROUP_VALUE_UNSPECIFILED = 0,
+ WORKSPACE_OWNER = 1,
+ WORKSPACE_DBA = 2,
+ PROJECT_OWNER = 3,
+ PROJECT_MEMBER = 4,
+ UNRECOGNIZED = -1,
+}
+
+export function approvalNode_GroupValueFromJSON(object: any): ApprovalNode_GroupValue {
+ switch (object) {
+ case 0:
+ case "GROUP_VALUE_UNSPECIFILED":
+ return ApprovalNode_GroupValue.GROUP_VALUE_UNSPECIFILED;
+ case 1:
+ case "WORKSPACE_OWNER":
+ return ApprovalNode_GroupValue.WORKSPACE_OWNER;
+ case 2:
+ case "WORKSPACE_DBA":
+ return ApprovalNode_GroupValue.WORKSPACE_DBA;
+ case 3:
+ case "PROJECT_OWNER":
+ return ApprovalNode_GroupValue.PROJECT_OWNER;
+ case 4:
+ case "PROJECT_MEMBER":
+ return ApprovalNode_GroupValue.PROJECT_MEMBER;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ApprovalNode_GroupValue.UNRECOGNIZED;
+ }
+}
+
+export function approvalNode_GroupValueToJSON(object: ApprovalNode_GroupValue): string {
+ switch (object) {
+ case ApprovalNode_GroupValue.GROUP_VALUE_UNSPECIFILED:
+ return "GROUP_VALUE_UNSPECIFILED";
+ case ApprovalNode_GroupValue.WORKSPACE_OWNER:
+ return "WORKSPACE_OWNER";
+ case ApprovalNode_GroupValue.WORKSPACE_DBA:
+ return "WORKSPACE_DBA";
+ case ApprovalNode_GroupValue.PROJECT_OWNER:
+ return "PROJECT_OWNER";
+ case ApprovalNode_GroupValue.PROJECT_MEMBER:
+ return "PROJECT_MEMBER";
+ case ApprovalNode_GroupValue.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+function createBaseIssuePayloadApproval(): IssuePayloadApproval {
+ return { approvalTemplates: [], approvers: [] };
+}
+
+export const IssuePayloadApproval = {
+ encode(message: IssuePayloadApproval, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.approvalTemplates) {
+ ApprovalTemplate.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ for (const v of message.approvers) {
+ IssuePayloadApproval_Approver.encode(v!, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): IssuePayloadApproval {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseIssuePayloadApproval();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.approvalTemplates.push(ApprovalTemplate.decode(reader, reader.uint32()));
+ break;
+ case 2:
+ message.approvers.push(IssuePayloadApproval_Approver.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): IssuePayloadApproval {
+ return {
+ approvalTemplates: Array.isArray(object?.approvalTemplates)
+ ? object.approvalTemplates.map((e: any) => ApprovalTemplate.fromJSON(e))
+ : [],
+ approvers: Array.isArray(object?.approvers)
+ ? object.approvers.map((e: any) => IssuePayloadApproval_Approver.fromJSON(e))
+ : [],
+ };
+ },
+
+ toJSON(message: IssuePayloadApproval): unknown {
+ const obj: any = {};
+ if (message.approvalTemplates) {
+ obj.approvalTemplates = message.approvalTemplates.map((e) => e ? ApprovalTemplate.toJSON(e) : undefined);
+ } else {
+ obj.approvalTemplates = [];
+ }
+ if (message.approvers) {
+ obj.approvers = message.approvers.map((e) => e ? IssuePayloadApproval_Approver.toJSON(e) : undefined);
+ } else {
+ obj.approvers = [];
+ }
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<IssuePayloadApproval>): IssuePayloadApproval {
+ const message = createBaseIssuePayloadApproval();
+ message.approvalTemplates = object.approvalTemplates?.map((e) => ApprovalTemplate.fromPartial(e)) || [];
+ message.approvers = object.approvers?.map((e) => IssuePayloadApproval_Approver.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseIssuePayloadApproval_Approver(): IssuePayloadApproval_Approver {
+ return { status: 0, principalId: 0 };
+}
+
+export const IssuePayloadApproval_Approver = {
+ encode(message: IssuePayloadApproval_Approver, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.status !== 0) {
+ writer.uint32(8).int32(message.status);
+ }
+ if (message.principalId !== 0) {
+ writer.uint32(16).int32(message.principalId);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): IssuePayloadApproval_Approver {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseIssuePayloadApproval_Approver();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.status = reader.int32() as any;
+ break;
+ case 2:
+ message.principalId = reader.int32();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): IssuePayloadApproval_Approver {
+ return {
+ status: isSet(object.status) ? issuePayloadApproval_Approver_StatusFromJSON(object.status) : 0,
+ principalId: isSet(object.principalId) ? Number(object.principalId) : 0,
+ };
+ },
+
+ toJSON(message: IssuePayloadApproval_Approver): unknown {
+ const obj: any = {};
+ message.status !== undefined && (obj.status = issuePayloadApproval_Approver_StatusToJSON(message.status));
+ message.principalId !== undefined && (obj.principalId = Math.round(message.principalId));
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<IssuePayloadApproval_Approver>): IssuePayloadApproval_Approver {
+ const message = createBaseIssuePayloadApproval_Approver();
+ message.status = object.status ?? 0;
+ message.principalId = object.principalId ?? 0;
+ return message;
+ },
+};
+
+function createBaseApprovalTemplate(): ApprovalTemplate {
+ return { flow: undefined, title: "", description: "", creatorId: 0 };
+}
+
+export const ApprovalTemplate = {
+ encode(message: ApprovalTemplate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.flow !== undefined) {
+ ApprovalFlow.encode(message.flow, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.title !== "") {
+ writer.uint32(18).string(message.title);
+ }
+ if (message.description !== "") {
+ writer.uint32(26).string(message.description);
+ }
+ if (message.creatorId !== 0) {
+ writer.uint32(32).int32(message.creatorId);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalTemplate {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalTemplate();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.flow = ApprovalFlow.decode(reader, reader.uint32());
+ break;
+ case 2:
+ message.title = reader.string();
+ break;
+ case 3:
+ message.description = reader.string();
+ break;
+ case 4:
+ message.creatorId = reader.int32();
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalTemplate {
+ return {
+ flow: isSet(object.flow) ? ApprovalFlow.fromJSON(object.flow) : undefined,
+ title: isSet(object.title) ? String(object.title) : "",
+ description: isSet(object.description) ? String(object.description) : "",
+ creatorId: isSet(object.creatorId) ? Number(object.creatorId) : 0,
+ };
+ },
+
+ toJSON(message: ApprovalTemplate): unknown {
+ const obj: any = {};
+ message.flow !== undefined && (obj.flow = message.flow ? ApprovalFlow.toJSON(message.flow) : undefined);
+ message.title !== undefined && (obj.title = message.title);
+ message.description !== undefined && (obj.description = message.description);
+ message.creatorId !== undefined && (obj.creatorId = Math.round(message.creatorId));
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalTemplate>): ApprovalTemplate {
+ const message = createBaseApprovalTemplate();
+ message.flow = (object.flow !== undefined && object.flow !== null)
+ ? ApprovalFlow.fromPartial(object.flow)
+ : undefined;
+ message.title = object.title ?? "";
+ message.description = object.description ?? "";
+ message.creatorId = object.creatorId ?? 0;
+ return message;
+ },
+};
+
+function createBaseApprovalFlow(): ApprovalFlow {
+ return { steps: [] };
+}
+
+export const ApprovalFlow = {
+ encode(message: ApprovalFlow, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.steps) {
+ ApprovalStep.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalFlow {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalFlow();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.steps.push(ApprovalStep.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalFlow {
+ return { steps: Array.isArray(object?.steps) ? object.steps.map((e: any) => ApprovalStep.fromJSON(e)) : [] };
+ },
+
+ toJSON(message: ApprovalFlow): unknown {
+ const obj: any = {};
+ if (message.steps) {
+ obj.steps = message.steps.map((e) => e ? ApprovalStep.toJSON(e) : undefined);
+ } else {
+ obj.steps = [];
+ }
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalFlow>): ApprovalFlow {
+ const message = createBaseApprovalFlow();
+ message.steps = object.steps?.map((e) => ApprovalStep.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseApprovalStep(): ApprovalStep {
+ return { type: 0, nodes: [] };
+}
+
+export const ApprovalStep = {
+ encode(message: ApprovalStep, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.type !== 0) {
+ writer.uint32(8).int32(message.type);
+ }
+ for (const v of message.nodes) {
+ ApprovalNode.encode(v!, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalStep {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalStep();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.type = reader.int32() as any;
+ break;
+ case 2:
+ message.nodes.push(ApprovalNode.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalStep {
+ return {
+ type: isSet(object.type) ? approvalStep_TypeFromJSON(object.type) : 0,
+ nodes: Array.isArray(object?.nodes) ? object.nodes.map((e: any) => ApprovalNode.fromJSON(e)) : [],
+ };
+ },
+
+ toJSON(message: ApprovalStep): unknown {
+ const obj: any = {};
+ message.type !== undefined && (obj.type = approvalStep_TypeToJSON(message.type));
+ if (message.nodes) {
+ obj.nodes = message.nodes.map((e) => e ? ApprovalNode.toJSON(e) : undefined);
+ } else {
+ obj.nodes = [];
+ }
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalStep>): ApprovalStep {
+ const message = createBaseApprovalStep();
+ message.type = object.type ?? 0;
+ message.nodes = object.nodes?.map((e) => ApprovalNode.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseApprovalNode(): ApprovalNode {
+ return { type: 0, groupValue: undefined };
+}
+
+export const ApprovalNode = {
+ encode(message: ApprovalNode, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.type !== 0) {
+ writer.uint32(8).int32(message.type);
+ }
+ if (message.groupValue !== undefined) {
+ writer.uint32(16).int32(message.groupValue);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalNode {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalNode();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.type = reader.int32() as any;
+ break;
+ case 2:
+ message.groupValue = reader.int32() as any;
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalNode {
+ return {
+ type: isSet(object.type) ? approvalNode_TypeFromJSON(object.type) : 0,
+ groupValue: isSet(object.groupValue) ? approvalNode_GroupValueFromJSON(object.groupValue) : undefined,
+ };
+ },
+
+ toJSON(message: ApprovalNode): unknown {
+ const obj: any = {};
+ message.type !== undefined && (obj.type = approvalNode_TypeToJSON(message.type));
+ message.groupValue !== undefined &&
+ (obj.groupValue = message.groupValue !== undefined
+ ? approvalNode_GroupValueToJSON(message.groupValue)
+ : undefined);
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalNode>): ApprovalNode {
+ const message = createBaseApprovalNode();
+ message.type = object.type ?? 0;
+ message.groupValue = object.groupValue ?? undefined;
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/frontend/src/types/proto/store/issue.ts b/frontend/src/types/proto/store/issue.ts
new file mode 100644
index 0000000000..58f9420eb0
--- /dev/null
+++ b/frontend/src/types/proto/store/issue.ts
@@ -0,0 +1,70 @@
+/* eslint-disable */
+import * as _m0 from "protobufjs/minimal";
+import { IssuePayloadApproval } from "./approval";
+
+export const protobufPackage = "bytebase.store";
+
+export interface IssuePayload {
+ approval?: IssuePayloadApproval;
+}
+
+function createBaseIssuePayload(): IssuePayload {
+ return { approval: undefined };
+}
+
+export const IssuePayload = {
+ encode(message: IssuePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.approval !== undefined) {
+ IssuePayloadApproval.encode(message.approval, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): IssuePayload {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseIssuePayload();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.approval = IssuePayloadApproval.decode(reader, reader.uint32());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): IssuePayload {
+ return { approval: isSet(object.approval) ? IssuePayloadApproval.fromJSON(object.approval) : undefined };
+ },
+
+ toJSON(message: IssuePayload): unknown {
+ const obj: any = {};
+ message.approval !== undefined &&
+ (obj.approval = message.approval ? IssuePayloadApproval.toJSON(message.approval) : undefined);
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<IssuePayload>): IssuePayload {
+ const message = createBaseIssuePayload();
+ message.approval = (object.approval !== undefined && object.approval !== null)
+ ? IssuePayloadApproval.fromPartial(object.approval)
+ : undefined;
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/frontend/src/types/proto/store/setting.ts b/frontend/src/types/proto/store/setting.ts
index 12df42ab34..71e8b896aa 100644
--- a/frontend/src/types/proto/store/setting.ts
+++ b/frontend/src/types/proto/store/setting.ts
@@ -1,5 +1,7 @@
/* eslint-disable */
import * as _m0 from "protobufjs/minimal";
+import { ParsedExpr } from "../google/api/expr/v1alpha1/syntax";
+import { ApprovalTemplate } from "./approval";
export const protobufPackage = "bytebase.store";
@@ -23,6 +25,15 @@ export interface AgentPluginSetting {
token: string;
}
+export interface ApprovalConfigSetting {
+ rules: ApprovalConfigSetting_Rule[];
+}
+
+export interface ApprovalConfigSetting_Rule {
+ expression?: ParsedExpr;
+ template?: ApprovalTemplate;
+}
+
function createBaseWorkspaceProfileSetting(): WorkspaceProfileSetting {
return { externalUrl: "", disallowSignup: false };
}
@@ -136,6 +147,123 @@ export const AgentPluginSetting = {
},
};
+function createBaseApprovalConfigSetting(): ApprovalConfigSetting {
+ return { rules: [] };
+}
+
+export const ApprovalConfigSetting = {
+ encode(message: ApprovalConfigSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.rules) {
+ ApprovalConfigSetting_Rule.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalConfigSetting {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalConfigSetting();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.rules.push(ApprovalConfigSetting_Rule.decode(reader, reader.uint32()));
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalConfigSetting {
+ return {
+ rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => ApprovalConfigSetting_Rule.fromJSON(e)) : [],
+ };
+ },
+
+ toJSON(message: ApprovalConfigSetting): unknown {
+ const obj: any = {};
+ if (message.rules) {
+ obj.rules = message.rules.map((e) => e ? ApprovalConfigSetting_Rule.toJSON(e) : undefined);
+ } else {
+ obj.rules = [];
+ }
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalConfigSetting>): ApprovalConfigSetting {
+ const message = createBaseApprovalConfigSetting();
+ message.rules = object.rules?.map((e) => ApprovalConfigSetting_Rule.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseApprovalConfigSetting_Rule(): ApprovalConfigSetting_Rule {
+ return { expression: undefined, template: undefined };
+}
+
+export const ApprovalConfigSetting_Rule = {
+ encode(message: ApprovalConfigSetting_Rule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.expression !== undefined) {
+ ParsedExpr.encode(message.expression, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.template !== undefined) {
+ ApprovalTemplate.encode(message.template, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ApprovalConfigSetting_Rule {
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseApprovalConfigSetting_Rule();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ message.expression = ParsedExpr.decode(reader, reader.uint32());
+ break;
+ case 2:
+ message.template = ApprovalTemplate.decode(reader, reader.uint32());
+ break;
+ default:
+ reader.skipType(tag & 7);
+ break;
+ }
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ApprovalConfigSetting_Rule {
+ return {
+ expression: isSet(object.expression) ? ParsedExpr.fromJSON(object.expression) : undefined,
+ template: isSet(object.template) ? ApprovalTemplate.fromJSON(object.template) : undefined,
+ };
+ },
+
+ toJSON(message: ApprovalConfigSetting_Rule): unknown {
+ const obj: any = {};
+ message.expression !== undefined &&
+ (obj.expression = message.expression ? ParsedExpr.toJSON(message.expression) : undefined);
+ message.template !== undefined &&
+ (obj.template = message.template ? ApprovalTemplate.toJSON(message.template) : undefined);
+ return obj;
+ },
+
+ fromPartial(object: DeepPartial<ApprovalConfigSetting_Rule>): ApprovalConfigSetting_Rule {
+ const message = createBaseApprovalConfigSetting_Rule();
+ message.expression = (object.expression !== undefined && object.expression !== null)
+ ? ParsedExpr.fromPartial(object.expression)
+ : undefined;
+ message.template = (object.template !== undefined && object.template !== null)
+ ? ApprovalTemplate.fromPartial(object.template)
+ : undefined;
+ return message;
+ },
+};
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
export type DeepPartial<T> = T extends Builtin ? T
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 2fa921407b..89733e8610 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -13,6 +13,19 @@
- [ActivityIssueCommentCreatePayload.ExternalApprovalEvent.Action](#bytebase-store-ActivityIssueCommentCreatePayload-ExternalApprovalEvent-Action)
- [ActivityIssueCommentCreatePayload.ExternalApprovalEvent.Type](#bytebase-store-ActivityIssueCommentCreatePayload-ExternalApprovalEvent-Type)
+- [store/approval.proto](#store_approval-proto)
+ - [ApprovalFlow](#bytebase-store-ApprovalFlow)
+ - [ApprovalNode](#bytebase-store-ApprovalNode)
+ - [ApprovalStep](#bytebase-store-ApprovalStep)
+ - [ApprovalTemplate](#bytebase-store-ApprovalTemplate)
+ - [IssuePayloadApproval](#bytebase-store-IssuePayloadApproval)
+ - [IssuePayloadApproval.Approver](#bytebase-store-IssuePayloadApproval-Approver)
+
+ - [ApprovalNode.GroupValue](#bytebase-store-ApprovalNode-GroupValue)
+ - [ApprovalNode.Type](#bytebase-store-ApprovalNode-Type)
+ - [ApprovalStep.Type](#bytebase-store-ApprovalStep-Type)
+ - [IssuePayloadApproval.Approver.Status](#bytebase-store-IssuePayloadApproval-Approver-Status)
+
- [store/data_source.proto](#store_data_source-proto)
- [DataSourceOptions](#bytebase-store-DataSourceOptions)
@@ -37,8 +50,13 @@
- [IdentityProviderType](#bytebase-store-IdentityProviderType)
+- [store/issue.proto](#store_issue-proto)
+ - [IssuePayload](#bytebase-store-IssuePayload)
+
- [store/setting.proto](#store_setting-proto)
- [AgentPluginSetting](#bytebase-store-AgentPluginSetting)
+ - [ApprovalConfigSetting](#bytebase-store-ApprovalConfigSetting)
+ - [ApprovalConfigSetting.Rule](#bytebase-store-ApprovalConfigSetting-Rule)
- [WorkspaceProfileSetting](#bytebase-store-WorkspaceProfileSetting)
- [store/user.proto](#store_user-proto)
@@ -177,6 +195,183 @@ convert to the expected struct there.
+<a name="store_approval-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/approval.proto
+
+
+
+<a name="bytebase-store-ApprovalFlow"></a>
+
+### ApprovalFlow
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| steps | [ApprovalStep](#bytebase-store-ApprovalStep) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ApprovalNode"></a>
+
+### ApprovalNode
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| type | [ApprovalNode.Type](#bytebase-store-ApprovalNode-Type) | | |
+| group_value | [ApprovalNode.GroupValue](#bytebase-store-ApprovalNode-GroupValue) | | |
+
+
+
+
+
+
+<a name="bytebase-store-ApprovalStep"></a>
+
+### ApprovalStep
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| type | [ApprovalStep.Type](#bytebase-store-ApprovalStep-Type) | | |
+| nodes | [ApprovalNode](#bytebase-store-ApprovalNode) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ApprovalTemplate"></a>
+
+### ApprovalTemplate
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| flow | [ApprovalFlow](#bytebase-store-ApprovalFlow) | | |
+| title | [string](#string) | | |
+| description | [string](#string) | | |
+| creator_id | [int32](#int32) | | |
+
+
+
+
+
+
+<a name="bytebase-store-IssuePayloadApproval"></a>
+
+### IssuePayloadApproval
+IssuePayloadApproval is a part of the payload of an issue.
+IssuePayloadApproval records the approval template used and the approval history.
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| approval_templates | [ApprovalTemplate](#bytebase-store-ApprovalTemplate) | repeated | |
+| approvers | [IssuePayloadApproval.Approver](#bytebase-store-IssuePayloadApproval-Approver) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-IssuePayloadApproval-Approver"></a>
+
+### IssuePayloadApproval.Approver
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| status | [IssuePayloadApproval.Approver.Status](#bytebase-store-IssuePayloadApproval-Approver-Status) | | The new status. |
+| principal_id | [int32](#int32) | | The principal id of the approver. |
+
+
+
+
+
+
+
+
+<a name="bytebase-store-ApprovalNode-GroupValue"></a>
+
+### ApprovalNode.GroupValue
+GroupValue is used if ApprovalNode Type is ANY_IN_GROUP
+The predefined user groups are:
+- WORKSPACE_OWNER
+- WORKSPACE_DBA
+- PROJECT_OWNER
+- PROJECT_MEMBER
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| GROUP_VALUE_UNSPECIFILED | 0 | |
+| WORKSPACE_OWNER | 1 | |
+| WORKSPACE_DBA | 2 | |
+| PROJECT_OWNER | 3 | |
+| PROJECT_MEMBER | 4 | |
+
+
+
+<a name="bytebase-store-ApprovalNode-Type"></a>
+
+### ApprovalNode.Type
+Type of the ApprovalNode.
+type determines who should approve this node.
+ANY_IN_GROUP means the ApprovalNode can be approved by an user from our predefined user group.
+See GroupValue below for the predefined user groups.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| TYPE_UNSPECIFIED | 0 | |
+| ANY_IN_GROUP | 1 | |
+
+
+
+<a name="bytebase-store-ApprovalStep-Type"></a>
+
+### ApprovalStep.Type
+Type of the ApprovalStep
+ALL means every node must be approved to proceed.
+ANY means approving any node will proceed.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| TYPE_UNSPECIFIED | 0 | |
+| ALL | 1 | |
+| ANY | 2 | |
+
+
+
+<a name="bytebase-store-IssuePayloadApproval-Approver-Status"></a>
+
+### IssuePayloadApproval.Approver.Status
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| STATUS_UNSPECIFIED | 0 | |
+| PENDING | 1 | |
+| APPROVED | 2 | |
+
+
+
+
+
+
+
+
+
+
<a name="store_data_source-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -549,6 +744,37 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
+<a name="store_issue-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/issue.proto
+
+
+
+<a name="bytebase-store-IssuePayload"></a>
+
+### IssuePayload
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| approval | [IssuePayloadApproval](#bytebase-store-IssuePayloadApproval) | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a name="store_setting-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -572,6 +798,37 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
+<a name="bytebase-store-ApprovalConfigSetting"></a>
+
+### ApprovalConfigSetting
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| rules | [ApprovalConfigSetting.Rule](#bytebase-store-ApprovalConfigSetting-Rule) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ApprovalConfigSetting-Rule"></a>
+
+### ApprovalConfigSetting.Rule
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| expression | [google.api.expr.v1alpha1.ParsedExpr](#google-api-expr-v1alpha1-ParsedExpr) | | |
+| template | [ApprovalTemplate](#bytebase-store-ApprovalTemplate) | | |
+
+
+
+
+
+
<a name="bytebase-store-WorkspaceProfileSetting"></a>
### WorkspaceProfileSetting
diff --git a/proto/generated-go/store/approval.pb.go b/proto/generated-go/store/approval.pb.go
new file mode 100644
index 0000000000..5c5eb28d72
--- /dev/null
+++ b/proto/generated-go/store/approval.pb.go
@@ -0,0 +1,819 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.29.0
+// protoc (unknown)
+// source: store/approval.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type IssuePayloadApproval_Approver_Status int32
+
+const (
+ IssuePayloadApproval_Approver_STATUS_UNSPECIFIED IssuePayloadApproval_Approver_Status = 0
+ IssuePayloadApproval_Approver_PENDING IssuePayloadApproval_Approver_Status = 1
+ IssuePayloadApproval_Approver_APPROVED IssuePayloadApproval_Approver_Status = 2
+)
+
+// Enum value maps for IssuePayloadApproval_Approver_Status.
+var (
+ IssuePayloadApproval_Approver_Status_name = map[int32]string{
+ 0: "STATUS_UNSPECIFIED",
+ 1: "PENDING",
+ 2: "APPROVED",
+ }
+ IssuePayloadApproval_Approver_Status_value = map[string]int32{
+ "STATUS_UNSPECIFIED": 0,
+ "PENDING": 1,
+ "APPROVED": 2,
+ }
+)
+
+func (x IssuePayloadApproval_Approver_Status) Enum() *IssuePayloadApproval_Approver_Status {
+ p := new(IssuePayloadApproval_Approver_Status)
+ *p = x
+ return p
+}
+
+func (x IssuePayloadApproval_Approver_Status) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (IssuePayloadApproval_Approver_Status) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_approval_proto_enumTypes[0].Descriptor()
+}
+
+func (IssuePayloadApproval_Approver_Status) Type() protoreflect.EnumType {
+ return &file_store_approval_proto_enumTypes[0]
+}
+
+func (x IssuePayloadApproval_Approver_Status) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use IssuePayloadApproval_Approver_Status.Descriptor instead.
+func (IssuePayloadApproval_Approver_Status) EnumDescriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{0, 0, 0}
+}
+
+// Type of the ApprovalStep
+// ALL means every node must be approved to proceed.
+// ANY means approving any node will proceed.
+type ApprovalStep_Type int32
+
+const (
+ ApprovalStep_TYPE_UNSPECIFIED ApprovalStep_Type = 0
+ ApprovalStep_ALL ApprovalStep_Type = 1
+ ApprovalStep_ANY ApprovalStep_Type = 2
+)
+
+// Enum value maps for ApprovalStep_Type.
+var (
+ ApprovalStep_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "ALL",
+ 2: "ANY",
+ }
+ ApprovalStep_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "ALL": 1,
+ "ANY": 2,
+ }
+)
+
+func (x ApprovalStep_Type) Enum() *ApprovalStep_Type {
+ p := new(ApprovalStep_Type)
+ *p = x
+ return p
+}
+
+func (x ApprovalStep_Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ApprovalStep_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_approval_proto_enumTypes[1].Descriptor()
+}
+
+func (ApprovalStep_Type) Type() protoreflect.EnumType {
+ return &file_store_approval_proto_enumTypes[1]
+}
+
+func (x ApprovalStep_Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ApprovalStep_Type.Descriptor instead.
+func (ApprovalStep_Type) EnumDescriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{3, 0}
+}
+
+// Type of the ApprovalNode.
+// type determines who should approve this node.
+// ANY_IN_GROUP means the ApprovalNode can be approved by an user from our predefined user group.
+// See GroupValue below for the predefined user groups.
+type ApprovalNode_Type int32
+
+const (
+ ApprovalNode_TYPE_UNSPECIFIED ApprovalNode_Type = 0
+ ApprovalNode_ANY_IN_GROUP ApprovalNode_Type = 1
+)
+
+// Enum value maps for ApprovalNode_Type.
+var (
+ ApprovalNode_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "ANY_IN_GROUP",
+ }
+ ApprovalNode_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "ANY_IN_GROUP": 1,
+ }
+)
+
+func (x ApprovalNode_Type) Enum() *ApprovalNode_Type {
+ p := new(ApprovalNode_Type)
+ *p = x
+ return p
+}
+
+func (x ApprovalNode_Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ApprovalNode_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_approval_proto_enumTypes[2].Descriptor()
+}
+
+func (ApprovalNode_Type) Type() protoreflect.EnumType {
+ return &file_store_approval_proto_enumTypes[2]
+}
+
+func (x ApprovalNode_Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ApprovalNode_Type.Descriptor instead.
+func (ApprovalNode_Type) EnumDescriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{4, 0}
+}
+
+// GroupValue is used if ApprovalNode Type is ANY_IN_GROUP
+// The predefined user groups are:
+// - WORKSPACE_OWNER
+// - WORKSPACE_DBA
+// - PROJECT_OWNER
+// - PROJECT_MEMBER
+type ApprovalNode_GroupValue int32
+
+const (
+ ApprovalNode_GROUP_VALUE_UNSPECIFILED ApprovalNode_GroupValue = 0
+ ApprovalNode_WORKSPACE_OWNER ApprovalNode_GroupValue = 1
+ ApprovalNode_WORKSPACE_DBA ApprovalNode_GroupValue = 2
+ ApprovalNode_PROJECT_OWNER ApprovalNode_GroupValue = 3
+ ApprovalNode_PROJECT_MEMBER ApprovalNode_GroupValue = 4
+)
+
+// Enum value maps for ApprovalNode_GroupValue.
+var (
+ ApprovalNode_GroupValue_name = map[int32]string{
+ 0: "GROUP_VALUE_UNSPECIFILED",
+ 1: "WORKSPACE_OWNER",
+ 2: "WORKSPACE_DBA",
+ 3: "PROJECT_OWNER",
+ 4: "PROJECT_MEMBER",
+ }
+ ApprovalNode_GroupValue_value = map[string]int32{
+ "GROUP_VALUE_UNSPECIFILED": 0,
+ "WORKSPACE_OWNER": 1,
+ "WORKSPACE_DBA": 2,
+ "PROJECT_OWNER": 3,
+ "PROJECT_MEMBER": 4,
+ }
+)
+
+func (x ApprovalNode_GroupValue) Enum() *ApprovalNode_GroupValue {
+ p := new(ApprovalNode_GroupValue)
+ *p = x
+ return p
+}
+
+func (x ApprovalNode_GroupValue) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ApprovalNode_GroupValue) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_approval_proto_enumTypes[3].Descriptor()
+}
+
+func (ApprovalNode_GroupValue) Type() protoreflect.EnumType {
+ return &file_store_approval_proto_enumTypes[3]
+}
+
+func (x ApprovalNode_GroupValue) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ApprovalNode_GroupValue.Descriptor instead.
+func (ApprovalNode_GroupValue) EnumDescriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{4, 1}
+}
+
+// IssuePayloadApproval is a part of the payload of an issue.
+// IssuePayloadApproval records the approval template used and the approval history.
+type IssuePayloadApproval struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ ApprovalTemplates []*ApprovalTemplate `protobuf:"bytes,1,rep,name=approval_templates,json=approvalTemplates,proto3" json:"approval_templates,omitempty"`
+ Approvers []*IssuePayloadApproval_Approver `protobuf:"bytes,2,rep,name=approvers,proto3" json:"approvers,omitempty"`
+}
+
+func (x *IssuePayloadApproval) Reset() {
+ *x = IssuePayloadApproval{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *IssuePayloadApproval) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IssuePayloadApproval) ProtoMessage() {}
+
+func (x *IssuePayloadApproval) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_proto_msgTypes[0]
+ 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 IssuePayloadApproval.ProtoReflect.Descriptor instead.
+func (*IssuePayloadApproval) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *IssuePayloadApproval) GetApprovalTemplates() []*ApprovalTemplate {
+ if x != nil {
+ return x.ApprovalTemplates
+ }
+ return nil
+}
+
+func (x *IssuePayloadApproval) GetApprovers() []*IssuePayloadApproval_Approver {
+ if x != nil {
+ return x.Approvers
+ }
+ return nil
+}
+
+type ApprovalTemplate struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Flow *ApprovalFlow `protobuf:"bytes,1,opt,name=flow,proto3" json:"flow,omitempty"`
+ Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
+ Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
+ CreatorId int32 `protobuf:"varint,4,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"`
+}
+
+func (x *ApprovalTemplate) Reset() {
+ *x = ApprovalTemplate{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalTemplate) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalTemplate) ProtoMessage() {}
+
+func (x *ApprovalTemplate) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_proto_msgTypes[1]
+ 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 ApprovalTemplate.ProtoReflect.Descriptor instead.
+func (*ApprovalTemplate) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ApprovalTemplate) GetFlow() *ApprovalFlow {
+ if x != nil {
+ return x.Flow
+ }
+ return nil
+}
+
+func (x *ApprovalTemplate) GetTitle() string {
+ if x != nil {
+ return x.Title
+ }
+ return ""
+}
+
+func (x *ApprovalTemplate) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *ApprovalTemplate) GetCreatorId() int32 {
+ if x != nil {
+ return x.CreatorId
+ }
+ return 0
+}
+
+type ApprovalFlow struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Steps []*ApprovalStep `protobuf:"bytes,1,rep,name=steps,proto3" json:"steps,omitempty"`
+}
+
+func (x *ApprovalFlow) Reset() {
+ *x = ApprovalFlow{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalFlow) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalFlow) ProtoMessage() {}
+
+func (x *ApprovalFlow) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_proto_msgTypes[2]
+ 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 ApprovalFlow.ProtoReflect.Descriptor instead.
+func (*ApprovalFlow) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ApprovalFlow) GetSteps() []*ApprovalStep {
+ if x != nil {
+ return x.Steps
+ }
+ return nil
+}
+
+type ApprovalStep struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Type ApprovalStep_Type `protobuf:"varint,1,opt,name=type,proto3,enum=bytebase.store.ApprovalStep_Type" json:"type,omitempty"`
+ Nodes []*ApprovalNode `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"`
+}
+
+func (x *ApprovalStep) Reset() {
+ *x = ApprovalStep{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalStep) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalStep) ProtoMessage() {}
+
+func (x *ApprovalStep) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_proto_msgTypes[3]
+ 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 ApprovalStep.ProtoReflect.Descriptor instead.
+func (*ApprovalStep) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *ApprovalStep) GetType() ApprovalStep_Type {
+ if x != nil {
+ return x.Type
+ }
+ return ApprovalStep_TYPE_UNSPECIFIED
+}
+
+func (x *ApprovalStep) GetNodes() []*ApprovalNode {
+ if x != nil {
+ return x.Nodes
+ }
+ return nil
+}
+
+type ApprovalNode struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Type ApprovalNode_Type `protobuf:"varint,1,opt,name=type,proto3,enum=bytebase.store.ApprovalNode_Type" json:"type,omitempty"`
+ // Types that are assignable to Payload:
+ //
+ // *ApprovalNode_GroupValue_
+ Payload isApprovalNode_Payload `protobuf_oneof:"payload"`
+}
+
+func (x *ApprovalNode) Reset() {
+ *x = ApprovalNode{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalNode) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalNode) ProtoMessage() {}
+
+func (x *ApprovalNode) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_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 ApprovalNode.ProtoReflect.Descriptor instead.
+func (*ApprovalNode) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *ApprovalNode) GetType() ApprovalNode_Type {
+ if x != nil {
+ return x.Type
+ }
+ return ApprovalNode_TYPE_UNSPECIFIED
+}
+
+func (m *ApprovalNode) GetPayload() isApprovalNode_Payload {
+ if m != nil {
+ return m.Payload
+ }
+ return nil
+}
+
+func (x *ApprovalNode) GetGroupValue() ApprovalNode_GroupValue {
+ if x, ok := x.GetPayload().(*ApprovalNode_GroupValue_); ok {
+ return x.GroupValue
+ }
+ return ApprovalNode_GROUP_VALUE_UNSPECIFILED
+}
+
+type isApprovalNode_Payload interface {
+ isApprovalNode_Payload()
+}
+
+type ApprovalNode_GroupValue_ struct {
+ GroupValue ApprovalNode_GroupValue `protobuf:"varint,2,opt,name=group_value,json=groupValue,proto3,enum=bytebase.store.ApprovalNode_GroupValue,oneof"`
+}
+
+func (*ApprovalNode_GroupValue_) isApprovalNode_Payload() {}
+
+type IssuePayloadApproval_Approver struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The new status.
+ Status IssuePayloadApproval_Approver_Status `protobuf:"varint,1,opt,name=status,proto3,enum=bytebase.store.IssuePayloadApproval_Approver_Status" json:"status,omitempty"`
+ // The principal id of the approver.
+ PrincipalId int32 `protobuf:"varint,2,opt,name=principal_id,json=principalId,proto3" json:"principal_id,omitempty"`
+}
+
+func (x *IssuePayloadApproval_Approver) Reset() {
+ *x = IssuePayloadApproval_Approver{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_approval_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *IssuePayloadApproval_Approver) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IssuePayloadApproval_Approver) ProtoMessage() {}
+
+func (x *IssuePayloadApproval_Approver) ProtoReflect() protoreflect.Message {
+ mi := &file_store_approval_proto_msgTypes[5]
+ 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 IssuePayloadApproval_Approver.ProtoReflect.Descriptor instead.
+func (*IssuePayloadApproval_Approver) Descriptor() ([]byte, []int) {
+ return file_store_approval_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *IssuePayloadApproval_Approver) GetStatus() IssuePayloadApproval_Approver_Status {
+ if x != nil {
+ return x.Status
+ }
+ return IssuePayloadApproval_Approver_STATUS_UNSPECIFIED
+}
+
+func (x *IssuePayloadApproval_Approver) GetPrincipalId() int32 {
+ if x != nil {
+ return x.PrincipalId
+ }
+ return 0
+}
+
+var File_store_approval_proto protoreflect.FileDescriptor
+
+var file_store_approval_proto_rawDesc = []byte{
+ 0x0a, 0x14, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xef, 0x02, 0x0a, 0x14, 0x49, 0x73, 0x73, 0x75, 0x65,
+ 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x12,
+ 0x4f, 0x0a, 0x12, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x5f, 0x74, 0x65, 0x6d, 0x70,
+ 0x6c, 0x61, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70,
+ 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x11, 0x61,
+ 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x73,
+ 0x12, 0x4b, 0x0a, 0x09, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x73, 0x73, 0x75, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
+ 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76,
+ 0x65, 0x72, 0x52, 0x09, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x73, 0x1a, 0xb8, 0x01,
+ 0x0a, 0x08, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x06, 0x73, 0x74,
+ 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x34, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x73, 0x73, 0x75,
+ 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c,
+ 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
+ 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x69, 0x6e,
+ 0x63, 0x69, 0x70, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b,
+ 0x70, 0x72, 0x69, 0x6e, 0x63, 0x69, 0x70, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x3b, 0x0a, 0x06, 0x53,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a,
+ 0x07, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x50,
+ 0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x02, 0x22, 0x9b, 0x01, 0x0a, 0x10, 0x41, 0x70, 0x70,
+ 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x30, 0x0a,
+ 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70,
+ 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x46, 0x6c, 0x6f, 0x77, 0x52, 0x04, 0x66, 0x6c, 0x6f, 0x77, 0x12,
+ 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
+ 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
+ 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63,
+ 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74,
+ 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65,
+ 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x42, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76,
+ 0x61, 0x6c, 0x46, 0x6c, 0x6f, 0x77, 0x12, 0x32, 0x0a, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x18,
+ 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x53,
+ 0x74, 0x65, 0x70, 0x52, 0x05, 0x73, 0x74, 0x65, 0x70, 0x73, 0x22, 0xa9, 0x01, 0x0a, 0x0c, 0x41,
+ 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x53, 0x74, 0x65, 0x70, 0x12, 0x35, 0x0a, 0x04, 0x74,
+ 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f,
+ 0x76, 0x61, 0x6c, 0x53, 0x74, 0x65, 0x70, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
+ 0x70, 0x65, 0x12, 0x32, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
+ 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
+ 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x52,
+ 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x2e, 0x0a, 0x04, 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, 0x07, 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a,
+ 0x03, 0x41, 0x4e, 0x59, 0x10, 0x02, 0x22, 0xc7, 0x02, 0x0a, 0x0c, 0x41, 0x70, 0x70, 0x72, 0x6f,
+ 0x76, 0x61, 0x6c, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x4e,
+ 0x6f, 0x64, 0x65, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4a,
+ 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0e, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x4e, 0x6f, 0x64,
+ 0x65, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, 0x00, 0x52, 0x0a,
+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2e, 0x0a, 0x04, 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, 0x10, 0x0a, 0x0c, 0x41, 0x4e, 0x59, 0x5f,
+ 0x49, 0x4e, 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x01, 0x22, 0x79, 0x0a, 0x0a, 0x47, 0x72,
+ 0x6f, 0x75, 0x70, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x47, 0x52, 0x4f, 0x55,
+ 0x50, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46,
+ 0x49, 0x4c, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50,
+ 0x41, 0x43, 0x45, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x57,
+ 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12, 0x11,
+ 0x0a, 0x0d, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10,
+ 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d,
+ 0x42, 0x45, 0x52, 0x10, 0x04, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
+ 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f,
+ 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_approval_proto_rawDescOnce sync.Once
+ file_store_approval_proto_rawDescData = file_store_approval_proto_rawDesc
+)
+
+func file_store_approval_proto_rawDescGZIP() []byte {
+ file_store_approval_proto_rawDescOnce.Do(func() {
+ file_store_approval_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_approval_proto_rawDescData)
+ })
+ return file_store_approval_proto_rawDescData
+}
+
+var file_store_approval_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
+var file_store_approval_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_store_approval_proto_goTypes = []interface{}{
+ (IssuePayloadApproval_Approver_Status)(0), // 0: bytebase.store.IssuePayloadApproval.Approver.Status
+ (ApprovalStep_Type)(0), // 1: bytebase.store.ApprovalStep.Type
+ (ApprovalNode_Type)(0), // 2: bytebase.store.ApprovalNode.Type
+ (ApprovalNode_GroupValue)(0), // 3: bytebase.store.ApprovalNode.GroupValue
+ (*IssuePayloadApproval)(nil), // 4: bytebase.store.IssuePayloadApproval
+ (*ApprovalTemplate)(nil), // 5: bytebase.store.ApprovalTemplate
+ (*ApprovalFlow)(nil), // 6: bytebase.store.ApprovalFlow
+ (*ApprovalStep)(nil), // 7: bytebase.store.ApprovalStep
+ (*ApprovalNode)(nil), // 8: bytebase.store.ApprovalNode
+ (*IssuePayloadApproval_Approver)(nil), // 9: bytebase.store.IssuePayloadApproval.Approver
+}
+var file_store_approval_proto_depIdxs = []int32{
+ 5, // 0: bytebase.store.IssuePayloadApproval.approval_templates:type_name -> bytebase.store.ApprovalTemplate
+ 9, // 1: bytebase.store.IssuePayloadApproval.approvers:type_name -> bytebase.store.IssuePayloadApproval.Approver
+ 6, // 2: bytebase.store.ApprovalTemplate.flow:type_name -> bytebase.store.ApprovalFlow
+ 7, // 3: bytebase.store.ApprovalFlow.steps:type_name -> bytebase.store.ApprovalStep
+ 1, // 4: bytebase.store.ApprovalStep.type:type_name -> bytebase.store.ApprovalStep.Type
+ 8, // 5: bytebase.store.ApprovalStep.nodes:type_name -> bytebase.store.ApprovalNode
+ 2, // 6: bytebase.store.ApprovalNode.type:type_name -> bytebase.store.ApprovalNode.Type
+ 3, // 7: bytebase.store.ApprovalNode.group_value:type_name -> bytebase.store.ApprovalNode.GroupValue
+ 0, // 8: bytebase.store.IssuePayloadApproval.Approver.status:type_name -> bytebase.store.IssuePayloadApproval.Approver.Status
+ 9, // [9:9] is the sub-list for method output_type
+ 9, // [9:9] 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_store_approval_proto_init() }
+func file_store_approval_proto_init() {
+ if File_store_approval_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_store_approval_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*IssuePayloadApproval); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_approval_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalTemplate); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_approval_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalFlow); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_approval_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalStep); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_approval_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalNode); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_approval_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*IssuePayloadApproval_Approver); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ file_store_approval_proto_msgTypes[4].OneofWrappers = []interface{}{
+ (*ApprovalNode_GroupValue_)(nil),
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_approval_proto_rawDesc,
+ NumEnums: 4,
+ NumMessages: 6,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_approval_proto_goTypes,
+ DependencyIndexes: file_store_approval_proto_depIdxs,
+ EnumInfos: file_store_approval_proto_enumTypes,
+ MessageInfos: file_store_approval_proto_msgTypes,
+ }.Build()
+ File_store_approval_proto = out.File
+ file_store_approval_proto_rawDesc = nil
+ file_store_approval_proto_goTypes = nil
+ file_store_approval_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/store/issue.pb.go b/proto/generated-go/store/issue.pb.go
new file mode 100644
index 0000000000..3512328048
--- /dev/null
+++ b/proto/generated-go/store/issue.pb.go
@@ -0,0 +1,150 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.29.0
+// protoc (unknown)
+// source: store/issue.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type IssuePayload struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Approval *IssuePayloadApproval `protobuf:"bytes,1,opt,name=approval,proto3" json:"approval,omitempty"`
+}
+
+func (x *IssuePayload) Reset() {
+ *x = IssuePayload{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_issue_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *IssuePayload) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*IssuePayload) ProtoMessage() {}
+
+func (x *IssuePayload) ProtoReflect() protoreflect.Message {
+ mi := &file_store_issue_proto_msgTypes[0]
+ 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 IssuePayload.ProtoReflect.Descriptor instead.
+func (*IssuePayload) Descriptor() ([]byte, []int) {
+ return file_store_issue_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *IssuePayload) GetApproval() *IssuePayloadApproval {
+ if x != nil {
+ return x.Approval
+ }
+ return nil
+}
+
+var File_store_issue_proto protoreflect.FileDescriptor
+
+var file_store_issue_proto_rawDesc = []byte{
+ 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x1a, 0x14, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f,
+ 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x50, 0x0a, 0x0c, 0x49, 0x73, 0x73,
+ 0x75, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x40, 0x0a, 0x08, 0x61, 0x70, 0x70,
+ 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x73, 0x73,
+ 0x75, 0x65, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61,
+ 0x6c, 0x52, 0x08, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x42, 0x14, 0x5a, 0x12, 0x67,
+ 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_issue_proto_rawDescOnce sync.Once
+ file_store_issue_proto_rawDescData = file_store_issue_proto_rawDesc
+)
+
+func file_store_issue_proto_rawDescGZIP() []byte {
+ file_store_issue_proto_rawDescOnce.Do(func() {
+ file_store_issue_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_issue_proto_rawDescData)
+ })
+ return file_store_issue_proto_rawDescData
+}
+
+var file_store_issue_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
+var file_store_issue_proto_goTypes = []interface{}{
+ (*IssuePayload)(nil), // 0: bytebase.store.IssuePayload
+ (*IssuePayloadApproval)(nil), // 1: bytebase.store.IssuePayloadApproval
+}
+var file_store_issue_proto_depIdxs = []int32{
+ 1, // 0: bytebase.store.IssuePayload.approval:type_name -> bytebase.store.IssuePayloadApproval
+ 1, // [1:1] is the sub-list for method output_type
+ 1, // [1:1] is the sub-list for method input_type
+ 1, // [1:1] is the sub-list for extension type_name
+ 1, // [1:1] is the sub-list for extension extendee
+ 0, // [0:1] is the sub-list for field type_name
+}
+
+func init() { file_store_issue_proto_init() }
+func file_store_issue_proto_init() {
+ if File_store_issue_proto != nil {
+ return
+ }
+ file_store_approval_proto_init()
+ if !protoimpl.UnsafeEnabled {
+ file_store_issue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*IssuePayload); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_issue_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 1,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_issue_proto_goTypes,
+ DependencyIndexes: file_store_issue_proto_depIdxs,
+ MessageInfos: file_store_issue_proto_msgTypes,
+ }.Build()
+ File_store_issue_proto = out.File
+ file_store_issue_proto_rawDesc = nil
+ file_store_issue_proto_goTypes = nil
+ file_store_issue_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/store/setting.pb.go b/proto/generated-go/store/setting.pb.go
index 8115bfebcb..650c39e95d 100644
--- a/proto/generated-go/store/setting.pb.go
+++ b/proto/generated-go/store/setting.pb.go
@@ -7,6 +7,7 @@
package store
import (
+ v1alpha1 "google.golang.org/genproto/googleapis/api/expr/v1alpha1"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
@@ -138,24 +139,144 @@ func (x *AgentPluginSetting) GetToken() string {
return ""
}
+type ApprovalConfigSetting struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Rules []*ApprovalConfigSetting_Rule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
+}
+
+func (x *ApprovalConfigSetting) Reset() {
+ *x = ApprovalConfigSetting{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_setting_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalConfigSetting) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalConfigSetting) ProtoMessage() {}
+
+func (x *ApprovalConfigSetting) ProtoReflect() protoreflect.Message {
+ mi := &file_store_setting_proto_msgTypes[2]
+ 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 ApprovalConfigSetting.ProtoReflect.Descriptor instead.
+func (*ApprovalConfigSetting) Descriptor() ([]byte, []int) {
+ return file_store_setting_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *ApprovalConfigSetting) GetRules() []*ApprovalConfigSetting_Rule {
+ if x != nil {
+ return x.Rules
+ }
+ return nil
+}
+
+type ApprovalConfigSetting_Rule struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Expression *v1alpha1.ParsedExpr `protobuf:"bytes,1,opt,name=expression,proto3" json:"expression,omitempty"`
+ Template *ApprovalTemplate `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"`
+}
+
+func (x *ApprovalConfigSetting_Rule) Reset() {
+ *x = ApprovalConfigSetting_Rule{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_setting_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ApprovalConfigSetting_Rule) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ApprovalConfigSetting_Rule) ProtoMessage() {}
+
+func (x *ApprovalConfigSetting_Rule) ProtoReflect() protoreflect.Message {
+ mi := &file_store_setting_proto_msgTypes[3]
+ 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 ApprovalConfigSetting_Rule.ProtoReflect.Descriptor instead.
+func (*ApprovalConfigSetting_Rule) Descriptor() ([]byte, []int) {
+ return file_store_setting_proto_rawDescGZIP(), []int{2, 0}
+}
+
+func (x *ApprovalConfigSetting_Rule) GetExpression() *v1alpha1.ParsedExpr {
+ if x != nil {
+ return x.Expression
+ }
+ return nil
+}
+
+func (x *ApprovalConfigSetting_Rule) GetTemplate() *ApprovalTemplate {
+ if x != nil {
+ return x.Template
+ }
+ return nil
+}
+
var File_store_setting_proto protoreflect.FileDescriptor
var file_store_setting_proto_rawDesc = []byte{
0x0a, 0x13, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x65, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61,
- 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
- 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,
- 0x55, 0x72, 0x6c, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f,
- 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69,
- 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x22, 0x3c, 0x0a, 0x12,
- 0x41, 0x67, 0x65, 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69,
- 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65,
- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x25, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x2f, 0x65, 0x78, 0x70, 0x72, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f,
+ 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x2f, 0x61, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x22, 0x65, 0x0a, 0x17, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50,
+ 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x21, 0x0a,
+ 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x55, 0x72, 0x6c,
+ 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x73, 0x69, 0x67,
+ 0x6e, 0x75, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x64, 0x69, 0x73, 0x61, 0x6c,
+ 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x22, 0x3c, 0x0a, 0x12, 0x41, 0x67, 0x65,
+ 0x6e, 0x74, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12,
+ 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72,
+ 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xe6, 0x01, 0x0a, 0x15, 0x41, 0x70, 0x70, 0x72,
+ 0x6f, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e,
+ 0x67, 0x12, 0x40, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,
+ 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75,
+ 0x6c, 0x65, 0x73, 0x1a, 0x8a, 0x01, 0x0a, 0x04, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x0a,
+ 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x65, 0x78,
+ 0x70, 0x72, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73,
+ 0x65, 0x64, 0x45, 0x78, 0x70, 0x72, 0x52, 0x0a, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69,
+ 0x6f, 0x6e, 0x12, 0x3c, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x70, 0x70, 0x72, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x65,
+ 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65,
+ 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f,
+ 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -170,17 +291,24 @@ func file_store_setting_proto_rawDescGZIP() []byte {
return file_store_setting_proto_rawDescData
}
-var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_store_setting_proto_goTypes = []interface{}{
- (*WorkspaceProfileSetting)(nil), // 0: bytebase.store.WorkspaceProfileSetting
- (*AgentPluginSetting)(nil), // 1: bytebase.store.AgentPluginSetting
+ (*WorkspaceProfileSetting)(nil), // 0: bytebase.store.WorkspaceProfileSetting
+ (*AgentPluginSetting)(nil), // 1: bytebase.store.AgentPluginSetting
+ (*ApprovalConfigSetting)(nil), // 2: bytebase.store.ApprovalConfigSetting
+ (*ApprovalConfigSetting_Rule)(nil), // 3: bytebase.store.ApprovalConfigSetting.Rule
+ (*v1alpha1.ParsedExpr)(nil), // 4: google.api.expr.v1alpha1.ParsedExpr
+ (*ApprovalTemplate)(nil), // 5: bytebase.store.ApprovalTemplate
}
var file_store_setting_proto_depIdxs = []int32{
- 0, // [0:0] is the sub-list for method output_type
- 0, // [0:0] is the sub-list for method input_type
- 0, // [0:0] is the sub-list for extension type_name
- 0, // [0:0] is the sub-list for extension extendee
- 0, // [0:0] is the sub-list for field type_name
+ 3, // 0: bytebase.store.ApprovalConfigSetting.rules:type_name -> bytebase.store.ApprovalConfigSetting.Rule
+ 4, // 1: bytebase.store.ApprovalConfigSetting.Rule.expression:type_name -> google.api.expr.v1alpha1.ParsedExpr
+ 5, // 2: bytebase.store.ApprovalConfigSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate
+ 3, // [3:3] is the sub-list for method output_type
+ 3, // [3:3] is the sub-list for method input_type
+ 3, // [3:3] is the sub-list for extension type_name
+ 3, // [3:3] is the sub-list for extension extendee
+ 0, // [0:3] is the sub-list for field type_name
}
func init() { file_store_setting_proto_init() }
@@ -188,6 +316,7 @@ func file_store_setting_proto_init() {
if File_store_setting_proto != nil {
return
}
+ file_store_approval_proto_init()
if !protoimpl.UnsafeEnabled {
file_store_setting_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*WorkspaceProfileSetting); i {
@@ -213,6 +342,30 @@ func file_store_setting_proto_init() {
return nil
}
}
+ file_store_setting_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalConfigSetting); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_setting_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ApprovalConfigSetting_Rule); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -220,7 +373,7 @@ func file_store_setting_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_setting_proto_rawDesc,
NumEnums: 0,
- NumMessages: 2,
+ NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/store/approval.proto b/proto/store/approval.proto
new file mode 100644
index 0000000000..327d885fd6
--- /dev/null
+++ b/proto/store/approval.proto
@@ -0,0 +1,79 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+option go_package = "generated-go/store";
+
+// IssuePayloadApproval is a part of the payload of an issue.
+// IssuePayloadApproval records the approval template used and the approval history.
+message IssuePayloadApproval {
+ message Approver {
+ enum Status {
+ STATUS_UNSPECIFIED = 0;
+ PENDING = 1;
+ APPROVED = 2;
+ }
+ // The new status.
+ Status status = 1;
+
+ // The principal id of the approver.
+ int32 principal_id = 2;
+ }
+
+ repeated ApprovalTemplate approval_templates = 1;
+ repeated Approver approvers = 2;
+}
+
+message ApprovalTemplate {
+ ApprovalFlow flow = 1;
+ string title = 2;
+ string description = 3;
+ int32 creator_id = 4;
+}
+
+message ApprovalFlow {
+ repeated ApprovalStep steps = 1;
+}
+
+message ApprovalStep {
+ // Type of the ApprovalStep
+ // ALL means every node must be approved to proceed.
+ // ANY means approving any node will proceed.
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ ALL = 1;
+ ANY = 2;
+ }
+ Type type = 1;
+
+ repeated ApprovalNode nodes = 2;
+}
+
+message ApprovalNode {
+ // Type of the ApprovalNode.
+ // type determines who should approve this node.
+ // ANY_IN_GROUP means the ApprovalNode can be approved by an user from our predefined user group.
+ // See GroupValue below for the predefined user groups.
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ ANY_IN_GROUP = 1;
+ }
+ Type type = 1;
+
+ // GroupValue is used if ApprovalNode Type is ANY_IN_GROUP
+ // The predefined user groups are:
+ // - WORKSPACE_OWNER
+ // - WORKSPACE_DBA
+ // - PROJECT_OWNER
+ // - PROJECT_MEMBER
+ enum GroupValue {
+ GROUP_VALUE_UNSPECIFILED = 0;
+ WORKSPACE_OWNER = 1;
+ WORKSPACE_DBA = 2;
+ PROJECT_OWNER = 3;
+ PROJECT_MEMBER = 4;
+ }
+ oneof payload {
+ GroupValue group_value = 2;
+ }
+}
diff --git a/proto/store/issue.proto b/proto/store/issue.proto
new file mode 100644
index 0000000000..7724e064a1
--- /dev/null
+++ b/proto/store/issue.proto
@@ -0,0 +1,11 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+import "store/approval.proto";
+
+option go_package = "generated-go/store";
+
+message IssuePayload {
+ IssuePayloadApproval approval = 1;
+}
diff --git a/proto/store/setting.proto b/proto/store/setting.proto
index bff612f900..6d230ed9f3 100644
--- a/proto/store/setting.proto
+++ b/proto/store/setting.proto
@@ -2,6 +2,9 @@ syntax = "proto3";
package bytebase.store;
+import "google/api/expr/v1alpha1/syntax.proto";
+import "store/approval.proto";
+
option go_package = "generated-go/store";
message WorkspaceProfileSetting {
@@ -23,3 +26,11 @@ message AgentPluginSetting {
// The token for the agent.
string token = 2;
}
+
+message ApprovalConfigSetting {
+ message Rule {
+ google.api.expr.v1alpha1.ParsedExpr expression = 1;
+ ApprovalTemplate template = 2;
+ }
+ repeated Rule rules = 1;
+}