Skip to content

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

feat: update changelog (#14591)

p0ny5e8970a49953
diff --git a/backend/api/v1/database_service_changelog.go b/backend/api/v1/database_service_changelog.go
index 8fe550a0dd..b3529e28ba 100644
--- a/backend/api/v1/database_service_changelog.go
+++ b/backend/api/v1/database_service_changelog.go
@@ -199,7 +199,7 @@ func (s *DatabaseService) convertToChangelog(ctx context.Context, d *store.Datab
Name: common.FormatChangelog(d.InstanceID, d.DatabaseName, c.UID),
Creator: "",
CreateTime: timestamppb.New(c.CreatedTime),
- Status: v1pb.Changelog_Status(c.Payload.GetTask().GetStatus()),
+ Status: convertToChangelogStatus(c.Status),
Statement: "",
StatementSize: 0,
StatementSheet: "",
@@ -207,14 +207,14 @@ func (s *DatabaseService) convertToChangelog(ctx context.Context, d *store.Datab
SchemaSize: 0,
PrevSchema: "",
PrevSchemaSize: 0,
- Issue: c.Payload.GetTask().GetIssue(),
- TaskRun: c.Payload.GetTask().GetTaskRun(),
- Version: c.Payload.GetTask().GetVersion(),
+ Issue: c.Payload.GetIssue(),
+ TaskRun: c.Payload.GetTaskRun(),
+ Version: c.Payload.GetVersion(),
Revision: "",
- ChangedResources: convertToChangedResources(c.Payload.GetTask().GetChangedResources()),
+ ChangedResources: convertToChangedResources(c.Payload.GetChangedResources()),
}
- if sheet := c.Payload.GetTask().GetSheet(); sheet != "" {
+ if sheet := c.Payload.GetSheet(); sheet != "" {
_, sheetUID, err := common.GetProjectResourceIDSheetUID(sheet)
if err != nil {
return nil, errors.Wrapf(err, "failed to get sheetUID from %q", sheet)
@@ -232,7 +232,7 @@ func (s *DatabaseService) convertToChangelog(ctx context.Context, d *store.Datab
cl.StatementSize = sheetM.Size
}
- if id := c.Payload.GetTask().GetRevision(); id != 0 {
+ if id := c.Payload.GetRevision(); id != 0 {
cl.Revision = common.FormatRevision(d.InstanceID, d.DatabaseName, id)
}
@@ -242,7 +242,8 @@ func (s *DatabaseService) convertToChangelog(ctx context.Context, d *store.Datab
}
cl.Creator = common.FormatUserEmail(creator.Email)
- if id := c.Payload.GetTask().GetPrevSyncHistoryId(); id != 0 {
+ if v := c.PrevSyncHistoryUID; v != nil {
+ id := *v
h, err := s.store.GetSyncHistoryByUID(ctx, id)
if err != nil {
return nil, errors.Wrapf(err, "failed to get sync history %d", id)
@@ -251,14 +252,28 @@ func (s *DatabaseService) convertToChangelog(ctx context.Context, d *store.Datab
cl.PrevSchemaSize = int64(len(cl.PrevSchema))
}
- if id := c.Payload.GetTask().GetSyncHistoryId(); id != 0 {
+ if v := c.SyncHistoryUID; v != nil {
+ id := *v
h, err := s.store.GetSyncHistoryByUID(ctx, id)
if err != nil {
return nil, errors.Wrapf(err, "failed to get sync history %d", id)
}
cl.Schema = h.Schema
- cl.SchemaSize = int64(len(cl.PrevSchema))
+ cl.SchemaSize = int64(len(cl.Schema))
}
return cl, nil
}
+
+func convertToChangelogStatus(s store.ChangelogStatus) v1pb.Changelog_Status {
+ switch s {
+ case store.ChangelogStatusDone:
+ return v1pb.Changelog_DONE
+ case store.ChangelogStatusFailed:
+ return v1pb.Changelog_FAILED
+ case store.ChangelogStatusPending:
+ return v1pb.Changelog_PENDING
+ default:
+ return v1pb.Changelog_STATUS_UNSPECIFIED
+ }
+}
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index cfa0e56fcd..f1b72d8c92 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -581,20 +581,20 @@ func beginMigration(ctx context.Context, stores *store.Store, mi *db.MigrationIn
mc.syncHistoryPrev = syncHistoryPrev
// changelog
- changelogUID, err := stores.CreateChangelog(ctx, &store.ChangelogMessage{DatabaseUID: mc.database.UID, Payload: &storepb.ChangelogPayload{
- Task: &storepb.ChangelogTask{
- TaskRun: mc.taskRunName,
- Issue: mc.issueName,
- Revision: 0,
- ChangedResources: mi.Payload.ChangedResources,
- Status: storepb.ChangelogTask_PENDING,
- PrevSyncHistoryId: syncHistoryPrev,
- SyncHistoryId: 0,
- Sheet: mc.sheetName,
- Version: mc.version,
- Type: convertTaskType(mc.task.Type),
- },
- }}, api.SystemBotID)
+ changelogUID, err := stores.CreateChangelog(ctx, &store.ChangelogMessage{
+ DatabaseUID: mc.database.UID,
+ Status: store.ChangelogStatusPending,
+ PrevSyncHistoryUID: &syncHistoryPrev,
+ SyncHistoryUID: nil,
+ Payload: &storepb.ChangelogPayload{
+ TaskRun: mc.taskRunName,
+ Issue: mc.issueName,
+ Revision: 0,
+ ChangedResources: mi.Payload.ChangedResources,
+ Sheet: mc.sheetName,
+ Version: mc.version,
+ Type: convertTaskType(mc.task.Type),
+ }}, api.SystemBotID)
if err != nil {
return "", errors.Wrapf(err, "failed to create changelog")
}
@@ -678,10 +678,10 @@ func endMigration(ctx context.Context, storeInstance *store.Store, startedNs int
}
update.RevisionUID = &revision.UID
}
- status := storepb.ChangelogTask_DONE
+ status := store.ChangelogStatusDone
update.Status = &status
} else {
- status := storepb.ChangelogTask_FAILED
+ status := store.ChangelogStatusFailed
update.Status = &status
}
@@ -714,22 +714,22 @@ func endMigration(ctx context.Context, storeInstance *store.Store, startedNs int
return storeInstance.UpdateInstanceChangeHistory(ctx, update)
}
-func convertTaskType(t api.TaskType) storepb.ChangelogTask_Type {
+func convertTaskType(t api.TaskType) storepb.ChangelogPayload_Type {
switch t {
case api.TaskDatabaseDataUpdate:
- return storepb.ChangelogTask_DATA
+ return storepb.ChangelogPayload_DATA
case api.TaskDatabaseSchemaBaseline:
- return storepb.ChangelogTask_BASELINE
+ return storepb.ChangelogPayload_BASELINE
case api.TaskDatabaseSchemaUpdate:
- return storepb.ChangelogTask_MIGRATE
+ return storepb.ChangelogPayload_MIGRATE
case api.TaskDatabaseSchemaUpdateSDL:
- return storepb.ChangelogTask_MIGRATE_SDL
+ return storepb.ChangelogPayload_MIGRATE_SDL
case api.TaskDatabaseSchemaUpdateGhostCutover, api.TaskDatabaseSchemaUpdateGhostSync:
- return storepb.ChangelogTask_MIGRATE_GHOST
+ return storepb.ChangelogPayload_MIGRATE_GHOST
case api.TaskGeneral:
case api.TaskDatabaseCreate:
case api.TaskDatabaseDataExport:
}
- return storepb.ChangelogTask_TYPE_UNSPECIFIED
+ return storepb.ChangelogPayload_TYPE_UNSPECIFIED
}
diff --git a/backend/store/changelog.go b/backend/store/changelog.go
index 3b8d7d4963..75c8381e32 100644
--- a/backend/store/changelog.go
+++ b/backend/store/changelog.go
@@ -14,10 +14,22 @@ import (
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
+type ChangelogStatus string
+
+const (
+ ChangelogStatusPending ChangelogStatus = "PENDING"
+ ChangelogStatusDone ChangelogStatus = "DONE"
+ ChangelogStatusFailed ChangelogStatus = "FAILED"
+)
+
type ChangelogMessage struct {
DatabaseUID int
Payload *storepb.ChangelogPayload
+ PrevSyncHistoryUID *int64
+ SyncHistoryUID *int64
+ Status ChangelogStatus
+
// output only
UID int64
CreatorUID int
@@ -40,7 +52,7 @@ type UpdateChangelogMessage struct {
SyncHistoryUID *int64
RevisionUID *int64
- Status *storepb.ChangelogTask_Status
+ Status *ChangelogStatus
}
func (s *Store) CreateChangelog(ctx context.Context, create *ChangelogMessage, creatorUID int) (int64, error) {
@@ -48,11 +60,17 @@ func (s *Store) CreateChangelog(ctx context.Context, create *ChangelogMessage, c
INSERT INTO changelog (
creator_id,
database_id,
+ status,
+ prev_sync_history_id,
+ sync_history_id,
payload
) VALUES (
$1,
$2,
- $3
+ $3,
+ $4,
+ $5,
+ $6
)
RETURNING id
`
@@ -69,7 +87,7 @@ func (s *Store) CreateChangelog(ctx context.Context, create *ChangelogMessage, c
}
var id int64
- if err := tx.QueryRowContext(ctx, query, creatorUID, create.DatabaseUID, p).Scan(&id); err != nil {
+ if err := tx.QueryRowContext(ctx, query, creatorUID, create.DatabaseUID, create.Status, create.PrevSyncHistoryUID, create.SyncHistoryUID, p).Scan(&id); err != nil {
return 0, errors.Wrapf(err, "failed to insert")
}
@@ -82,30 +100,29 @@ func (s *Store) CreateChangelog(ctx context.Context, create *ChangelogMessage, c
func (s *Store) UpdateChangelog(ctx context.Context, update *UpdateChangelogMessage) error {
args := []any{update.UID}
- var payloadSet []string
+ var set []string
if v := update.SyncHistoryUID; v != nil {
- payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('syncHistoryId', $%d::TEXT)", len(args)+1))
- args = append(args, fmt.Sprintf("%d", *v))
+ set = append(set, fmt.Sprintf("sync_history_id = $%d", len(args)+1))
+ args = append(args, *v)
}
if v := update.RevisionUID; v != nil {
- payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('revision', $%d::TEXT)", len(args)+1))
- args = append(args, fmt.Sprintf("%d", *v))
+ set = append(set, fmt.Sprintf(`payload = payload || '{"revision": "%d"}'`, *v))
}
if v := update.Status; v != nil {
- payloadSet = append(payloadSet, fmt.Sprintf("jsonb_build_object('status', $%d::TEXT)", len(args)+1))
- args = append(args, v.String())
+ set = append(set, fmt.Sprintf("status = $%d", len(args)+1))
+ args = append(args, *v)
}
- if len(payloadSet) == 0 {
+ if len(set) == 0 {
return errors.Errorf("update nothing")
}
query := fmt.Sprintf(`
UPDATE changelog
- SET payload = jsonb_set(payload, '{task}', payload->'task' || %s)
+ SET %s
WHERE id = $1
- `, strings.Join(payloadSet, " || "))
+ `, strings.Join(set, " , "))
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
@@ -152,6 +169,9 @@ func (s *Store) ListChangelogs(ctx context.Context, find *FindChangelogMessage)
changelog.creator_id,
changelog.created_ts,
changelog.database_id,
+ changelog.status,
+ changelog.prev_sync_history_id,
+ changelog.sync_history_id,
payload
FROM changelog
WHERE %s
@@ -182,6 +202,9 @@ func (s *Store) ListChangelogs(ctx context.Context, find *FindChangelogMessage)
&c.CreatorUID,
&c.CreatedTime,
&c.DatabaseUID,
+ &c.Status,
+ &c.PrevSyncHistoryUID,
+ &c.SyncHistoryUID,
&payload,
); err != nil {
return nil, errors.Wrapf(err, "failed to scan")
diff --git a/frontend/src/types/proto/store/changelog.ts b/frontend/src/types/proto/store/changelog.ts
index 2240da855b..6adebe54dc 100644
--- a/frontend/src/types/proto/store/changelog.ts
+++ b/frontend/src/types/proto/store/changelog.ts
@@ -12,11 +12,6 @@ import { ChangedResources } from "./instance_change_history";
export const protobufPackage = "bytebase.store";
export interface ChangelogPayload {
- task: ChangelogTask | undefined;
- revision: ChangelogRevision | undefined;
-}
-
-export interface ChangelogTask {
/** Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskruns/{taskrun} */
taskRun: string;
/** Format: projects/{project}/issues/{issue} */
@@ -26,81 +21,19 @@ export interface ChangelogTask {
* optional
*/
revision: Long;
- changedResources: ChangedResources | undefined;
- status: ChangelogTask_Status;
- prevSyncHistoryId: Long;
- syncHistoryId: Long;
+ changedResources:
+ | ChangedResources
+ | undefined;
/**
* The sheet that holds the content.
* Format: projects/{project}/sheets/{sheet}
*/
sheet: string;
version: string;
- type: ChangelogTask_Type;
-}
-
-export enum ChangelogTask_Status {
- STATUS_UNSPECIFIED = "STATUS_UNSPECIFIED",
- PENDING = "PENDING",
- DONE = "DONE",
- FAILED = "FAILED",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function changelogTask_StatusFromJSON(object: any): ChangelogTask_Status {
- switch (object) {
- case 0:
- case "STATUS_UNSPECIFIED":
- return ChangelogTask_Status.STATUS_UNSPECIFIED;
- case 1:
- case "PENDING":
- return ChangelogTask_Status.PENDING;
- case 2:
- case "DONE":
- return ChangelogTask_Status.DONE;
- case 3:
- case "FAILED":
- return ChangelogTask_Status.FAILED;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ChangelogTask_Status.UNRECOGNIZED;
- }
+ type: ChangelogPayload_Type;
}
-export function changelogTask_StatusToJSON(object: ChangelogTask_Status): string {
- switch (object) {
- case ChangelogTask_Status.STATUS_UNSPECIFIED:
- return "STATUS_UNSPECIFIED";
- case ChangelogTask_Status.PENDING:
- return "PENDING";
- case ChangelogTask_Status.DONE:
- return "DONE";
- case ChangelogTask_Status.FAILED:
- return "FAILED";
- case ChangelogTask_Status.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function changelogTask_StatusToNumber(object: ChangelogTask_Status): number {
- switch (object) {
- case ChangelogTask_Status.STATUS_UNSPECIFIED:
- return 0;
- case ChangelogTask_Status.PENDING:
- return 1;
- case ChangelogTask_Status.DONE:
- return 2;
- case ChangelogTask_Status.FAILED:
- return 3;
- case ChangelogTask_Status.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export enum ChangelogTask_Type {
+export enum ChangelogPayload_Type {
TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
BASELINE = "BASELINE",
MIGRATE = "MIGRATE",
@@ -110,227 +43,87 @@ export enum ChangelogTask_Type {
UNRECOGNIZED = "UNRECOGNIZED",
}
-export function changelogTask_TypeFromJSON(object: any): ChangelogTask_Type {
+export function changelogPayload_TypeFromJSON(object: any): ChangelogPayload_Type {
switch (object) {
case 0:
case "TYPE_UNSPECIFIED":
- return ChangelogTask_Type.TYPE_UNSPECIFIED;
+ return ChangelogPayload_Type.TYPE_UNSPECIFIED;
case 1:
case "BASELINE":
- return ChangelogTask_Type.BASELINE;
+ return ChangelogPayload_Type.BASELINE;
case 2:
case "MIGRATE":
- return ChangelogTask_Type.MIGRATE;
+ return ChangelogPayload_Type.MIGRATE;
case 3:
case "MIGRATE_SDL":
- return ChangelogTask_Type.MIGRATE_SDL;
+ return ChangelogPayload_Type.MIGRATE_SDL;
case 4:
case "MIGRATE_GHOST":
- return ChangelogTask_Type.MIGRATE_GHOST;
+ return ChangelogPayload_Type.MIGRATE_GHOST;
case 6:
case "DATA":
- return ChangelogTask_Type.DATA;
+ return ChangelogPayload_Type.DATA;
case -1:
case "UNRECOGNIZED":
default:
- return ChangelogTask_Type.UNRECOGNIZED;
+ return ChangelogPayload_Type.UNRECOGNIZED;
}
}
-export function changelogTask_TypeToJSON(object: ChangelogTask_Type): string {
+export function changelogPayload_TypeToJSON(object: ChangelogPayload_Type): string {
switch (object) {
- case ChangelogTask_Type.TYPE_UNSPECIFIED:
+ case ChangelogPayload_Type.TYPE_UNSPECIFIED:
return "TYPE_UNSPECIFIED";
- case ChangelogTask_Type.BASELINE:
+ case ChangelogPayload_Type.BASELINE:
return "BASELINE";
- case ChangelogTask_Type.MIGRATE:
+ case ChangelogPayload_Type.MIGRATE:
return "MIGRATE";
- case ChangelogTask_Type.MIGRATE_SDL:
+ case ChangelogPayload_Type.MIGRATE_SDL:
return "MIGRATE_SDL";
- case ChangelogTask_Type.MIGRATE_GHOST:
+ case ChangelogPayload_Type.MIGRATE_GHOST:
return "MIGRATE_GHOST";
- case ChangelogTask_Type.DATA:
+ case ChangelogPayload_Type.DATA:
return "DATA";
- case ChangelogTask_Type.UNRECOGNIZED:
+ case ChangelogPayload_Type.UNRECOGNIZED:
default:
return "UNRECOGNIZED";
}
}
-export function changelogTask_TypeToNumber(object: ChangelogTask_Type): number {
+export function changelogPayload_TypeToNumber(object: ChangelogPayload_Type): number {
switch (object) {
- case ChangelogTask_Type.TYPE_UNSPECIFIED:
+ case ChangelogPayload_Type.TYPE_UNSPECIFIED:
return 0;
- case ChangelogTask_Type.BASELINE:
+ case ChangelogPayload_Type.BASELINE:
return 1;
- case ChangelogTask_Type.MIGRATE:
+ case ChangelogPayload_Type.MIGRATE:
return 2;
- case ChangelogTask_Type.MIGRATE_SDL:
+ case ChangelogPayload_Type.MIGRATE_SDL:
return 3;
- case ChangelogTask_Type.MIGRATE_GHOST:
+ case ChangelogPayload_Type.MIGRATE_GHOST:
return 4;
- case ChangelogTask_Type.DATA:
+ case ChangelogPayload_Type.DATA:
return 6;
- case ChangelogTask_Type.UNRECOGNIZED:
- default:
- return -1;
- }
-}
-
-export interface ChangelogRevision {
- /** Marshalled revision for display */
- revision: string;
- operation: ChangelogRevision_Op;
-}
-
-export enum ChangelogRevision_Op {
- OP_UNSPECIFIED = "OP_UNSPECIFIED",
- CREATE = "CREATE",
- DELETE = "DELETE",
- UNRECOGNIZED = "UNRECOGNIZED",
-}
-
-export function changelogRevision_OpFromJSON(object: any): ChangelogRevision_Op {
- switch (object) {
- case 0:
- case "OP_UNSPECIFIED":
- return ChangelogRevision_Op.OP_UNSPECIFIED;
- case 1:
- case "CREATE":
- return ChangelogRevision_Op.CREATE;
- case 2:
- case "DELETE":
- return ChangelogRevision_Op.DELETE;
- case -1:
- case "UNRECOGNIZED":
- default:
- return ChangelogRevision_Op.UNRECOGNIZED;
- }
-}
-
-export function changelogRevision_OpToJSON(object: ChangelogRevision_Op): string {
- switch (object) {
- case ChangelogRevision_Op.OP_UNSPECIFIED:
- return "OP_UNSPECIFIED";
- case ChangelogRevision_Op.CREATE:
- return "CREATE";
- case ChangelogRevision_Op.DELETE:
- return "DELETE";
- case ChangelogRevision_Op.UNRECOGNIZED:
- default:
- return "UNRECOGNIZED";
- }
-}
-
-export function changelogRevision_OpToNumber(object: ChangelogRevision_Op): number {
- switch (object) {
- case ChangelogRevision_Op.OP_UNSPECIFIED:
- return 0;
- case ChangelogRevision_Op.CREATE:
- return 1;
- case ChangelogRevision_Op.DELETE:
- return 2;
- case ChangelogRevision_Op.UNRECOGNIZED:
+ case ChangelogPayload_Type.UNRECOGNIZED:
default:
return -1;
}
}
function createBaseChangelogPayload(): ChangelogPayload {
- return { task: undefined, revision: undefined };
-}
-
-export const ChangelogPayload: MessageFns<ChangelogPayload> = {
- encode(message: ChangelogPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.task !== undefined) {
- ChangelogTask.encode(message.task, writer.uint32(10).fork()).join();
- }
- if (message.revision !== undefined) {
- ChangelogRevision.encode(message.revision, writer.uint32(18).fork()).join();
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangelogPayload {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelogPayload();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.task = ChangelogTask.decode(reader, reader.uint32());
- continue;
- case 2:
- if (tag !== 18) {
- break;
- }
-
- message.revision = ChangelogRevision.decode(reader, reader.uint32());
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangelogPayload {
- return {
- task: isSet(object.task) ? ChangelogTask.fromJSON(object.task) : undefined,
- revision: isSet(object.revision) ? ChangelogRevision.fromJSON(object.revision) : undefined,
- };
- },
-
- toJSON(message: ChangelogPayload): unknown {
- const obj: any = {};
- if (message.task !== undefined) {
- obj.task = ChangelogTask.toJSON(message.task);
- }
- if (message.revision !== undefined) {
- obj.revision = ChangelogRevision.toJSON(message.revision);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangelogPayload>): ChangelogPayload {
- return ChangelogPayload.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangelogPayload>): ChangelogPayload {
- const message = createBaseChangelogPayload();
- message.task = (object.task !== undefined && object.task !== null)
- ? ChangelogTask.fromPartial(object.task)
- : undefined;
- message.revision = (object.revision !== undefined && object.revision !== null)
- ? ChangelogRevision.fromPartial(object.revision)
- : undefined;
- return message;
- },
-};
-
-function createBaseChangelogTask(): ChangelogTask {
return {
taskRun: "",
issue: "",
revision: Long.ZERO,
changedResources: undefined,
- status: ChangelogTask_Status.STATUS_UNSPECIFIED,
- prevSyncHistoryId: Long.ZERO,
- syncHistoryId: Long.ZERO,
sheet: "",
version: "",
- type: ChangelogTask_Type.TYPE_UNSPECIFIED,
+ type: ChangelogPayload_Type.TYPE_UNSPECIFIED,
};
}
-export const ChangelogTask: MessageFns<ChangelogTask> = {
- encode(message: ChangelogTask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+export const ChangelogPayload: MessageFns<ChangelogPayload> = {
+ encode(message: ChangelogPayload, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
if (message.taskRun !== "") {
writer.uint32(10).string(message.taskRun);
}
@@ -343,31 +136,22 @@ export const ChangelogTask: MessageFns<ChangelogTask> = {
if (message.changedResources !== undefined) {
ChangedResources.encode(message.changedResources, writer.uint32(34).fork()).join();
}
- if (message.status !== ChangelogTask_Status.STATUS_UNSPECIFIED) {
- writer.uint32(40).int32(changelogTask_StatusToNumber(message.status));
- }
- if (!message.prevSyncHistoryId.equals(Long.ZERO)) {
- writer.uint32(48).int64(message.prevSyncHistoryId.toString());
- }
- if (!message.syncHistoryId.equals(Long.ZERO)) {
- writer.uint32(56).int64(message.syncHistoryId.toString());
- }
if (message.sheet !== "") {
- writer.uint32(66).string(message.sheet);
+ writer.uint32(42).string(message.sheet);
}
if (message.version !== "") {
- writer.uint32(74).string(message.version);
+ writer.uint32(50).string(message.version);
}
- if (message.type !== ChangelogTask_Type.TYPE_UNSPECIFIED) {
- writer.uint32(80).int32(changelogTask_TypeToNumber(message.type));
+ if (message.type !== ChangelogPayload_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(56).int32(changelogPayload_TypeToNumber(message.type));
}
return writer;
},
- decode(input: BinaryReader | Uint8Array, length?: number): ChangelogTask {
+ decode(input: BinaryReader | Uint8Array, length?: number): ChangelogPayload {
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelogTask();
+ const message = createBaseChangelogPayload();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -400,46 +184,25 @@ export const ChangelogTask: MessageFns<ChangelogTask> = {
message.changedResources = ChangedResources.decode(reader, reader.uint32());
continue;
case 5:
- if (tag !== 40) {
+ if (tag !== 42) {
break;
}
- message.status = changelogTask_StatusFromJSON(reader.int32());
+ message.sheet = reader.string();
continue;
case 6:
- if (tag !== 48) {
+ if (tag !== 50) {
break;
}
- message.prevSyncHistoryId = Long.fromString(reader.int64().toString());
+ message.version = reader.string();
continue;
case 7:
if (tag !== 56) {
break;
}
- message.syncHistoryId = Long.fromString(reader.int64().toString());
- continue;
- case 8:
- if (tag !== 66) {
- break;
- }
-
- message.sheet = reader.string();
- continue;
- case 9:
- if (tag !== 74) {
- break;
- }
-
- message.version = reader.string();
- continue;
- case 10:
- if (tag !== 80) {
- break;
- }
-
- message.type = changelogTask_TypeFromJSON(reader.int32());
+ message.type = changelogPayload_TypeFromJSON(reader.int32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
@@ -450,24 +213,19 @@ export const ChangelogTask: MessageFns<ChangelogTask> = {
return message;
},
- fromJSON(object: any): ChangelogTask {
+ fromJSON(object: any): ChangelogPayload {
return {
taskRun: isSet(object.taskRun) ? globalThis.String(object.taskRun) : "",
issue: isSet(object.issue) ? globalThis.String(object.issue) : "",
revision: isSet(object.revision) ? Long.fromValue(object.revision) : Long.ZERO,
changedResources: isSet(object.changedResources) ? ChangedResources.fromJSON(object.changedResources) : undefined,
- status: isSet(object.status)
- ? changelogTask_StatusFromJSON(object.status)
- : ChangelogTask_Status.STATUS_UNSPECIFIED,
- prevSyncHistoryId: isSet(object.prevSyncHistoryId) ? Long.fromValue(object.prevSyncHistoryId) : Long.ZERO,
- syncHistoryId: isSet(object.syncHistoryId) ? Long.fromValue(object.syncHistoryId) : Long.ZERO,
sheet: isSet(object.sheet) ? globalThis.String(object.sheet) : "",
version: isSet(object.version) ? globalThis.String(object.version) : "",
- type: isSet(object.type) ? changelogTask_TypeFromJSON(object.type) : ChangelogTask_Type.TYPE_UNSPECIFIED,
+ type: isSet(object.type) ? changelogPayload_TypeFromJSON(object.type) : ChangelogPayload_Type.TYPE_UNSPECIFIED,
};
},
- toJSON(message: ChangelogTask): unknown {
+ toJSON(message: ChangelogPayload): unknown {
const obj: any = {};
if (message.taskRun !== "") {
obj.taskRun = message.taskRun;
@@ -481,32 +239,23 @@ export const ChangelogTask: MessageFns<ChangelogTask> = {
if (message.changedResources !== undefined) {
obj.changedResources = ChangedResources.toJSON(message.changedResources);
}
- if (message.status !== ChangelogTask_Status.STATUS_UNSPECIFIED) {
- obj.status = changelogTask_StatusToJSON(message.status);
- }
- if (!message.prevSyncHistoryId.equals(Long.ZERO)) {
- obj.prevSyncHistoryId = (message.prevSyncHistoryId || Long.ZERO).toString();
- }
- if (!message.syncHistoryId.equals(Long.ZERO)) {
- obj.syncHistoryId = (message.syncHistoryId || Long.ZERO).toString();
- }
if (message.sheet !== "") {
obj.sheet = message.sheet;
}
if (message.version !== "") {
obj.version = message.version;
}
- if (message.type !== ChangelogTask_Type.TYPE_UNSPECIFIED) {
- obj.type = changelogTask_TypeToJSON(message.type);
+ if (message.type !== ChangelogPayload_Type.TYPE_UNSPECIFIED) {
+ obj.type = changelogPayload_TypeToJSON(message.type);
}
return obj;
},
- create(base?: DeepPartial<ChangelogTask>): ChangelogTask {
- return ChangelogTask.fromPartial(base ?? {});
+ create(base?: DeepPartial<ChangelogPayload>): ChangelogPayload {
+ return ChangelogPayload.fromPartial(base ?? {});
},
- fromPartial(object: DeepPartial<ChangelogTask>): ChangelogTask {
- const message = createBaseChangelogTask();
+ fromPartial(object: DeepPartial<ChangelogPayload>): ChangelogPayload {
+ const message = createBaseChangelogPayload();
message.taskRun = object.taskRun ?? "";
message.issue = object.issue ?? "";
message.revision = (object.revision !== undefined && object.revision !== null)
@@ -515,92 +264,9 @@ export const ChangelogTask: MessageFns<ChangelogTask> = {
message.changedResources = (object.changedResources !== undefined && object.changedResources !== null)
? ChangedResources.fromPartial(object.changedResources)
: undefined;
- message.status = object.status ?? ChangelogTask_Status.STATUS_UNSPECIFIED;
- message.prevSyncHistoryId = (object.prevSyncHistoryId !== undefined && object.prevSyncHistoryId !== null)
- ? Long.fromValue(object.prevSyncHistoryId)
- : Long.ZERO;
- message.syncHistoryId = (object.syncHistoryId !== undefined && object.syncHistoryId !== null)
- ? Long.fromValue(object.syncHistoryId)
- : Long.ZERO;
message.sheet = object.sheet ?? "";
message.version = object.version ?? "";
- message.type = object.type ?? ChangelogTask_Type.TYPE_UNSPECIFIED;
- return message;
- },
-};
-
-function createBaseChangelogRevision(): ChangelogRevision {
- return { revision: "", operation: ChangelogRevision_Op.OP_UNSPECIFIED };
-}
-
-export const ChangelogRevision: MessageFns<ChangelogRevision> = {
- encode(message: ChangelogRevision, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.revision !== "") {
- writer.uint32(10).string(message.revision);
- }
- if (message.operation !== ChangelogRevision_Op.OP_UNSPECIFIED) {
- writer.uint32(16).int32(changelogRevision_OpToNumber(message.operation));
- }
- return writer;
- },
-
- decode(input: BinaryReader | Uint8Array, length?: number): ChangelogRevision {
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
- let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseChangelogRevision();
- while (reader.pos < end) {
- const tag = reader.uint32();
- switch (tag >>> 3) {
- case 1:
- if (tag !== 10) {
- break;
- }
-
- message.revision = reader.string();
- continue;
- case 2:
- if (tag !== 16) {
- break;
- }
-
- message.operation = changelogRevision_OpFromJSON(reader.int32());
- continue;
- }
- if ((tag & 7) === 4 || tag === 0) {
- break;
- }
- reader.skip(tag & 7);
- }
- return message;
- },
-
- fromJSON(object: any): ChangelogRevision {
- return {
- revision: isSet(object.revision) ? globalThis.String(object.revision) : "",
- operation: isSet(object.operation)
- ? changelogRevision_OpFromJSON(object.operation)
- : ChangelogRevision_Op.OP_UNSPECIFIED,
- };
- },
-
- toJSON(message: ChangelogRevision): unknown {
- const obj: any = {};
- if (message.revision !== "") {
- obj.revision = message.revision;
- }
- if (message.operation !== ChangelogRevision_Op.OP_UNSPECIFIED) {
- obj.operation = changelogRevision_OpToJSON(message.operation);
- }
- return obj;
- },
-
- create(base?: DeepPartial<ChangelogRevision>): ChangelogRevision {
- return ChangelogRevision.fromPartial(base ?? {});
- },
- fromPartial(object: DeepPartial<ChangelogRevision>): ChangelogRevision {
- const message = createBaseChangelogRevision();
- message.revision = object.revision ?? "";
- message.operation = object.operation ?? ChangelogRevision_Op.OP_UNSPECIFIED;
+ message.type = object.type ?? ChangelogPayload_Type.TYPE_UNSPECIFIED;
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 794a1844d3..01f20ca3f6 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -107,12 +107,8 @@
- [store/changelog.proto](#store_changelog-proto)
- [ChangelogPayload](#bytebase-store-ChangelogPayload)
- - [ChangelogRevision](#bytebase-store-ChangelogRevision)
- - [ChangelogTask](#bytebase-store-ChangelogTask)
- - [ChangelogRevision.Op](#bytebase-store-ChangelogRevision-Op)
- - [ChangelogTask.Status](#bytebase-store-ChangelogTask-Status)
- - [ChangelogTask.Type](#bytebase-store-ChangelogTask-Type)
+ - [ChangelogPayload.Type](#bytebase-store-ChangelogPayload-Type)
- [store/data_source.proto](#store_data_source-proto)
- [DataSourceExternalSecret](#bytebase-store-DataSourceExternalSecret)
@@ -1933,50 +1929,15 @@ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| task | [ChangelogTask](#bytebase-store-ChangelogTask) | | |
-| revision | [ChangelogRevision](#bytebase-store-ChangelogRevision) | | |
-
-
-
-
-
-
-<a name="bytebase-store-ChangelogRevision"></a>
-
-### ChangelogRevision
-
-
-
-| Field | Type | Label | Description |
-| ----- | ---- | ----- | ----------- |
-| revision | [string](#string) | | Marshalled revision for display |
-| operation | [ChangelogRevision.Op](#bytebase-store-ChangelogRevision-Op) | | |
-
-
-
-
-
-
-<a name="bytebase-store-ChangelogTask"></a>
-
-### ChangelogTask
-
-
-
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| task_run | [string](#string) | | Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskruns/{taskrun} |
| issue | [string](#string) | | Format: projects/{project}/issues/{issue} |
| revision | [int64](#int64) | | The revision uid. optional |
| changed_resources | [ChangedResources](#bytebase-store-ChangedResources) | | |
-| status | [ChangelogTask.Status](#bytebase-store-ChangelogTask-Status) | | |
-| prev_sync_history_id | [int64](#int64) | | |
-| sync_history_id | [int64](#int64) | | |
| sheet | [string](#string) | | The sheet that holds the content. Format: projects/{project}/sheets/{sheet} |
| version | [string](#string) | | |
-| type | [ChangelogTask.Type](#bytebase-store-ChangelogTask-Type) | | |
+| type | [ChangelogPayload.Type](#bytebase-store-ChangelogPayload-Type) | | |
@@ -1985,36 +1946,9 @@ LIST, HASH (https://www.postgresql.org/docs/current/ddl-partitioning.html)
-<a name="bytebase-store-ChangelogRevision-Op"></a>
-
-### ChangelogRevision.Op
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| OP_UNSPECIFIED | 0 | |
-| CREATE | 1 | |
-| DELETE | 2 | |
-
-
-
-<a name="bytebase-store-ChangelogTask-Status"></a>
-
-### ChangelogTask.Status
-
-
-| Name | Number | Description |
-| ---- | ------ | ----------- |
-| STATUS_UNSPECIFIED | 0 | |
-| PENDING | 1 | |
-| DONE | 2 | |
-| FAILED | 3 | |
-
-
-
-<a name="bytebase-store-ChangelogTask-Type"></a>
+<a name="bytebase-store-ChangelogPayload-Type"></a>
-### ChangelogTask.Type
+### ChangelogPayload.Type
| Name | Number | Description |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index bc037fe2c7..e760f3942e 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -597,25 +597,9 @@
<a href="#bytebase.store.ChangelogPayload"><span class="badge">M</span>ChangelogPayload</a>
</li>
- <li>
- <a href="#bytebase.store.ChangelogRevision"><span class="badge">M</span>ChangelogRevision</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangelogTask"><span class="badge">M</span>ChangelogTask</a>
- </li>
-
-
- <li>
- <a href="#bytebase.store.ChangelogRevision.Op"><span class="badge">E</span>ChangelogRevision.Op</a>
- </li>
<li>
- <a href="#bytebase.store.ChangelogTask.Status"><span class="badge">E</span>ChangelogTask.Status</a>
- </li>
-
- <li>
- <a href="#bytebase.store.ChangelogTask.Type"><span class="badge">E</span>ChangelogTask.Type</a>
+ <a href="#bytebase.store.ChangelogPayload.Type"><span class="badge">E</span>ChangelogPayload.Type</a>
</li>
@@ -5531,68 +5515,6 @@ Example: projects/project-id/branches/branch-id. </p></td>
<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>task</td>
- <td><a href="#bytebase.store.ChangelogTask">ChangelogTask</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>revision</td>
- <td><a href="#bytebase.store.ChangelogRevision">ChangelogRevision</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.ChangelogRevision">ChangelogRevision</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>revision</td>
- <td><a href="#string">string</a></td>
- <td></td>
- <td><p>Marshalled revision for display </p></td>
- </tr>
-
- <tr>
- <td>operation</td>
- <td><a href="#bytebase.store.ChangelogRevision.Op">ChangelogRevision.Op</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- </tbody>
- </table>
-
-
-
-
-
- <h3 id="bytebase.store.ChangelogTask">ChangelogTask</h3>
- <p></p>
-
-
<table class="field-table">
<thead>
<tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
@@ -5628,27 +5550,6 @@ optional </p></td>
<td><p> </p></td>
</tr>
- <tr>
- <td>status</td>
- <td><a href="#bytebase.store.ChangelogTask.Status">ChangelogTask.Status</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>prev_sync_history_id</td>
- <td><a href="#int64">int64</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
- <tr>
- <td>sync_history_id</td>
- <td><a href="#int64">int64</a></td>
- <td></td>
- <td><p> </p></td>
- </tr>
-
<tr>
<td>sheet</td>
<td><a href="#string">string</a></td>
@@ -5666,7 +5567,7 @@ Format: projects/{project}/sheets/{sheet} </p></td>
<tr>
<td>type</td>
- <td><a href="#bytebase.store.ChangelogTask.Type">ChangelogTask.Type</a></td>
+ <td><a href="#bytebase.store.ChangelogPayload.Type">ChangelogPayload.Type</a></td>
<td></td>
<td><p> </p></td>
</tr>
@@ -5680,71 +5581,7 @@ Format: projects/{project}/sheets/{sheet} </p></td>
- <h3 id="bytebase.store.ChangelogRevision.Op">ChangelogRevision.Op</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>OP_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>CREATE</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DELETE</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.ChangelogTask.Status">ChangelogTask.Status</h3>
- <p></p>
- <table class="enum-table">
- <thead>
- <tr><td>Name</td><td>Number</td><td>Description</td></tr>
- </thead>
- <tbody>
-
- <tr>
- <td>STATUS_UNSPECIFIED</td>
- <td>0</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>PENDING</td>
- <td>1</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>DONE</td>
- <td>2</td>
- <td><p></p></td>
- </tr>
-
- <tr>
- <td>FAILED</td>
- <td>3</td>
- <td><p></p></td>
- </tr>
-
- </tbody>
- </table>
-
- <h3 id="bytebase.store.ChangelogTask.Type">ChangelogTask.Type</h3>
+ <h3 id="bytebase.store.ChangelogPayload.Type">ChangelogPayload.Type</h3>
<p></p>
<table class="enum-table">
<thead>
diff --git a/proto/generated-go/store/changelog.pb.go b/proto/generated-go/store/changelog.pb.go
index ec4478bed7..e043d99156 100644
--- a/proto/generated-go/store/changelog.pb.go
+++ b/proto/generated-go/store/changelog.pb.go
@@ -20,72 +20,20 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
-type ChangelogTask_Status int32
+type ChangelogPayload_Type int32
const (
- ChangelogTask_STATUS_UNSPECIFIED ChangelogTask_Status = 0
- ChangelogTask_PENDING ChangelogTask_Status = 1
- ChangelogTask_DONE ChangelogTask_Status = 2
- ChangelogTask_FAILED ChangelogTask_Status = 3
+ ChangelogPayload_TYPE_UNSPECIFIED ChangelogPayload_Type = 0
+ ChangelogPayload_BASELINE ChangelogPayload_Type = 1
+ ChangelogPayload_MIGRATE ChangelogPayload_Type = 2
+ ChangelogPayload_MIGRATE_SDL ChangelogPayload_Type = 3
+ ChangelogPayload_MIGRATE_GHOST ChangelogPayload_Type = 4
+ ChangelogPayload_DATA ChangelogPayload_Type = 6
)
-// Enum value maps for ChangelogTask_Status.
+// Enum value maps for ChangelogPayload_Type.
var (
- ChangelogTask_Status_name = map[int32]string{
- 0: "STATUS_UNSPECIFIED",
- 1: "PENDING",
- 2: "DONE",
- 3: "FAILED",
- }
- ChangelogTask_Status_value = map[string]int32{
- "STATUS_UNSPECIFIED": 0,
- "PENDING": 1,
- "DONE": 2,
- "FAILED": 3,
- }
-)
-
-func (x ChangelogTask_Status) Enum() *ChangelogTask_Status {
- p := new(ChangelogTask_Status)
- *p = x
- return p
-}
-
-func (x ChangelogTask_Status) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (ChangelogTask_Status) Descriptor() protoreflect.EnumDescriptor {
- return file_store_changelog_proto_enumTypes[0].Descriptor()
-}
-
-func (ChangelogTask_Status) Type() protoreflect.EnumType {
- return &file_store_changelog_proto_enumTypes[0]
-}
-
-func (x ChangelogTask_Status) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use ChangelogTask_Status.Descriptor instead.
-func (ChangelogTask_Status) EnumDescriptor() ([]byte, []int) {
- return file_store_changelog_proto_rawDescGZIP(), []int{1, 0}
-}
-
-type ChangelogTask_Type int32
-
-const (
- ChangelogTask_TYPE_UNSPECIFIED ChangelogTask_Type = 0
- ChangelogTask_BASELINE ChangelogTask_Type = 1
- ChangelogTask_MIGRATE ChangelogTask_Type = 2
- ChangelogTask_MIGRATE_SDL ChangelogTask_Type = 3
- ChangelogTask_MIGRATE_GHOST ChangelogTask_Type = 4
- ChangelogTask_DATA ChangelogTask_Type = 6
-)
-
-// Enum value maps for ChangelogTask_Type.
-var (
- ChangelogTask_Type_name = map[int32]string{
+ ChangelogPayload_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "BASELINE",
2: "MIGRATE",
@@ -93,7 +41,7 @@ var (
4: "MIGRATE_GHOST",
6: "DATA",
}
- ChangelogTask_Type_value = map[string]int32{
+ ChangelogPayload_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"BASELINE": 1,
"MIGRATE": 2,
@@ -103,80 +51,31 @@ var (
}
)
-func (x ChangelogTask_Type) Enum() *ChangelogTask_Type {
- p := new(ChangelogTask_Type)
+func (x ChangelogPayload_Type) Enum() *ChangelogPayload_Type {
+ p := new(ChangelogPayload_Type)
*p = x
return p
}
-func (x ChangelogTask_Type) String() string {
+func (x ChangelogPayload_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
-func (ChangelogTask_Type) Descriptor() protoreflect.EnumDescriptor {
- return file_store_changelog_proto_enumTypes[1].Descriptor()
-}
-
-func (ChangelogTask_Type) Type() protoreflect.EnumType {
- return &file_store_changelog_proto_enumTypes[1]
-}
-
-func (x ChangelogTask_Type) Number() protoreflect.EnumNumber {
- return protoreflect.EnumNumber(x)
-}
-
-// Deprecated: Use ChangelogTask_Type.Descriptor instead.
-func (ChangelogTask_Type) EnumDescriptor() ([]byte, []int) {
- return file_store_changelog_proto_rawDescGZIP(), []int{1, 1}
-}
-
-type ChangelogRevision_Op int32
-
-const (
- ChangelogRevision_OP_UNSPECIFIED ChangelogRevision_Op = 0
- ChangelogRevision_CREATE ChangelogRevision_Op = 1
- ChangelogRevision_DELETE ChangelogRevision_Op = 2
-)
-
-// Enum value maps for ChangelogRevision_Op.
-var (
- ChangelogRevision_Op_name = map[int32]string{
- 0: "OP_UNSPECIFIED",
- 1: "CREATE",
- 2: "DELETE",
- }
- ChangelogRevision_Op_value = map[string]int32{
- "OP_UNSPECIFIED": 0,
- "CREATE": 1,
- "DELETE": 2,
- }
-)
-
-func (x ChangelogRevision_Op) Enum() *ChangelogRevision_Op {
- p := new(ChangelogRevision_Op)
- *p = x
- return p
-}
-
-func (x ChangelogRevision_Op) String() string {
- return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
-}
-
-func (ChangelogRevision_Op) Descriptor() protoreflect.EnumDescriptor {
- return file_store_changelog_proto_enumTypes[2].Descriptor()
+func (ChangelogPayload_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_changelog_proto_enumTypes[0].Descriptor()
}
-func (ChangelogRevision_Op) Type() protoreflect.EnumType {
- return &file_store_changelog_proto_enumTypes[2]
+func (ChangelogPayload_Type) Type() protoreflect.EnumType {
+ return &file_store_changelog_proto_enumTypes[0]
}
-func (x ChangelogRevision_Op) Number() protoreflect.EnumNumber {
+func (x ChangelogPayload_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
-// Deprecated: Use ChangelogRevision_Op.Descriptor instead.
-func (ChangelogRevision_Op) EnumDescriptor() ([]byte, []int) {
- return file_store_changelog_proto_rawDescGZIP(), []int{2, 0}
+// Deprecated: Use ChangelogPayload_Type.Descriptor instead.
+func (ChangelogPayload_Type) EnumDescriptor() ([]byte, []int) {
+ return file_store_changelog_proto_rawDescGZIP(), []int{0, 0}
}
type ChangelogPayload struct {
@@ -184,8 +83,19 @@ type ChangelogPayload struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Task *ChangelogTask `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"`
- Revision *ChangelogRevision `protobuf:"bytes,2,opt,name=revision,proto3" json:"revision,omitempty"`
+ // Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskruns/{taskrun}
+ TaskRun string `protobuf:"bytes,1,opt,name=task_run,json=taskRun,proto3" json:"task_run,omitempty"`
+ // Format: projects/{project}/issues/{issue}
+ Issue string `protobuf:"bytes,2,opt,name=issue,proto3" json:"issue,omitempty"`
+ // The revision uid.
+ // optional
+ Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
+ ChangedResources *ChangedResources `protobuf:"bytes,4,opt,name=changed_resources,json=changedResources,proto3" json:"changed_resources,omitempty"`
+ // The sheet that holds the content.
+ // Format: projects/{project}/sheets/{sheet}
+ Sheet string `protobuf:"bytes,5,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ Version string `protobuf:"bytes,6,opt,name=version,proto3" json:"version,omitempty"`
+ Type ChangelogPayload_Type `protobuf:"varint,7,opt,name=type,proto3,enum=bytebase.store.ChangelogPayload_Type" json:"type,omitempty"`
}
func (x *ChangelogPayload) Reset() {
@@ -218,195 +128,53 @@ func (*ChangelogPayload) Descriptor() ([]byte, []int) {
return file_store_changelog_proto_rawDescGZIP(), []int{0}
}
-func (x *ChangelogPayload) GetTask() *ChangelogTask {
- if x != nil {
- return x.Task
- }
- return nil
-}
-
-func (x *ChangelogPayload) GetRevision() *ChangelogRevision {
- if x != nil {
- return x.Revision
- }
- return nil
-}
-
-type ChangelogTask struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskruns/{taskrun}
- TaskRun string `protobuf:"bytes,1,opt,name=task_run,json=taskRun,proto3" json:"task_run,omitempty"`
- // Format: projects/{project}/issues/{issue}
- Issue string `protobuf:"bytes,2,opt,name=issue,proto3" json:"issue,omitempty"`
- // The revision uid.
- // optional
- Revision int64 `protobuf:"varint,3,opt,name=revision,proto3" json:"revision,omitempty"`
- ChangedResources *ChangedResources `protobuf:"bytes,4,opt,name=changed_resources,json=changedResources,proto3" json:"changed_resources,omitempty"`
- Status ChangelogTask_Status `protobuf:"varint,5,opt,name=status,proto3,enum=bytebase.store.ChangelogTask_Status" json:"status,omitempty"`
- PrevSyncHistoryId int64 `protobuf:"varint,6,opt,name=prev_sync_history_id,json=prevSyncHistoryId,proto3" json:"prev_sync_history_id,omitempty"`
- SyncHistoryId int64 `protobuf:"varint,7,opt,name=sync_history_id,json=syncHistoryId,proto3" json:"sync_history_id,omitempty"`
- // The sheet that holds the content.
- // Format: projects/{project}/sheets/{sheet}
- Sheet string `protobuf:"bytes,8,opt,name=sheet,proto3" json:"sheet,omitempty"`
- Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"`
- Type ChangelogTask_Type `protobuf:"varint,10,opt,name=type,proto3,enum=bytebase.store.ChangelogTask_Type" json:"type,omitempty"`
-}
-
-func (x *ChangelogTask) Reset() {
- *x = ChangelogTask{}
- mi := &file_store_changelog_proto_msgTypes[1]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ChangelogTask) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ChangelogTask) ProtoMessage() {}
-
-func (x *ChangelogTask) ProtoReflect() protoreflect.Message {
- mi := &file_store_changelog_proto_msgTypes[1]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ChangelogTask.ProtoReflect.Descriptor instead.
-func (*ChangelogTask) Descriptor() ([]byte, []int) {
- return file_store_changelog_proto_rawDescGZIP(), []int{1}
-}
-
-func (x *ChangelogTask) GetTaskRun() string {
+func (x *ChangelogPayload) GetTaskRun() string {
if x != nil {
return x.TaskRun
}
return ""
}
-func (x *ChangelogTask) GetIssue() string {
+func (x *ChangelogPayload) GetIssue() string {
if x != nil {
return x.Issue
}
return ""
}
-func (x *ChangelogTask) GetRevision() int64 {
+func (x *ChangelogPayload) GetRevision() int64 {
if x != nil {
return x.Revision
}
return 0
}
-func (x *ChangelogTask) GetChangedResources() *ChangedResources {
+func (x *ChangelogPayload) GetChangedResources() *ChangedResources {
if x != nil {
return x.ChangedResources
}
return nil
}
-func (x *ChangelogTask) GetStatus() ChangelogTask_Status {
- if x != nil {
- return x.Status
- }
- return ChangelogTask_STATUS_UNSPECIFIED
-}
-
-func (x *ChangelogTask) GetPrevSyncHistoryId() int64 {
- if x != nil {
- return x.PrevSyncHistoryId
- }
- return 0
-}
-
-func (x *ChangelogTask) GetSyncHistoryId() int64 {
- if x != nil {
- return x.SyncHistoryId
- }
- return 0
-}
-
-func (x *ChangelogTask) GetSheet() string {
+func (x *ChangelogPayload) GetSheet() string {
if x != nil {
return x.Sheet
}
return ""
}
-func (x *ChangelogTask) GetVersion() string {
+func (x *ChangelogPayload) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
-func (x *ChangelogTask) GetType() ChangelogTask_Type {
+func (x *ChangelogPayload) GetType() ChangelogPayload_Type {
if x != nil {
return x.Type
}
- return ChangelogTask_TYPE_UNSPECIFIED
-}
-
-type ChangelogRevision struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- // Marshalled revision for display
- Revision string `protobuf:"bytes,1,opt,name=revision,proto3" json:"revision,omitempty"`
- Operation ChangelogRevision_Op `protobuf:"varint,2,opt,name=operation,proto3,enum=bytebase.store.ChangelogRevision_Op" json:"operation,omitempty"`
-}
-
-func (x *ChangelogRevision) Reset() {
- *x = ChangelogRevision{}
- mi := &file_store_changelog_proto_msgTypes[2]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
-}
-
-func (x *ChangelogRevision) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*ChangelogRevision) ProtoMessage() {}
-
-func (x *ChangelogRevision) ProtoReflect() protoreflect.Message {
- mi := &file_store_changelog_proto_msgTypes[2]
- if x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use ChangelogRevision.ProtoReflect.Descriptor instead.
-func (*ChangelogRevision) Descriptor() ([]byte, []int) {
- return file_store_changelog_proto_rawDescGZIP(), []int{2}
-}
-
-func (x *ChangelogRevision) GetRevision() string {
- if x != nil {
- return x.Revision
- }
- return ""
-}
-
-func (x *ChangelogRevision) GetOperation() ChangelogRevision_Op {
- if x != nil {
- return x.Operation
- }
- return ChangelogRevision_OP_UNSPECIFIED
+ return ChangelogPayload_TYPE_UNSPECIFIED
}
var File_store_changelog_proto protoreflect.FileDescriptor
@@ -416,66 +184,33 @@ var file_store_changelog_proto_rawDesc = []byte{
0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x23, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69,
0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x68,
- 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a,
+ 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x80, 0x03, 0x0a,
0x10, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
- 0x64, 0x12, 0x31, 0x0a, 0x04, 0x74, 0x61, 0x73, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,
- 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x04,
- 0x74, 0x61, 0x73, 0x6b, 0x12, 0x3d, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
- 0x67, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
- 0x69, 0x6f, 0x6e, 0x22, 0xd6, 0x04, 0x0a, 0x0d, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
- 0x67, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75,
- 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x75, 0x6e,
- 0x12, 0x14, 0x0a, 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x05, 0x69, 0x73, 0x73, 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69,
- 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x4d, 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65,
- 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e,
- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43,
- 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52,
- 0x10, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
- 0x73, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x54, 0x61, 0x73, 0x6b,
- 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12,
- 0x2f, 0x0a, 0x14, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x68, 0x69, 0x73,
- 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x11, 0x70,
- 0x72, 0x65, 0x76, 0x53, 0x79, 0x6e, 0x63, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64,
- 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79,
- 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x79, 0x6e, 0x63, 0x48,
- 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65,
- 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x18,
- 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x36, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
- 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f,
- 0x67, 0x54, 0x61, 0x73, 0x6b, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
- 0x22, 0x43, 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,
- 0x08, 0x0a, 0x04, 0x44, 0x4f, 0x4e, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x46, 0x41, 0x49,
- 0x4c, 0x45, 0x44, 0x10, 0x03, 0x22, 0x65, 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, 0x0c, 0x0a, 0x08, 0x42, 0x41, 0x53, 0x45, 0x4c, 0x49, 0x4e, 0x45, 0x10,
- 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0f,
- 0x0a, 0x0b, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x44, 0x4c, 0x10, 0x03, 0x12,
- 0x11, 0x0a, 0x0d, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x48, 0x4f, 0x53, 0x54,
- 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x41, 0x10, 0x06, 0x22, 0xa5, 0x01, 0x0a,
- 0x11, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x76, 0x69, 0x73, 0x69,
- 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42,
- 0x0a, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x52, 0x65, 0x76, 0x69,
- 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x4f, 0x70, 0x52, 0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
- 0x6f, 0x6e, 0x22, 0x30, 0x0a, 0x02, 0x4f, 0x70, 0x12, 0x12, 0x0a, 0x0e, 0x4f, 0x50, 0x5f, 0x55,
- 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06,
- 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x45, 0x4c, 0x45,
- 0x54, 0x45, 0x10, 0x02, 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,
+ 0x64, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x61, 0x73, 0x6b, 0x5f, 0x72, 0x75, 0x6e, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x75, 0x6e, 0x12, 0x14, 0x0a, 0x05,
+ 0x69, 0x73, 0x73, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x73, 0x73,
+ 0x75, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x4d,
+ 0x0a, 0x11, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
+ 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67,
+ 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x10, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x14, 0x0a,
+ 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x39, 0x0a,
+ 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x6c, 0x6f, 0x67, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x54, 0x79,
+ 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x65, 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, 0x0c, 0x0a, 0x08, 0x42, 0x41, 0x53, 0x45, 0x4c, 0x49,
+ 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x10,
+ 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x53, 0x44, 0x4c,
+ 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x4d, 0x49, 0x47, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x47, 0x48,
+ 0x4f, 0x53, 0x54, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x41, 0x10, 0x06, 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 (
@@ -490,29 +225,21 @@ func file_store_changelog_proto_rawDescGZIP() []byte {
return file_store_changelog_proto_rawDescData
}
-var file_store_changelog_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
-var file_store_changelog_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_store_changelog_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_store_changelog_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_store_changelog_proto_goTypes = []any{
- (ChangelogTask_Status)(0), // 0: bytebase.store.ChangelogTask.Status
- (ChangelogTask_Type)(0), // 1: bytebase.store.ChangelogTask.Type
- (ChangelogRevision_Op)(0), // 2: bytebase.store.ChangelogRevision.Op
- (*ChangelogPayload)(nil), // 3: bytebase.store.ChangelogPayload
- (*ChangelogTask)(nil), // 4: bytebase.store.ChangelogTask
- (*ChangelogRevision)(nil), // 5: bytebase.store.ChangelogRevision
- (*ChangedResources)(nil), // 6: bytebase.store.ChangedResources
+ (ChangelogPayload_Type)(0), // 0: bytebase.store.ChangelogPayload.Type
+ (*ChangelogPayload)(nil), // 1: bytebase.store.ChangelogPayload
+ (*ChangedResources)(nil), // 2: bytebase.store.ChangedResources
}
var file_store_changelog_proto_depIdxs = []int32{
- 4, // 0: bytebase.store.ChangelogPayload.task:type_name -> bytebase.store.ChangelogTask
- 5, // 1: bytebase.store.ChangelogPayload.revision:type_name -> bytebase.store.ChangelogRevision
- 6, // 2: bytebase.store.ChangelogTask.changed_resources:type_name -> bytebase.store.ChangedResources
- 0, // 3: bytebase.store.ChangelogTask.status:type_name -> bytebase.store.ChangelogTask.Status
- 1, // 4: bytebase.store.ChangelogTask.type:type_name -> bytebase.store.ChangelogTask.Type
- 2, // 5: bytebase.store.ChangelogRevision.operation:type_name -> bytebase.store.ChangelogRevision.Op
- 6, // [6:6] is the sub-list for method output_type
- 6, // [6:6] is the sub-list for method input_type
- 6, // [6:6] is the sub-list for extension type_name
- 6, // [6:6] is the sub-list for extension extendee
- 0, // [0:6] is the sub-list for field type_name
+ 2, // 0: bytebase.store.ChangelogPayload.changed_resources:type_name -> bytebase.store.ChangedResources
+ 0, // 1: bytebase.store.ChangelogPayload.type:type_name -> bytebase.store.ChangelogPayload.Type
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
}
func init() { file_store_changelog_proto_init() }
@@ -526,8 +253,8 @@ func file_store_changelog_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_changelog_proto_rawDesc,
- NumEnums: 3,
- NumMessages: 3,
+ NumEnums: 1,
+ NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
diff --git a/proto/store/changelog.proto b/proto/store/changelog.proto
index ce5574456d..34e0f4acca 100644
--- a/proto/store/changelog.proto
+++ b/proto/store/changelog.proto
@@ -7,11 +7,6 @@ import "store/instance_change_history.proto";
option go_package = "generated-go/store";
message ChangelogPayload {
- ChangelogTask task = 1;
- ChangelogRevision revision = 2;
-}
-
-message ChangelogTask {
// Format: projects/{project}/rollouts/{rollout}/stages/{stage}/tasks/{task}/taskruns/{taskrun}
string task_run = 1;
// Format: projects/{project}/issues/{issue}
@@ -23,23 +18,11 @@ message ChangelogTask {
ChangedResources changed_resources = 4;
- enum Status {
- STATUS_UNSPECIFIED = 0;
- PENDING = 1;
- DONE = 2;
- FAILED = 3;
- }
-
- Status status = 5;
-
- int64 prev_sync_history_id = 6;
- int64 sync_history_id = 7;
-
// The sheet that holds the content.
// Format: projects/{project}/sheets/{sheet}
- string sheet = 8;
+ string sheet = 5;
- string version = 9;
+ string version = 6;
enum Type {
TYPE_UNSPECIFIED = 0;
@@ -49,16 +32,5 @@ message ChangelogTask {
MIGRATE_GHOST = 4;
DATA = 6;
}
- Type type = 10;
-}
-
-message ChangelogRevision {
- enum Op {
- OP_UNSPECIFIED = 0;
- CREATE = 1;
- DELETE = 2;
- }
- // Marshalled revision for display
- string revision = 1;
- Op operation = 2;
+ Type type = 7;
}