Skip to content

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

chore: deprecate earliest_allowed_time (#16191)

p0ny9ba01979ca40
diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.go
index afb039f6c6..d5c4d207de 100644
--- a/backend/api/v1/plan_service.go
+++ b/backend/api/v1/plan_service.go
@@ -17,7 +17,6 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/testing/protocmp"
- "google.golang.org/protobuf/types/known/timestamppb"
"github.com/bytebase/bytebase/backend/base"
"github.com/bytebase/bytebase/backend/common"
@@ -464,45 +463,6 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
return nil, err
}
- // EarliestAllowedTs
- taskEarliest := int64(0)
- if task.EarliestAllowedAt != nil {
- taskEarliest = task.EarliestAllowedAt.Unix()
- }
- specEarliest := spec.EarliestAllowedTime.GetSeconds()
- if specEarliest != taskEarliest {
- taskPatch.UpdateEarliestAllowedTS = true
- if specEarliest == 0 {
- taskPatch.EarliestAllowedTS = nil
- } else {
- v := spec.EarliestAllowedTime.AsTime()
- taskPatch.EarliestAllowedTS = &v
- }
- doUpdate = true
-
- var fromEarliestAllowedTime, toEarliestAllowedTime *timestamppb.Timestamp
- if task.EarliestAllowedAt != nil {
- fromEarliestAllowedTime = timestamppb.New(*task.EarliestAllowedAt)
- }
- if specEarliest != 0 {
- toEarliestAllowedTime = spec.EarliestAllowedTime
- }
- if issue != nil {
- issueCommentCreates = append(issueCommentCreates, &store.IssueCommentMessage{
- IssueUID: issue.UID,
- Payload: &storepb.IssueCommentPayload{
- Event: &storepb.IssueCommentPayload_TaskUpdate_{
- TaskUpdate: &storepb.IssueCommentPayload_TaskUpdate{
- Tasks: []string{common.FormatTask(issue.Project.ResourceID, task.PipelineID, task.StageID, task.ID)},
- FromEarliestAllowedTime: fromEarliestAllowedTime,
- ToEarliestAllowedTime: toEarliestAllowedTime,
- },
- },
- },
- })
- }
- }
-
// PreUpdateBackupDetail
if err := func() error {
if newTaskType != base.TaskDatabaseDataUpdate {
@@ -690,7 +650,7 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *v1pb.UpdatePlanRe
}
for _, taskPatch := range taskPatchList {
- if taskPatch.SheetID != nil || taskPatch.EarliestAllowedTS != nil {
+ if taskPatch.SheetID != nil {
task := tasksMap[taskPatch.ID]
if task.LatestTaskRunStatus == base.TaskRunPending || task.LatestTaskRunStatus == base.TaskRunRunning || task.LatestTaskRunStatus == base.TaskRunSkipped || task.LatestTaskRunStatus == base.TaskRunDone {
return nil, status.Errorf(codes.FailedPrecondition, "cannot update plan because task %v is %s", task.ID, task.LatestTaskRunStatus)
diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.go
index fc84e0f21b..91d23a4806 100644
--- a/backend/api/v1/rollout_service_converter.go
+++ b/backend/api/v1/rollout_service_converter.go
@@ -87,8 +87,7 @@ func convertToPlanSpecs(specs []*storepb.PlanConfig_Spec) []*v1pb.Plan_Spec {
func convertToPlanSpec(spec *storepb.PlanConfig_Spec) *v1pb.Plan_Spec {
v1Spec := &v1pb.Plan_Spec{
- EarliestAllowedTime: spec.EarliestAllowedTime,
- Id: spec.Id,
+ Id: spec.Id,
SpecReleaseSource: &v1pb.Plan_SpecReleaseSource{
File: spec.SpecReleaseSource.GetFile(),
},
@@ -270,8 +269,7 @@ func convertPlanSpecs(specs []*v1pb.Plan_Spec) []*storepb.PlanConfig_Spec {
func convertPlanSpec(spec *v1pb.Plan_Spec) *storepb.PlanConfig_Spec {
storeSpec := &storepb.PlanConfig_Spec{
- EarliestAllowedTime: spec.EarliestAllowedTime,
- Id: spec.Id,
+ Id: spec.Id,
SpecReleaseSource: &storepb.PlanConfig_SpecReleaseSource{
File: spec.SpecReleaseSource.GetFile(),
},
diff --git a/backend/api/v1/rollout_service_task.go b/backend/api/v1/rollout_service_task.go
index 2361d93424..fab01838b7 100644
--- a/backend/api/v1/rollout_service_task.go
+++ b/backend/api/v1/rollout_service_task.go
@@ -238,10 +238,6 @@ func getTaskCreatesFromCreateDatabaseConfig(ctx context.Context, s *store.Store,
SheetId: int32(sheet.UID),
},
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- v.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{
v,
}, nil
@@ -313,10 +309,6 @@ func getTaskCreatesFromExportDataConfig(ctx context.Context, s *store.Store, spe
Type: base.TaskDatabaseDataExport,
Payload: payload,
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- taskCreate.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{taskCreate}, nil
}
@@ -362,10 +354,6 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s
},
},
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- taskCreate.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{taskCreate}, nil
case storepb.PlanConfig_ChangeDatabaseConfig_MIGRATE:
@@ -387,10 +375,6 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s
},
},
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- taskCreate.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{taskCreate}, nil
case storepb.PlanConfig_ChangeDatabaseConfig_MIGRATE_GHOST:
@@ -416,10 +400,6 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s
},
},
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- taskCreate.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{taskCreate}, nil
case storepb.PlanConfig_ChangeDatabaseConfig_DATA:
@@ -446,10 +426,6 @@ func getTaskCreatesFromChangeDatabaseConfigDatabaseTarget(ctx context.Context, s
},
},
}
- if spec.EarliestAllowedTime.GetSeconds() > 0 {
- t := spec.EarliestAllowedTime.AsTime()
- taskCreate.EarliestAllowedAt = &t
- }
return []*store.TaskMessage{taskCreate}, nil
default:
return nil, errors.Errorf("unsupported change database config type %q", c.Type)
diff --git a/backend/migrator/migration/3.7/0004##remove_task_earliest_allowed_at.sql b/backend/migrator/migration/3.7/0004##remove_task_earliest_allowed_at.sql
new file mode 100644
index 0000000000..6d22a86c69
--- /dev/null
+++ b/backend/migrator/migration/3.7/0004##remove_task_earliest_allowed_at.sql
@@ -0,0 +1 @@
+ALTER TABLE task DROP COLUMN IF EXISTS earliest_allowed_at;
\ No newline at end of file
diff --git a/backend/migrator/migration/LATEST.sql b/backend/migrator/migration/LATEST.sql
index 4a8e45e043..93f514a6c3 100644
--- a/backend/migrator/migration/LATEST.sql
+++ b/backend/migrator/migration/LATEST.sql
@@ -203,8 +203,7 @@ CREATE TABLE task (
instance text NOT NULL REFERENCES instance(resource_id),
db_name text,
type text NOT NULL CHECK (type LIKE 'bb.task.%'),
- payload jsonb NOT NULL DEFAULT '{}',
- earliest_allowed_at timestamptz NULL
+ payload jsonb NOT NULL DEFAULT '{}'
);
CREATE INDEX idx_task_pipeline_id_stage_id ON task(pipeline_id, stage_id);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index bb2a45d168..b842bfb28c 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -12,7 +12,7 @@ import (
func TestLatestVersion(t *testing.T) {
files, err := getSortedVersionedFiles()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.7.3"), *files[len(files)-1].version)
+ require.Equal(t, semver.MustParse("3.7.4"), *files[len(files)-1].version)
}
func TestVersionUnique(t *testing.T) {
diff --git a/backend/store/task.go b/backend/store/task.go
index fbfd73184c..b4ba18058e 100644
--- a/backend/store/task.go
+++ b/backend/store/task.go
@@ -8,7 +8,6 @@ import (
"math"
"sort"
"strings"
- "time"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
@@ -34,8 +33,6 @@ type TaskMessage struct {
// Domain specific fields
Type base.TaskType
Payload *storepb.TaskPayload
- // TODO(p0ny): deprecate
- EarliestAllowedAt *time.Time
LatestTaskRunStatus base.TaskRunStatus
}
@@ -76,10 +73,8 @@ type TaskPatch struct {
UpdaterID int
// Domain specific fields
- DatabaseName *string
- EarliestAllowedTS *time.Time
- UpdateEarliestAllowedTS bool
- Type *base.TaskType
+ DatabaseName *string
+ Type *base.TaskType
SheetID *int
SchemaVersion *string
@@ -169,26 +164,23 @@ func (*Store) createTasks(ctx context.Context, txn *sql.Tx, creates ...*TaskMess
instance,
db_name,
type,
- payload,
- earliest_allowed_at
+ payload
) SELECT
unnest(CAST($1 AS INTEGER[])),
unnest(CAST($2 AS INTEGER[])),
unnest(CAST($3 AS TEXT[])),
unnest(CAST($4 AS TEXT[])),
unnest(CAST($5 AS TEXT[])),
- unnest(CAST($6 AS JSONB[])),
- unnest(CAST($7 AS TIMESTAMPTZ[]))
- RETURNING id, pipeline_id, stage_id, instance, db_name, type, payload, earliest_allowed_at`
+ unnest(CAST($6 AS JSONB[]))
+ RETURNING id, pipeline_id, stage_id, instance, db_name, type, payload`
var (
- pipelineIDs []int
- stageIDs []int
- instances []string
- databases []*string
- types []string
- payloads [][]byte
- earliestAllowedAts []*time.Time
+ pipelineIDs []int
+ stageIDs []int
+ instances []string
+ databases []*string
+ types []string
+ payloads [][]byte
)
for _, create := range creates {
if create.Payload == nil {
@@ -204,11 +196,6 @@ func (*Store) createTasks(ctx context.Context, txn *sql.Tx, creates ...*TaskMess
databases = append(databases, create.DatabaseName)
types = append(types, string(create.Type))
payloads = append(payloads, payload)
- if create.EarliestAllowedAt == nil {
- earliestAllowedAts = append(earliestAllowedAts, nil)
- } else {
- earliestAllowedAts = append(earliestAllowedAts, create.EarliestAllowedAt)
- }
}
var tasks []*TaskMessage
@@ -219,7 +206,6 @@ func (*Store) createTasks(ctx context.Context, txn *sql.Tx, creates ...*TaskMess
databases,
types,
payloads,
- earliestAllowedAts,
)
if err != nil {
return nil, errors.Wrapf(err, "failed to query")
@@ -227,7 +213,6 @@ func (*Store) createTasks(ctx context.Context, txn *sql.Tx, creates ...*TaskMess
defer rows.Close()
for rows.Next() {
task := &TaskMessage{}
- var earliestAllowedAt sql.NullTime
var payload []byte
if err := rows.Scan(
&task.ID,
@@ -237,13 +222,9 @@ func (*Store) createTasks(ctx context.Context, txn *sql.Tx, creates ...*TaskMess
&task.DatabaseName,
&task.Type,
&payload,
- &earliestAllowedAt,
); err != nil {
return nil, errors.Wrapf(err, "failed to scan rows")
}
- if earliestAllowedAt.Valid {
- task.EarliestAllowedAt = &earliestAllowedAt.Time
- }
taskPayload := &storepb.TaskPayload{}
if err := common.ProtojsonUnmarshaler.Unmarshal(payload, taskPayload); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal plan config")
@@ -301,8 +282,7 @@ func (*Store) listTasksTx(ctx context.Context, txn *sql.Tx, find *TaskFind) ([]*
task.db_name,
latest_task_run.status AS latest_task_run_status,
task.type,
- task.payload,
- task.earliest_allowed_at
+ task.payload
FROM task
LEFT JOIN LATERAL (
SELECT COALESCE(
@@ -327,7 +307,6 @@ func (*Store) listTasksTx(ctx context.Context, txn *sql.Tx, find *TaskFind) ([]*
var tasks []*TaskMessage
for rows.Next() {
task := &TaskMessage{}
- var earliestAllowedAt sql.NullTime
var payload []byte
if err := rows.Scan(
&task.ID,
@@ -338,13 +317,9 @@ func (*Store) listTasksTx(ctx context.Context, txn *sql.Tx, find *TaskFind) ([]*
&task.LatestTaskRunStatus,
&task.Type,
&payload,
- &earliestAllowedAt,
); err != nil {
return nil, err
}
- if earliestAllowedAt.Valid {
- task.EarliestAllowedAt = &earliestAllowedAt.Time
- }
taskPayload := &storepb.TaskPayload{}
if err := common.ProtojsonUnmarshaler.Unmarshal(payload, taskPayload); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal plan config")
@@ -417,13 +392,6 @@ func (s *Store) UpdateTaskV2(ctx context.Context, patch *TaskPatch) (*TaskMessag
if len(payloadSet) != 0 {
set = append(set, fmt.Sprintf(`payload = payload || %s`, strings.Join(payloadSet, "||")))
}
- if patch.UpdateEarliestAllowedTS {
- if patch.EarliestAllowedTS == nil {
- set = append(set, "earliest_allowed_at = null")
- } else {
- set, args = append(set, fmt.Sprintf("earliest_allowed_at = $%d", len(args)+1)), append(args, *patch.EarliestAllowedTS)
- }
- }
args = append(args, patch.ID)
tx, err := s.db.BeginTx(ctx, nil)
@@ -433,13 +401,12 @@ func (s *Store) UpdateTaskV2(ctx context.Context, patch *TaskPatch) (*TaskMessag
defer tx.Rollback()
task := &TaskMessage{}
- var earliestAllowedAt sql.NullTime
var payload []byte
if err := tx.QueryRowContext(ctx, fmt.Sprintf(`
UPDATE task
SET `+strings.Join(set, ", ")+`
WHERE id = $%d
- RETURNING id, pipeline_id, stage_id, instance, db_name, type, payload, earliest_allowed_at
+ RETURNING id, pipeline_id, stage_id, instance, db_name, type, payload
`, len(args)),
args...,
).Scan(
@@ -450,7 +417,6 @@ func (s *Store) UpdateTaskV2(ctx context.Context, patch *TaskPatch) (*TaskMessag
&task.DatabaseName,
&task.Type,
&payload,
- &earliestAllowedAt,
); err != nil {
if err == sql.ErrNoRows {
return nil, &common.Error{Code: common.NotFound, Err: errors.Errorf("task not found with ID %d", patch.ID)}
@@ -458,9 +424,6 @@ func (s *Store) UpdateTaskV2(ctx context.Context, patch *TaskPatch) (*TaskMessag
return nil, err
}
- if earliestAllowedAt.Valid {
- task.EarliestAllowedAt = &earliestAllowedAt.Time
- }
taskPayload := &storepb.TaskPayload{}
if err := common.ProtojsonUnmarshaler.Unmarshal(payload, taskPayload); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal plan config")
diff --git a/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue b/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue
deleted file mode 100644
index b5467a056c..0000000000
--- a/frontend/src/components/IssueV1/components/Sidebar/EarliestAllowedTime.vue
+++ /dev/null
@@ -1,350 +0,0 @@
-<template>
- <div v-if="shouldShowEarliestAllowedTime" class="flex flex-col gap-y-1">
- <h2 class="flex flex-row items-center gap-x-1">
- <div class="flex gap-x-1 items-center textlabel">
- <NTooltip>
- <template #trigger>
- <span>{{ $t("task.earliest-allowed-time") }}</span>
- </template>
- <template #default>
- <div class="w-60">
- {{ $t("task.earliest-allowed-time-hint") }}
- </div>
- </template>
- </NTooltip>
-
- <FeatureBadge feature="bb.feature.task-schedule-time" />
- </div>
-
- <div class="text-gray-600 text-xs">
- {{ "UTC" + dayjs().format("ZZ") }}
- </div>
- </h2>
- <div>
- <NTooltip :disabled="disallowEditReasons.length === 0">
- <template #trigger>
- <NDatePicker
- :value="earliestAllowedTime"
- :is-date-disabled="isDayPassed"
- :placeholder="$t('task.earliest-allowed-time-unset')"
- :disabled="disallowEditReasons.length > 0 || isUpdating"
- :loading="isUpdating"
- :actions="['confirm']"
- type="datetime"
- clearable
- @update:value="handleUpdateEarliestAllowedTime"
- />
- </template>
- <template #default>
- <ErrorList :errors="disallowEditReasons" />
- </template>
- </NTooltip>
- </div>
-
- <FeatureModal
- :open="showFeatureModal"
- feature="bb.feature.task-schedule-time"
- @cancel="showFeatureModal = false"
- />
- </div>
-</template>
-
-<script setup lang="ts">
-import { useNow } from "@vueuse/core";
-import dayjs from "dayjs";
-import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
-import { cloneDeep } from "lodash-es";
-import { NButton, NDatePicker, NTooltip, useDialog } from "naive-ui";
-import { computed, h, ref } from "vue";
-import { useI18n } from "vue-i18n";
-import FeatureBadge from "@/components/FeatureGuard/FeatureBadge.vue";
-import FeatureModal from "@/components/FeatureGuard/FeatureModal.vue";
-import {
- isTaskEditable,
- latestTaskRunForTask,
- notifyNotEditableLegacyIssue,
- specForTask,
- stageForTask,
- useIssueContext,
-} from "@/components/IssueV1";
-import ErrorList from "@/components/misc/ErrorList.vue";
-import { planServiceClient } from "@/grpcweb";
-import { emitWindowEvent } from "@/plugins";
-import {
- hasFeature,
- pushNotification,
- useCurrentUserV1,
- extractUserId,
-} from "@/store";
-import { getTimeForPbTimestamp } from "@/types";
-import { Timestamp } from "@/types/proto/google/protobuf/timestamp";
-import { IssueStatus } from "@/types/proto/v1/issue_service";
-import type { Plan_Spec } from "@/types/proto/v1/plan_service";
-import {
- type Task,
- TaskRun_Status,
- Task_Status,
- task_StatusToJSON,
-} from "@/types/proto/v1/rollout_service";
-import {
- defer,
- flattenTaskV1List,
- hasProjectPermissionV2,
- isDatabaseChangeRelatedIssue,
-} from "@/utils";
-
-dayjs.extend(isSameOrAfter);
-
-const { t } = useI18n();
-const currentUser = useCurrentUserV1();
-const { isCreating, issue, selectedTask, events, getPlanCheckRunsForTask } =
- useIssueContext();
-const isUpdating = ref(false);
-const showFeatureModal = ref(false);
-const dialog = useDialog();
-
-const shouldShowEarliestAllowedTime = computed(() => {
- if (!isDatabaseChangeRelatedIssue(issue.value)) {
- return false;
- }
- return true;
-});
-
-// `null` to "Unset"
-const earliestAllowedTime = computed(() => {
- const spec = specForTask(issue.value.planEntity, selectedTask.value);
- return spec?.earliestAllowedTime
- ? getTimeForPbTimestamp(spec.earliestAllowedTime)
- : null;
-});
-
-const disallowEditReasons = computed(() => {
- if (isCreating.value) {
- return [];
- }
-
- const errors: string[] = [];
- if (issue.value.status !== IssueStatus.OPEN) {
- if (issue.value.status === IssueStatus.DONE) {
- errors.push(t("issue.disallow-edit-reasons.issue-is-done"));
- }
- if (issue.value.status === IssueStatus.CANCELED) {
- errors.push(t("issue.disallow-edit-reasons.issue-is-canceled"));
- }
- return errors;
- }
-
- let allow = false;
- // Issue creator is allowed to change the rollout time.
- if (extractUserId(issue.value.creator) === currentUser.value.email) {
- allow = true;
- }
- if (hasProjectPermissionV2(issue.value.projectEntity, "bb.plans.update")) {
- allow = true;
- }
- if (!allow) {
- errors.push(t("issue.you-are-not-allowed-to-change-this-value"));
- }
-
- const task = selectedTask.value;
- if (
- task.status === Task_Status.RUNNING ||
- task.status === Task_Status.PENDING
- ) {
- const latestTaskRun = latestTaskRunForTask(issue.value, selectedTask.value);
- if (latestTaskRun) {
- if (
- latestTaskRun.status === TaskRun_Status.PENDING ||
- latestTaskRun.status === TaskRun_Status.RUNNING
- ) {
- errors.push(
- t("issue.disallow-edit-reasons.task-is-running-cancel-first")
- );
- }
- }
- } else if ([Task_Status.DONE, Task_Status.SKIPPED].includes(task.status)) {
- errors.push(
- t("issue.disallow-edit-reasons.task-is-x-status", {
- status: task_StatusToJSON(task.status).toLowerCase(),
- })
- );
- }
-
- return errors;
-});
-
-const chooseUpdateStatementTarget = () => {
- type Target = "CANCELED" | "TASK" | "STAGE" | "ALL";
- const d = defer<{ target: Target; tasks: Task[] }>();
-
- const targets: Record<Target, Task[]> = {
- CANCELED: [],
- TASK: [selectedTask.value],
- STAGE: (stageForTask(issue.value, selectedTask.value)?.tasks ?? []).filter(
- (task) => {
- return isTaskEditable(task, getPlanCheckRunsForTask(task)).length === 0;
- }
- ),
- ALL: flattenTaskV1List(issue.value.rolloutEntity).filter((task) => {
- return isTaskEditable(task, getPlanCheckRunsForTask(task)).length === 0;
- }),
- };
-
- if (targets.STAGE.length === 1 && targets.ALL.length === 1) {
- d.resolve({ target: "TASK", tasks: targets.TASK });
- return d.promise;
- }
-
- const $d = dialog.create({
- title: t("issue.update-rollout-time.self"),
- content: t("issue.update-statement.apply-current-change-to"),
- type: "info",
- autoFocus: false,
- closable: false,
- maskClosable: false,
- closeOnEsc: false,
- showIcon: false,
- action: () => {
- const finish = (target: Target) => {
- d.resolve({ target, tasks: targets[target] });
- $d.destroy();
- };
-
- const CANCEL = h(
- NButton,
- { size: "small", onClick: () => finish("CANCELED") },
- {
- default: () => t("common.cancel"),
- }
- );
- const TASK = h(
- NButton,
- { size: "small", onClick: () => finish("TASK") },
- {
- default: () => t("issue.update-statement.target.selected-task"),
- }
- );
- const buttons = [CANCEL, TASK];
- if (targets.STAGE.length > 1) {
- // More than one editable tasks in stage
- // Add "Selected stage" option
- const STAGE = h(
- NButton,
- { size: "small", onClick: () => finish("STAGE") },
- {
- default: () => t("issue.update-statement.target.selected-stage"),
- }
- );
- buttons.push(STAGE);
- }
- if (targets.ALL.length > targets.STAGE.length) {
- // More editable tasks in other stages
- // Add "All tasks" option
- const ALL = h(
- NButton,
- { size: "small", onClick: () => finish("ALL") },
- {
- default: () => t("issue.update-statement.target.all-tasks"),
- }
- );
- buttons.push(ALL);
- }
-
- return h(
- "div",
- { class: "flex items-center justify-end gap-x-2" },
- buttons
- );
- },
- onClose() {
- d.resolve({ target: "CANCELED", tasks: [] });
- },
- });
-
- return d.promise;
-};
-
-const handleUpdateEarliestAllowedTime = async (timestampMS: number | null) => {
- if (!hasFeature("bb.feature.task-schedule-time")) {
- showFeatureModal.value = true;
- return;
- }
-
- if (isCreating.value) {
- const spec = specForTask(issue.value.planEntity, selectedTask.value);
- if (!spec) return;
- if (!timestampMS) {
- spec.earliestAllowedTime = undefined;
- } else {
- spec.earliestAllowedTime = Timestamp.fromPartial({
- seconds: Math.floor(timestampMS / 1000),
- });
- }
- } else {
- const { target, tasks } = await chooseUpdateStatementTarget();
-
- if (target === "CANCELED" || tasks.length === 0) {
- return;
- }
-
- const planPatch = cloneDeep(issue.value.planEntity);
- if (!planPatch) {
- notifyNotEditableLegacyIssue();
- return;
- }
-
- isUpdating.value = true;
- try {
- const specs: Plan_Spec[] = [];
- tasks.forEach((task) => {
- const spec = specForTask(planPatch, task);
- if (spec) {
- specs.push(spec);
- }
- });
- const distinctSpecIds = new Set(specs.map((s) => s.id));
- if (distinctSpecIds.size === 0) {
- notifyNotEditableLegacyIssue();
- return;
- }
-
- const specsToPatch = planPatch.steps
- .flatMap((step) => step.specs)
- .filter((spec) => distinctSpecIds.has(spec.id));
-
- for (let i = 0; i < specsToPatch.length; i++) {
- const spec = specsToPatch[i];
- if (!timestampMS) {
- spec.earliestAllowedTime = undefined;
- } else {
- spec.earliestAllowedTime = Timestamp.fromPartial({
- seconds: Math.floor(timestampMS / 1000),
- });
- }
- }
-
- const updatedPlan = await planServiceClient.updatePlan({
- plan: planPatch,
- updateMask: ["steps"],
- });
-
- issue.value.planEntity = updatedPlan;
-
- events.emit("status-changed", { eager: true });
-
- pushNotification({
- module: "bytebase",
- style: "SUCCESS",
- title: t("common.updated"),
- });
-
- emitWindowEvent("bb.pipeline-task-earliest-allowed-time-update");
- } finally {
- isUpdating.value = false;
- }
- }
-};
-
-const now = useNow();
-const isDayPassed = (ts: number) => !dayjs(ts).isSameOrAfter(now.value, "day");
-</script>
diff --git a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
index 5668c48a02..f744987f60 100644
--- a/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
+++ b/frontend/src/components/IssueV1/components/Sidebar/Sidebar.vue
@@ -7,7 +7,6 @@
<div class="border-t -mx-3" />
- <EarliestAllowedTime />
<PreBackupSection />
<GhostSection v-if="shouldShowGhostSection" />
</div>
@@ -19,7 +18,6 @@ import { GhostSection } from "@/components/Plan/components/Sidebar";
import { provideGhostSettingContext } from "@/components/Plan/components/Sidebar/GhostSection/context";
import type { Plan } from "@/types/proto/v1/plan_service";
import { specForTask, useIssueContext } from "../../logic";
-import EarliestAllowedTime from "./EarliestAllowedTime.vue";
import IssueLabels from "./IssueLabels.vue";
import PreBackupSection from "./PreBackupSection";
import ReleaseInfo from "./ReleaseInfo.vue";
diff --git a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
index 0717f7164a..14773752c1 100644
--- a/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
+++ b/frontend/src/components/IssueV1/components/TaskRunSection/TaskRunComment.vue
@@ -41,7 +41,7 @@ import {
import { TaskRun_Status, Task_Type } from "@/types/proto/v1/rollout_service";
import { databaseV1Url, extractTaskUID, flattenTaskV1List } from "@/utils";
import { extractChangelogUID } from "@/utils/v1/changelog";
-import { specForTask, useIssueContext } from "../../logic";
+import { useIssueContext } from "../../logic";
import { displayTaskRunLogEntryType } from "./TaskRunLogTable/common";
export type CommentLink = {
@@ -56,19 +56,9 @@ const props = defineProps<{
const { issue } = useIssueContext();
const { t } = useI18n();
-const task = computed(() => {
- const taskUID = extractTaskUID(props.taskRun.name);
- const task =
- flattenTaskV1List(issue.value.rolloutEntity).find(
- (task) => extractTaskUID(task.name) === taskUID
- ) ?? unknownTask();
- return task;
-});
-
const earliestAllowedTime = computed(() => {
- const spec = specForTask(issue.value.planEntity, task.value);
- return spec?.earliestAllowedTime
- ? getTimeForPbTimestamp(spec.earliestAllowedTime)
+ return props.taskRun.runTime
+ ? getTimeForPbTimestamp(props.taskRun.runTime)
: null;
});
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 6b8068bcd4..3537e2c509 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -249,8 +249,6 @@
"summary-report": "Summary report"
},
"earliest-allowed-time": "Earliest rollout time",
- "earliest-allowed-time-hint": "@:{'task.earliest-allowed-time'} is the earliest time to rollout the issue, you cannot rollout before this time; if unspecified, it runs when all criteria are met.",
- "earliest-allowed-time-unset": "Unset",
"comment": "Comment",
"started": "Started",
"view-change": "View change",
@@ -911,13 +909,6 @@
},
"not-editable-legacy-issue": "This issue is not editable because it was created in an old version of Bytebase",
"action-anyway": "{action} anyway",
- "disallow-edit-reasons": {
- "issue-is-done": "The issue is done",
- "issue-is-canceled": "The issue is canceled",
- "task-is-x-status": "The task is {status}",
- "task-is-running-cancel-first": "The task is running, cancel task before changing this value"
- },
- "you-are-not-allowed-to-change-this-value": "You are not allowed to change this value",
"sql-check": {
"sql-checks": "SQL checks",
"not-executed-yet": "Not executed yet",
@@ -942,9 +933,6 @@
"encrypt": "Encrypt",
"file-downloaded": "File Downloaded"
},
- "update-rollout-time": {
- "self": "Update rollout time"
- },
"task-run": {
"logs": "Logs",
"session": "Session",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 687aea033b..002540f7c4 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -249,8 +249,6 @@
"summary-report": "Informe resumido"
},
"earliest-allowed-time": "Tiempo de lanzamiento más temprano",
- "earliest-allowed-time-hint": "@:{'task.earliest-allowed-time'} es el momento más temprano para implementar el problema, no se puede implementar antes de este momento; si no se especifica, se ejecuta cuando se cumplen todos los criterios.",
- "earliest-allowed-time-unset": "No establecido",
"comment": "Comentario",
"started": "Iniciado",
"view-change": "Ver cambio",
@@ -911,13 +909,6 @@
},
"not-editable-legacy-issue": "Este problema no es editable porque se creó en una versión anterior de Bytebase",
"action-anyway": "{action} de todos modos",
- "disallow-edit-reasons": {
- "issue-is-done": "La cuestión está hecha",
- "issue-is-canceled": "La emisión está cancelada.",
- "task-is-x-status": "La tarea es {status}",
- "task-is-running-cancel-first": "La tarea se está ejecutando, cancele la tarea antes de cambiar este valor"
- },
- "you-are-not-allowed-to-change-this-value": "No tienes permitido cambiar este valor.",
"sql-check": {
"sql-checks": "Comprobaciones SQL",
"not-executed-yet": "Aún no ejecutado",
@@ -942,9 +933,6 @@
"encrypt": "Cifrar",
"file-downloaded": "Archivo Descargado"
},
- "update-rollout-time": {
- "self": "Hora de implementación de la actualización"
- },
"task-run": {
"logs": "Registros",
"session": "Sesión",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 56abc4928f..67cd7f3419 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -249,8 +249,6 @@
"summary-report": "概略報告"
},
"earliest-allowed-time": "最も早い展開時期",
- "earliest-allowed-time-hint": "@:{'task.earliest-allowed-time'} は問題をロールアウトする最も早い時間です。この時間より前にロールアウトすることはできません。指定されていない場合は、すべての条件が満たされたときに実行されます。",
- "earliest-allowed-time-unset": "設定されていません",
"comment": "コメント",
"started": "から始まりました",
"view-change": "変更を表示する",
@@ -911,13 +909,6 @@
},
"not-editable-legacy-issue": "このイシューは古いバージョンの Bytebase で作成されたため編集できません。",
"action-anyway": "まだ {action} が必要です",
- "disallow-edit-reasons": {
- "issue-is-done": "イシューが完了しました",
- "issue-is-canceled": "イシューがキャンセルされました",
- "task-is-x-status": "タスクのステータスは {status} です",
- "task-is-running-cancel-first": "タスクが実行中です。この値を変更するには、タスクをキャンセルする必要があります。"
- },
- "you-are-not-allowed-to-change-this-value": "この値を変更する権限がありません",
"sql-check": {
"sql-checks": "SQLチェック項目",
"not-executed-yet": "まだ実行されていません",
@@ -942,9 +933,6 @@
"encrypt": "暗号化",
"file-downloaded": "ダウンロードされたファイル"
},
- "update-rollout-time": {
- "self": "更新のロールアウト時間"
- },
"task-run": {
"logs": "ログ",
"session": "セッション",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index da8ee3d9e5..10d38e52f7 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -249,8 +249,6 @@
"summary-report": "Báo cáo tổng hợp"
},
"earliest-allowed-time": "Thời gian triển khai sớm nhất",
- "earliest-allowed-time-hint": "@:{'task.earliest-allowed-time'} là thời gian sớm nhất để triển khai sự cố, bạn không thể triển khai trước thời gian này; nếu không được chỉ định, sự cố sẽ chạy khi đáp ứng tất cả các tiêu chí.",
- "earliest-allowed-time-unset": "Không đặt",
"comment": "Bình luận",
"started": "Bắt đầu",
"view-change": "Xem thay đổi",
@@ -911,13 +909,6 @@
},
"not-editable-legacy-issue": "Vấn đề này không thể chỉnh sửa vì nó được tạo trong phiên bản cũ của Bytebase",
"action-anyway": "{action} bằng mọi cách",
- "disallow-edit-reasons": {
- "issue-is-done": "Vấn đề đã hoàn tất",
- "issue-is-canceled": "Vấn đề đã bị hủy",
- "task-is-x-status": "Tác vụ là {status}",
- "task-is-running-cancel-first": "Tác vụ đang chạy, hãy hủy tác vụ trước khi thay đổi giá trị này"
- },
- "you-are-not-allowed-to-change-this-value": "Bạn không được phép thay đổi giá trị này",
"sql-check": {
"sql-checks": "Kiểm tra SQL",
"not-executed-yet": "Chưa được thực hiện",
@@ -942,9 +933,6 @@
"encrypt": "Mã hóa",
"file-downloaded": "Tệp đã tải xuống"
},
- "update-rollout-time": {
- "self": "Cập nhật thời gian triển khai"
- },
"task-run": {
"logs": "Nhật ký",
"session": "Phiên",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index cc95d17915..4e1e61bbb3 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -249,8 +249,6 @@
"summary-report": "概要报告"
},
"earliest-allowed-time": "最早允许发布时间",
- "earliest-allowed-time-hint": "@:{'task.earliest-allowed-time'} 是可发布工单的最早时间,您不能在此时间之前进行发布;如果未指定,则当满足所有条件时发布。",
- "earliest-allowed-time-unset": "未设置",
"comment": "评论",
"started": "开始于",
"view-change": "查看变更",
@@ -911,13 +909,6 @@
},
"not-editable-legacy-issue": "这个工单不可编辑,因为它是在旧版本的 Bytebase 中创建的。",
"action-anyway": "仍要{action}",
- "disallow-edit-reasons": {
- "issue-is-done": "工单已完成",
- "issue-is-canceled": "工单已取消",
- "task-is-x-status": "任务状态是{status}",
- "task-is-running-cancel-first": "任务运行中,需要取消任务才能修改这项值"
- },
- "you-are-not-allowed-to-change-this-value": "您无权更改这项值",
"sql-check": {
"sql-checks": "SQL 检查项",
"not-executed-yet": "尚未执行",
@@ -942,9 +933,6 @@
"encrypt": "加密",
"file-downloaded": "文件已下载"
},
- "update-rollout-time": {
- "self": "修改指定发布时间"
- },
"task-run": {
"logs": "日志",
"session": "会话",
diff --git a/frontend/src/types/proto/v1/plan_service.ts b/frontend/src/types/proto/v1/plan_service.ts
index 2cf764daf9..4c33b7e420 100644
--- a/frontend/src/types/proto/v1/plan_service.ts
+++ b/frontend/src/types/proto/v1/plan_service.ts
@@ -169,10 +169,6 @@ export interface Plan_Step {
}
export interface Plan_Spec {
- /** earliest_allowed_time the earliest execution time of the change. */
- earliestAllowedTime:
- | Timestamp
- | undefined;
/** A UUID4 string that uniquely identifies the Spec. */
id: string;
specReleaseSource: Plan_SpecReleaseSource | undefined;
@@ -1637,7 +1633,6 @@ export const Plan_Step: MessageFns<Plan_Step> = {
function createBasePlan_Spec(): Plan_Spec {
return {
- earliestAllowedTime: undefined,
id: "",
specReleaseSource: undefined,
createDatabaseConfig: undefined,
@@ -1648,9 +1643,6 @@ function createBasePlan_Spec(): Plan_Spec {
export const Plan_Spec: MessageFns<Plan_Spec> = {
encode(message: Plan_Spec, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
- if (message.earliestAllowedTime !== undefined) {
- Timestamp.encode(message.earliestAllowedTime, writer.uint32(34).fork()).join();
- }
if (message.id !== "") {
writer.uint32(42).string(message.id);
}
@@ -1676,14 +1668,6 @@ export const Plan_Spec: MessageFns<Plan_Spec> = {
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
- case 4: {
- if (tag !== 34) {
- break;
- }
-
- message.earliestAllowedTime = Timestamp.decode(reader, reader.uint32());
- continue;
- }
case 5: {
if (tag !== 42) {
break;
@@ -1735,9 +1719,6 @@ export const Plan_Spec: MessageFns<Plan_Spec> = {
fromJSON(object: any): Plan_Spec {
return {
- earliestAllowedTime: isSet(object.earliestAllowedTime)
- ? fromJsonTimestamp(object.earliestAllowedTime)
- : undefined,
id: isSet(object.id) ? globalThis.String(object.id) : "",
specReleaseSource: isSet(object.specReleaseSource)
? Plan_SpecReleaseSource.fromJSON(object.specReleaseSource)
@@ -1756,9 +1737,6 @@ export const Plan_Spec: MessageFns<Plan_Spec> = {
toJSON(message: Plan_Spec): unknown {
const obj: any = {};
- if (message.earliestAllowedTime !== undefined) {
- obj.earliestAllowedTime = fromTimestamp(message.earliestAllowedTime).toISOString();
- }
if (message.id !== "") {
obj.id = message.id;
}
@@ -1782,9 +1760,6 @@ export const Plan_Spec: MessageFns<Plan_Spec> = {
},
fromPartial(object: DeepPartial<Plan_Spec>): Plan_Spec {
const message = createBasePlan_Spec();
- message.earliestAllowedTime = (object.earliestAllowedTime !== undefined && object.earliestAllowedTime !== null)
- ? Timestamp.fromPartial(object.earliestAllowedTime)
- : undefined;
message.id = object.id ?? "";
message.specReleaseSource = (object.specReleaseSource !== undefined && object.specReleaseSource !== null)
? Plan_SpecReleaseSource.fromPartial(object.specReleaseSource)
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 52be3aa66d..2e2f9074fc 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -11212,10 +11212,6 @@ components:
Plan_Spec:
type: object
properties:
- earliestAllowedTime:
- type: string
- description: earliest_allowed_time the earliest execution time of the change.
- format: date-time
id:
type: string
description: A UUID4 string that uniquely identifies the Spec.
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 25e32e26b1..c4da140372 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -3110,7 +3110,6 @@ InstanceRole is the API message for instance role.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| earliest_allowed_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | earliest_allowed_time the earliest execution time of the change. |
| id | [string](#string) | | A UUID4 string that uniquely identifies the Spec. |
| spec_release_source | [PlanConfig.SpecReleaseSource](#bytebase-store-PlanConfig-SpecReleaseSource) | | |
| create_database_config | [PlanConfig.CreateDatabaseConfig](#bytebase-store-PlanConfig-CreateDatabaseConfig) | | |
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 44567be269..f172c0fd61 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -8664,13 +8664,6 @@ Format: projects/{project}/releases/{release} </p></td>
</thead>
<tbody>
- <tr>
- <td>earliest_allowed_time</td>
- <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
- <td></td>
- <td><p>earliest_allowed_time the earliest execution time of the change. </p></td>
- </tr>
-
<tr>
<td>id</td>
<td><a href="#string">string</a></td>
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index b25e66e827..40a3092048 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -7487,7 +7487,6 @@ When paginating, all other parameters provided to `ListPlans` must match the cal
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
-| earliest_allowed_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | earliest_allowed_time the earliest execution time of the change. |
| id | [string](#string) | | A UUID4 string that uniquely identifies the Spec. |
| spec_release_source | [Plan.SpecReleaseSource](#bytebase-v1-Plan-SpecReleaseSource) | | |
| create_database_config | [Plan.CreateDatabaseConfig](#bytebase-v1-Plan-CreateDatabaseConfig) | | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index b1329cc232..b492d59ff5 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -20834,13 +20834,6 @@ Format: projects/{project}/releases/{release} </p></td>
</thead>
<tbody>
- <tr>
- <td>earliest_allowed_time</td>
- <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>
- <td></td>
- <td><p>earliest_allowed_time the earliest execution time of the change. </p></td>
- </tr>
-
<tr>
<td>id</td>
<td><a href="#string">string</a></td>
diff --git a/proto/generated-go/store/plan.pb.go b/proto/generated-go/store/plan.pb.go
index 96ea062ddd..403d164baa 100644
--- a/proto/generated-go/store/plan.pb.go
+++ b/proto/generated-go/store/plan.pb.go
@@ -10,7 +10,6 @@ import (
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
- timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
sync "sync"
unsafe "unsafe"
@@ -205,8 +204,6 @@ func (x *PlanConfig_Step) GetSpecs() []*PlanConfig_Spec {
type PlanConfig_Spec struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // earliest_allowed_time the earliest execution time of the change.
- EarliestAllowedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=earliest_allowed_time,json=earliestAllowedTime,proto3" json:"earliest_allowed_time,omitempty"`
// A UUID4 string that uniquely identifies the Spec.
Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
SpecReleaseSource *PlanConfig_SpecReleaseSource `protobuf:"bytes,8,opt,name=spec_release_source,json=specReleaseSource,proto3" json:"spec_release_source,omitempty"`
@@ -250,13 +247,6 @@ func (*PlanConfig_Spec) Descriptor() ([]byte, []int) {
return file_store_plan_proto_rawDescGZIP(), []int{0, 1}
}
-func (x *PlanConfig_Spec) GetEarliestAllowedTime() *timestamppb.Timestamp {
- if x != nil {
- return x.EarliestAllowedTime
- }
- return nil
-}
-
func (x *PlanConfig_Spec) GetId() string {
if x != nil {
return x.Id
@@ -818,7 +808,7 @@ var File_store_plan_proto protoreflect.FileDescriptor
const file_store_plan_proto_rawDesc = "" +
"\n" +
- "\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x12store/common.proto\x1a\x1astore/plan_check_run.proto\"\xde\x11\n" +
+ "\x10store/plan.proto\x12\x0ebytebase.store\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x12store/common.proto\x1a\x1astore/plan_check_run.proto\"\x8e\x11\n" +
"\n" +
"PlanConfig\x125\n" +
"\x05steps\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.StepR\x05steps\x12O\n" +
@@ -828,9 +818,8 @@ const file_store_plan_proto_rawDesc = "" +
"deployment\x1aS\n" +
"\x04Step\x12\x14\n" +
"\x05title\x18\x02 \x01(\tR\x05title\x125\n" +
- "\x05specs\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.SpecR\x05specs\x1a\xfd\x03\n" +
- "\x04Spec\x12N\n" +
- "\x15earliest_allowed_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x13earliestAllowedTime\x12\x0e\n" +
+ "\x05specs\x18\x01 \x03(\v2\x1f.bytebase.store.PlanConfig.SpecR\x05specs\x1a\xad\x03\n" +
+ "\x04Spec\x12\x0e\n" +
"\x02id\x18\x05 \x01(\tR\x02id\x12\\\n" +
"\x13spec_release_source\x18\b \x01(\v2,.bytebase.store.PlanConfig.SpecReleaseSourceR\x11specReleaseSource\x12g\n" +
"\x16create_database_config\x18\x01 \x01(\v2/.bytebase.store.PlanConfig.CreateDatabaseConfigH\x00R\x14createDatabaseConfig\x12g\n" +
@@ -912,30 +901,28 @@ var file_store_plan_proto_goTypes = []any{
(*PlanConfig_Deployment)(nil), // 9: bytebase.store.PlanConfig.Deployment
nil, // 10: bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry
(*PlanConfig_Deployment_DatabaseGroupMapping)(nil), // 11: bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping
- (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
- (*PreUpdateBackupDetail)(nil), // 13: bytebase.store.PreUpdateBackupDetail
- (ExportFormat)(0), // 14: bytebase.store.ExportFormat
+ (*PreUpdateBackupDetail)(nil), // 12: bytebase.store.PreUpdateBackupDetail
+ (ExportFormat)(0), // 13: bytebase.store.ExportFormat
}
var file_store_plan_proto_depIdxs = []int32{
2, // 0: bytebase.store.PlanConfig.steps:type_name -> bytebase.store.PlanConfig.Step
7, // 1: bytebase.store.PlanConfig.release_source:type_name -> bytebase.store.PlanConfig.ReleaseSource
9, // 2: bytebase.store.PlanConfig.deployment:type_name -> bytebase.store.PlanConfig.Deployment
3, // 3: bytebase.store.PlanConfig.Step.specs:type_name -> bytebase.store.PlanConfig.Spec
- 12, // 4: bytebase.store.PlanConfig.Spec.earliest_allowed_time:type_name -> google.protobuf.Timestamp
- 8, // 5: bytebase.store.PlanConfig.Spec.spec_release_source:type_name -> bytebase.store.PlanConfig.SpecReleaseSource
- 4, // 6: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig
- 5, // 7: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig
- 6, // 8: bytebase.store.PlanConfig.Spec.export_data_config:type_name -> bytebase.store.PlanConfig.ExportDataConfig
- 0, // 9: bytebase.store.PlanConfig.ChangeDatabaseConfig.type:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.Type
- 10, // 10: bytebase.store.PlanConfig.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry
- 13, // 11: bytebase.store.PlanConfig.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail
- 14, // 12: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat
- 11, // 13: bytebase.store.PlanConfig.Deployment.database_group_mappings:type_name -> bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping
- 14, // [14:14] is the sub-list for method output_type
- 14, // [14:14] is the sub-list for method input_type
- 14, // [14:14] is the sub-list for extension type_name
- 14, // [14:14] is the sub-list for extension extendee
- 0, // [0:14] is the sub-list for field type_name
+ 8, // 4: bytebase.store.PlanConfig.Spec.spec_release_source:type_name -> bytebase.store.PlanConfig.SpecReleaseSource
+ 4, // 5: bytebase.store.PlanConfig.Spec.create_database_config:type_name -> bytebase.store.PlanConfig.CreateDatabaseConfig
+ 5, // 6: bytebase.store.PlanConfig.Spec.change_database_config:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig
+ 6, // 7: bytebase.store.PlanConfig.Spec.export_data_config:type_name -> bytebase.store.PlanConfig.ExportDataConfig
+ 0, // 8: bytebase.store.PlanConfig.ChangeDatabaseConfig.type:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.Type
+ 10, // 9: bytebase.store.PlanConfig.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.store.PlanConfig.ChangeDatabaseConfig.GhostFlagsEntry
+ 12, // 10: bytebase.store.PlanConfig.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.store.PreUpdateBackupDetail
+ 13, // 11: bytebase.store.PlanConfig.ExportDataConfig.format:type_name -> bytebase.store.ExportFormat
+ 11, // 12: bytebase.store.PlanConfig.Deployment.database_group_mappings:type_name -> bytebase.store.PlanConfig.Deployment.DatabaseGroupMapping
+ 13, // [13:13] is the sub-list for method output_type
+ 13, // [13:13] is the sub-list for method input_type
+ 13, // [13:13] is the sub-list for extension type_name
+ 13, // [13:13] is the sub-list for extension extendee
+ 0, // [0:13] is the sub-list for field type_name
}
func init() { file_store_plan_proto_init() }
diff --git a/proto/generated-go/v1/plan_service.pb.go b/proto/generated-go/v1/plan_service.pb.go
index 91c6ee801e..b02618babe 100644
--- a/proto/generated-go/v1/plan_service.pb.go
+++ b/proto/generated-go/v1/plan_service.pb.go
@@ -1431,8 +1431,6 @@ func (x *Plan_Step) GetSpecs() []*Plan_Spec {
type Plan_Spec struct {
state protoimpl.MessageState `protogen:"open.v1"`
- // earliest_allowed_time the earliest execution time of the change.
- EarliestAllowedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=earliest_allowed_time,json=earliestAllowedTime,proto3" json:"earliest_allowed_time,omitempty"`
// A UUID4 string that uniquely identifies the Spec.
Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"`
SpecReleaseSource *Plan_SpecReleaseSource `protobuf:"bytes,8,opt,name=spec_release_source,json=specReleaseSource,proto3" json:"spec_release_source,omitempty"`
@@ -1476,13 +1474,6 @@ func (*Plan_Spec) Descriptor() ([]byte, []int) {
return file_v1_plan_service_proto_rawDescGZIP(), []int{7, 1}
}
-func (x *Plan_Spec) GetEarliestAllowedTime() *timestamppb.Timestamp {
- if x != nil {
- return x.EarliestAllowedTime
- }
- return nil
-}
-
func (x *Plan_Spec) GetId() string {
if x != nil {
return x.Id
@@ -2408,7 +2399,7 @@ const file_v1_plan_service_proto_rawDesc = "" +
"\x11UpdatePlanRequest\x12+\n" +
"\x04plan\x18\x01 \x01(\v2\x11.bytebase.v1.PlanB\x04\xe2A\x01\x02R\x04plan\x12A\n" +
"\vupdate_mask\x18\x02 \x01(\v2\x1a.google.protobuf.FieldMaskB\x04\xe2A\x01\x02R\n" +
- "updateMask\"\xa7\x15\n" +
+ "updateMask\"\xd7\x14\n" +
"\x04Plan\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
"\x05issue\x18\x03 \x01(\tR\x05issue\x12\x14\n" +
@@ -2428,9 +2419,8 @@ const file_v1_plan_service_proto_rawDesc = "" +
"deployment\x1aJ\n" +
"\x04Step\x12\x14\n" +
"\x05title\x18\x02 \x01(\tR\x05title\x12,\n" +
- "\x05specs\x18\x01 \x03(\v2\x16.bytebase.v1.Plan.SpecR\x05specs\x1a\xd9\x03\n" +
- "\x04Spec\x12N\n" +
- "\x15earliest_allowed_time\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x13earliestAllowedTime\x12\x0e\n" +
+ "\x05specs\x18\x01 \x03(\v2\x16.bytebase.v1.Plan.SpecR\x05specs\x1a\x89\x03\n" +
+ "\x04Spec\x12\x0e\n" +
"\x02id\x18\x05 \x01(\tR\x02id\x12S\n" +
"\x13spec_release_source\x18\b \x01(\v2#.bytebase.v1.Plan.SpecReleaseSourceR\x11specReleaseSource\x12^\n" +
"\x16create_database_config\x18\x01 \x01(\v2&.bytebase.v1.Plan.CreateDatabaseConfigH\x00R\x14createDatabaseConfig\x12^\n" +
@@ -2661,45 +2651,44 @@ var file_v1_plan_service_proto_depIdxs = []int32{
34, // 17: bytebase.v1.PlanCheckRun.results:type_name -> bytebase.v1.PlanCheckRun.Result
38, // 18: bytebase.v1.PlanCheckRun.create_time:type_name -> google.protobuf.Timestamp
22, // 19: bytebase.v1.Plan.Step.specs:type_name -> bytebase.v1.Plan.Spec
- 38, // 20: bytebase.v1.Plan.Spec.earliest_allowed_time:type_name -> google.protobuf.Timestamp
- 29, // 21: bytebase.v1.Plan.Spec.spec_release_source:type_name -> bytebase.v1.Plan.SpecReleaseSource
- 24, // 22: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
- 25, // 23: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
- 26, // 24: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
- 0, // 25: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.Type
- 30, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
- 31, // 27: bytebase.v1.Plan.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail
- 39, // 28: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
- 32, // 29: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping
- 3, // 30: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status
- 35, // 31: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
- 36, // 32: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
- 40, // 33: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources
- 41, // 34: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
- 41, // 35: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
- 4, // 36: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
- 5, // 37: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
- 7, // 38: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
- 9, // 39: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
- 10, // 40: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
- 12, // 41: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest
- 14, // 42: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
- 16, // 43: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest
- 18, // 44: bytebase.v1.PlanService.PreviewPlan:input_type -> bytebase.v1.PreviewPlanRequest
- 11, // 45: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
- 6, // 46: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
- 8, // 47: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
- 11, // 48: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
- 11, // 49: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
- 13, // 50: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse
- 15, // 51: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
- 17, // 52: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse
- 19, // 53: bytebase.v1.PlanService.PreviewPlan:output_type -> bytebase.v1.PreviewPlanResponse
- 45, // [45:54] is the sub-list for method output_type
- 36, // [36:45] is the sub-list for method input_type
- 36, // [36:36] is the sub-list for extension type_name
- 36, // [36:36] is the sub-list for extension extendee
- 0, // [0:36] is the sub-list for field type_name
+ 29, // 20: bytebase.v1.Plan.Spec.spec_release_source:type_name -> bytebase.v1.Plan.SpecReleaseSource
+ 24, // 21: bytebase.v1.Plan.Spec.create_database_config:type_name -> bytebase.v1.Plan.CreateDatabaseConfig
+ 25, // 22: bytebase.v1.Plan.Spec.change_database_config:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig
+ 26, // 23: bytebase.v1.Plan.Spec.export_data_config:type_name -> bytebase.v1.Plan.ExportDataConfig
+ 0, // 24: bytebase.v1.Plan.ChangeDatabaseConfig.type:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.Type
+ 30, // 25: bytebase.v1.Plan.ChangeDatabaseConfig.ghost_flags:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.GhostFlagsEntry
+ 31, // 26: bytebase.v1.Plan.ChangeDatabaseConfig.pre_update_backup_detail:type_name -> bytebase.v1.Plan.ChangeDatabaseConfig.PreUpdateBackupDetail
+ 39, // 27: bytebase.v1.Plan.ExportDataConfig.format:type_name -> bytebase.v1.ExportFormat
+ 32, // 28: bytebase.v1.Plan.Deployment.database_group_mappings:type_name -> bytebase.v1.Plan.Deployment.DatabaseGroupMapping
+ 3, // 29: bytebase.v1.PlanCheckRun.Result.status:type_name -> bytebase.v1.PlanCheckRun.Result.Status
+ 35, // 30: bytebase.v1.PlanCheckRun.Result.sql_summary_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlSummaryReport
+ 36, // 31: bytebase.v1.PlanCheckRun.Result.sql_review_report:type_name -> bytebase.v1.PlanCheckRun.Result.SqlReviewReport
+ 40, // 32: bytebase.v1.PlanCheckRun.Result.SqlSummaryReport.changed_resources:type_name -> bytebase.v1.ChangedResources
+ 41, // 33: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.start_position:type_name -> bytebase.v1.Position
+ 41, // 34: bytebase.v1.PlanCheckRun.Result.SqlReviewReport.end_position:type_name -> bytebase.v1.Position
+ 4, // 35: bytebase.v1.PlanService.GetPlan:input_type -> bytebase.v1.GetPlanRequest
+ 5, // 36: bytebase.v1.PlanService.ListPlans:input_type -> bytebase.v1.ListPlansRequest
+ 7, // 37: bytebase.v1.PlanService.SearchPlans:input_type -> bytebase.v1.SearchPlansRequest
+ 9, // 38: bytebase.v1.PlanService.CreatePlan:input_type -> bytebase.v1.CreatePlanRequest
+ 10, // 39: bytebase.v1.PlanService.UpdatePlan:input_type -> bytebase.v1.UpdatePlanRequest
+ 12, // 40: bytebase.v1.PlanService.ListPlanCheckRuns:input_type -> bytebase.v1.ListPlanCheckRunsRequest
+ 14, // 41: bytebase.v1.PlanService.RunPlanChecks:input_type -> bytebase.v1.RunPlanChecksRequest
+ 16, // 42: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:input_type -> bytebase.v1.BatchCancelPlanCheckRunsRequest
+ 18, // 43: bytebase.v1.PlanService.PreviewPlan:input_type -> bytebase.v1.PreviewPlanRequest
+ 11, // 44: bytebase.v1.PlanService.GetPlan:output_type -> bytebase.v1.Plan
+ 6, // 45: bytebase.v1.PlanService.ListPlans:output_type -> bytebase.v1.ListPlansResponse
+ 8, // 46: bytebase.v1.PlanService.SearchPlans:output_type -> bytebase.v1.SearchPlansResponse
+ 11, // 47: bytebase.v1.PlanService.CreatePlan:output_type -> bytebase.v1.Plan
+ 11, // 48: bytebase.v1.PlanService.UpdatePlan:output_type -> bytebase.v1.Plan
+ 13, // 49: bytebase.v1.PlanService.ListPlanCheckRuns:output_type -> bytebase.v1.ListPlanCheckRunsResponse
+ 15, // 50: bytebase.v1.PlanService.RunPlanChecks:output_type -> bytebase.v1.RunPlanChecksResponse
+ 17, // 51: bytebase.v1.PlanService.BatchCancelPlanCheckRuns:output_type -> bytebase.v1.BatchCancelPlanCheckRunsResponse
+ 19, // 52: bytebase.v1.PlanService.PreviewPlan:output_type -> bytebase.v1.PreviewPlanResponse
+ 44, // [44:53] is the sub-list for method output_type
+ 35, // [35:44] is the sub-list for method input_type
+ 35, // [35:35] is the sub-list for extension type_name
+ 35, // [35:35] is the sub-list for extension extendee
+ 0, // [0:35] is the sub-list for field type_name
}
func init() { file_v1_plan_service_proto_init() }
diff --git a/proto/store/store/plan.proto b/proto/store/store/plan.proto
index fbebf94085..a959a0a554 100644
--- a/proto/store/store/plan.proto
+++ b/proto/store/store/plan.proto
@@ -4,7 +4,6 @@ package bytebase.store;
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
-import "google/protobuf/timestamp.proto";
import "store/common.proto";
import "store/plan_check_run.proto";
@@ -24,8 +23,6 @@ message PlanConfig {
repeated Spec specs = 1;
}
message Spec {
- // earliest_allowed_time the earliest execution time of the change.
- google.protobuf.Timestamp earliest_allowed_time = 4;
// A UUID4 string that uniquely identifies the Spec.
string id = 5;
diff --git a/proto/v1/v1/plan_service.proto b/proto/v1/v1/plan_service.proto
index 4f16947ebc..3334e6677c 100644
--- a/proto/v1/v1/plan_service.proto
+++ b/proto/v1/v1/plan_service.proto
@@ -237,8 +237,6 @@ message Plan {
}
message Spec {
- // earliest_allowed_time the earliest execution time of the change.
- google.protobuf.Timestamp earliest_allowed_time = 4;
// A UUID4 string that uniquely identifies the Spec.
string id = 5;