Skip to content

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

chore: deprecate GitOps latest schema writeback (#11230)

Danny Xuf1e32726aa74
diff --git a/backend/legacyapi/plan.go b/backend/legacyapi/plan.go
index 1fcae0cc5f..0fa57d6ab6 100644
--- a/backend/legacyapi/plan.go
+++ b/backend/legacyapi/plan.go
@@ -129,10 +129,6 @@ const (
// VCS Integration.
- // FeatureVCSSchemaWriteBack allows user to enable the latest schema write-back in VCS workflow.
- FeatureVCSSchemaWriteBack FeatureType = "bb.feature.vcs-schema-write-back"
- // FeatureVCSSheetSync allows to sync sheets from the VCS in VCS workflow.
- FeatureVCSSheetSync FeatureType = "bb.feature.vcs-sheet-sync"
// FeatureVCSSQLReviewWorkflow allows user to enable the SQL review CI in VCS workflow.
FeatureVCSSQLReviewWorkflow FeatureType = "bb.feature.vcs-sql-review"
@@ -242,10 +238,6 @@ func (e FeatureType) Name() string {
case FeatureSchemaTemplate:
return "Schema template"
// VCS Integration
- case FeatureVCSSchemaWriteBack:
- return "Schema write-back"
- case FeatureVCSSheetSync:
- return "Sync sheets from VCS"
case FeatureVCSSQLReviewWorkflow:
return "VCS SQL review workflow"
// Database management
@@ -330,8 +322,6 @@ var FeatureMatrix = map[FeatureType][3]bool{
FeatureDatabaseGrouping: {false, false, true},
FeatureSchemaTemplate: {false, false, true},
// VCS Integration
- FeatureVCSSchemaWriteBack: {false, true, true},
- FeatureVCSSheetSync: {false, true, true},
FeatureVCSSQLReviewWorkflow: {true, true, true},
// Database management
FeatureReadReplicaConnection: {false, false, true},
@@ -364,7 +354,6 @@ var InstanceLimitFeature = map[FeatureType]bool{
FeatureTaskScheduleTime: true,
FeatureOnlineMigration: true,
// VCS Integration
- FeatureVCSSchemaWriteBack: true,
FeatureVCSSQLReviewWorkflow: true,
FeatureMybatisSQLReview: true,
// Database management
diff --git a/backend/runner/taskrun/data_update_executor.go b/backend/runner/taskrun/data_update_executor.go
index da6410f8f9..d6128fe1e1 100644
--- a/backend/runner/taskrun/data_update_executor.go
+++ b/backend/runner/taskrun/data_update_executor.go
@@ -72,7 +72,7 @@ func (exec *DataUpdateExecutor) RunOnce(ctx context.Context, driverCtx context.C
return true, nil, err
}
version := model.Version{Version: payload.SchemaVersion}
- return runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.activityManager, exec.license, exec.stateCfg, exec.profile, task, taskRunUID, db.Data, statement, version, &payload.SheetID)
+ return runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Data, statement, version, &payload.SheetID)
}
func (exec *DataUpdateExecutor) backupData(
diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.go
index e833947e71..9feca69f47 100644
--- a/backend/runner/taskrun/executor.go
+++ b/backend/runner/taskrun/executor.go
@@ -6,26 +6,20 @@ import (
"encoding/json"
"fmt"
"log/slog"
- "path/filepath"
"sort"
"strings"
"time"
- "github.com/gosimple/slug"
"github.com/pkg/errors"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/common/log"
- "github.com/bytebase/bytebase/backend/component/activity"
"github.com/bytebase/bytebase/backend/component/config"
"github.com/bytebase/bytebase/backend/component/dbfactory"
"github.com/bytebase/bytebase/backend/component/state"
- enterprise "github.com/bytebase/bytebase/backend/enterprise/api"
api "github.com/bytebase/bytebase/backend/legacyapi"
"github.com/bytebase/bytebase/backend/plugin/db"
"github.com/bytebase/bytebase/backend/plugin/db/mysql"
- "github.com/bytebase/bytebase/backend/plugin/parser/sql/transform"
- vcsplugin "github.com/bytebase/bytebase/backend/plugin/vcs"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/store/model"
"github.com/bytebase/bytebase/backend/utils"
@@ -412,7 +406,7 @@ func setMigrationIDAndEndBinlogCoordinate(ctx context.Context, conn *sql.Conn, t
return updatedTask, nil
}
-func postMigration(ctx context.Context, stores *store.Store, activityManager *activity.Manager, license enterprise.LicenseService, task *store.TaskMessage, mi *db.MigrationInfo, migrationID string, schema string, sheetID *int) (bool, *api.TaskRunResultPayload, error) {
+func postMigration(ctx context.Context, stores *store.Store, task *store.TaskMessage, mi *db.MigrationInfo, migrationID string, sheetID *int) (bool, *api.TaskRunResultPayload, error) {
instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
if err != nil {
return true, nil, err
@@ -421,25 +415,6 @@ func postMigration(ctx context.Context, stores *store.Store, activityManager *ac
if err != nil {
return true, nil, err
}
- project, err := stores.GetProjectV2(ctx, &store.FindProjectMessage{ResourceID: &database.ProjectID})
- if err != nil {
- return true, nil, err
- }
-
- issue, err := stores.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})
- if err != nil {
- slog.Error("failed to find containing issue", log.BBError(err))
- }
- if err != nil {
- // If somehow we cannot find the issue, emit the error since it's not fatal.
- slog.Error("failed to find containing issue", log.BBError(err))
- }
- repo, err := stores.GetRepositoryV2(ctx, &store.FindRepositoryMessage{
- ProjectResourceID: &project.ResourceID,
- })
- if err != nil {
- return true, nil, errors.Errorf("failed to find linked repository for database %q", database.DatabaseName)
- }
if mi.Type == db.Migrate || mi.Type == db.MigrateSDL {
if _, err := stores.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{
@@ -451,97 +426,11 @@ func postMigration(ctx context.Context, stores *store.Store, activityManager *ac
}
}
- writebackBranch, err := isWriteBack(ctx, stores, license, project, repo, task)
- if err != nil {
- return true, nil, err
- }
-
slog.Debug("Post migration...",
slog.String("instance", instance.ResourceID),
slog.String("database", database.DatabaseName),
- slog.String("writeback_branch", writebackBranch),
)
- if writebackBranch != "" {
- // Transform the schema to standard style for SDL mode.
- if instance.Engine == storepb.Engine_MYSQL || instance.Engine == storepb.Engine_MARIADB || instance.Engine == storepb.Engine_OCEANBASE {
- standardSchema, err := transform.SchemaTransform(storepb.Engine_MYSQL, schema)
- if err != nil {
- return true, nil, errors.Wrapf(err, "failed to transform to standard schema for database %q", database.DatabaseName)
- }
- schema = standardSchema
- }
-
- latestSchemaFile := filepath.Join(repo.BaseDirectory, repo.SchemaPathTemplate)
- latestSchemaFile = strings.ReplaceAll(latestSchemaFile, "{{ENV_ID}}", mi.Environment)
- latestSchemaFile = strings.ReplaceAll(latestSchemaFile, "{{DB_NAME}}", mi.Database)
-
- vcs, err := stores.GetVCSProviderV2(ctx, repo.VCSUID)
- if err != nil {
- return true, nil, errors.Errorf("failed to sync schema file %s after applying migration %s to %q", latestSchemaFile, mi.Version.Version, database.DatabaseName)
- }
- if vcs == nil {
- return true, nil, errors.Errorf("VCS ID not found: %d", repo.VCSUID)
- }
-
- bytebaseURL := ""
- if issue != nil {
- setting, err := stores.GetWorkspaceGeneralSetting(ctx)
- if err != nil {
- return true, nil, errors.Wrapf(err, "failed to get workspace setting")
- }
-
- bytebaseURL = fmt.Sprintf("%s/issue/%s-%d?stage=%d", setting.ExternalUrl, slug.Make(issue.Title), issue.UID, task.StageID)
- }
-
- commitID, err := writeBackLatestSchema(ctx, stores, repo, vcs, nil, mi, writebackBranch, latestSchemaFile, schema, bytebaseURL)
- if err != nil {
- return true, nil, err
- }
-
- // Create file commit activity
- {
- payload, err := json.Marshal(api.ActivityPipelineTaskFileCommitPayload{
- TaskID: task.ID,
- VCSInstanceURL: vcs.InstanceURL,
- RepositoryFullPath: repo.FullPath,
- Branch: repo.BranchFilter,
- FilePath: latestSchemaFile,
- CommitID: commitID,
- })
- if err != nil {
- slog.Error("Failed to marshal file commit activity after writing back the latest schema",
- slog.Int("task_id", task.ID),
- slog.String("repository", repo.WebURL),
- slog.String("file_path", latestSchemaFile),
- log.BBError(err),
- )
- }
-
- activityCreate := &store.ActivityMessage{
- CreatorUID: task.CreatorID,
- ResourceContainer: issue.Project.GetName(),
- ContainerUID: task.PipelineID,
- Type: api.ActivityPipelineTaskFileCommit,
- Level: api.ActivityInfo,
- Comment: fmt.Sprintf("Committed the latest schema after applying migration version %s to %q.",
- mi.Version.Version,
- mi.Database,
- ),
- Payload: string(payload),
- }
-
- if _, err := activityManager.CreateActivity(ctx, activityCreate, &activity.Metadata{}); err != nil {
- slog.Error("Failed to create file commit activity after writing back the latest schema",
- slog.Int("task_id", task.ID),
- slog.String("repository", repo.WebURL),
- slog.String("file_path", latestSchemaFile),
- log.BBError(err),
- )
- }
- }
- }
-
// Set schema config.
if sheetID != nil && task.DatabaseID != nil {
sheet, err := stores.GetSheet(ctx, &store.FindSheetMessage{
@@ -597,232 +486,15 @@ func postMigration(ctx context.Context, stores *store.Store, activityManager *ac
}, nil
}
-func isWriteBack(ctx context.Context, stores *store.Store, license enterprise.LicenseService, project *store.ProjectMessage, repo *store.RepositoryMessage, task *store.TaskMessage) (string, error) {
- if task.Type != api.TaskDatabaseSchemaBaseline && task.Type != api.TaskDatabaseSchemaUpdate && task.Type != api.TaskDatabaseSchemaUpdateGhostCutover {
- return "", nil
- }
- if repo == nil || repo.SchemaPathTemplate == "" {
- return "", nil
- }
-
- instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{
- UID: &task.InstanceID,
- ShowDeleted: false,
- })
- if err != nil {
- return "", err
- }
- if instance == nil {
- return "", errors.Errorf("cannot found instance %d", task.InstanceID)
- }
- if instance.Engine == storepb.Engine_RISINGWAVE {
- return "", nil
- }
-
- if err := license.IsFeatureEnabledForInstance(api.FeatureVCSSchemaWriteBack, instance); err != nil {
- slog.Debug(err.Error(), slog.String("instance", instance.ResourceID))
- return "", nil
- }
-
- branch := ""
- // Prefer write back to the commit branch than the repo branch.
- if !strings.Contains(repo.BranchFilter, "*") {
- branch = repo.BranchFilter
- }
- if branch == "" {
- return "", nil
- }
-
- // For tenant mode project, we will only write back once and we happen to write back on lastTask done.
- if project.TenantMode == api.TenantModeTenant {
- stages, err := stores.ListStageV2(ctx, task.PipelineID)
- if err != nil {
- return "", err
- }
- if len(stages) == 0 {
- return "", nil
- }
- if stages[len(stages)-1].ID != task.StageID {
- return "", nil
- }
- tasks, err := stores.ListTasks(ctx, &api.TaskFind{PipelineID: &task.PipelineID, StageID: &task.StageID})
- if err != nil {
- return "", err
- }
- if len(tasks) == 0 {
- return "", nil
- }
- if tasks[len(tasks)-1].ID != task.ID {
- return "", nil
- }
- }
-
- return branch, nil
-}
-
-func runMigration(ctx context.Context, driverCtx context.Context, store *store.Store, dbFactory *dbfactory.DBFactory, activityManager *activity.Manager, license enterprise.LicenseService, stateCfg *state.State, profile config.Profile, task *store.TaskMessage, taskRunUID int, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int) (terminated bool, result *api.TaskRunResultPayload, err error) {
+func runMigration(ctx context.Context, driverCtx context.Context, store *store.Store, dbFactory *dbfactory.DBFactory, stateCfg *state.State, profile config.Profile, task *store.TaskMessage, taskRunUID int, migrationType db.MigrationType, statement string, schemaVersion model.Version, sheetID *int) (terminated bool, result *api.TaskRunResultPayload, err error) {
mi, err := getMigrationInfo(ctx, store, profile, task, migrationType, statement, schemaVersion)
if err != nil {
return true, nil, err
}
- migrationID, schema, err := executeMigration(ctx, driverCtx, store, dbFactory, stateCfg, profile, task, taskRunUID, statement, sheetID, mi)
+ migrationID, _, err := executeMigration(ctx, driverCtx, store, dbFactory, stateCfg, profile, task, taskRunUID, statement, sheetID, mi)
if err != nil {
return true, nil, err
}
- return postMigration(ctx, store, activityManager, license, task, mi, migrationID, schema, sheetID)
-}
-
-// Writes back the latest schema to the repository after migration.
-// Returns the commit id on success.
-func writeBackLatestSchema(
- ctx context.Context,
- storage *store.Store,
- repository *store.RepositoryMessage,
- vcs *store.VCSProviderMessage,
- pushEvent *vcsplugin.PushEvent,
- mi *db.MigrationInfo,
- writebackBranch, latestSchemaFile string, schema string, bytebaseURL string,
-) (string, error) {
- oauthContext := &common.OauthContext{
- AccessToken: vcs.AccessToken,
- }
- schemaFileMeta, err := vcsplugin.Get(vcs.Type, vcsplugin.ProviderConfig{}).ReadFileMeta(
- ctx,
- oauthContext,
- vcs.InstanceURL,
- repository.ExternalID,
- latestSchemaFile,
- vcsplugin.RefInfo{
- RefType: vcsplugin.RefTypeBranch,
- RefName: writebackBranch,
- },
- )
-
- createSchemaFile := false
- verb := "Update"
- if err != nil {
- if common.ErrorCode(err) == common.NotFound {
- createSchemaFile = true
- verb = "Create"
- } else {
- return "", errors.Wrap(err, "failed to fetch latest schema")
- }
- }
-
- var commitMessage string
- if mi.Type == db.Baseline {
- commitMessage = fmt.Sprintf("[Bytebase] establish baseline for %q", mi.Database)
- } else {
- commitTitle := fmt.Sprintf("[Bytebase] %s latest schema for %q after migration %s", verb, mi.Database, mi.Version.Version)
- commitBody := "THIS COMMIT IS AUTO-GENERATED BY BYTEBASE"
- if bytebaseURL != "" {
- commitBody += "\n\n" + bytebaseURL
- }
- if pushEvent != nil {
- commitBody += "\n\n--------Original migration change--------\n\n"
- commitBody += fmt.Sprintf("%s\n\n%s",
- pushEvent.CommitList[0].URL,
- pushEvent.CommitList[0].Message,
- )
- }
- commitMessage = fmt.Sprintf("%s\n\n%s", commitTitle, commitBody)
- }
-
- // Retrieve the latest AccessToken and RefreshToken as the previous VCS call may have
- // updated the stored token pair. VCS will fetch and store the new token pair if the
- // existing token pair has expired.
- repo2, vcs2, err := getRepositoryAndVCS(ctx, storage, repository.UID, repository.VCSUID)
- if err != nil {
- return "", err
- }
-
- schemaFileCommit := vcsplugin.FileCommitCreate{
- Branch: writebackBranch,
- CommitMessage: commitMessage,
- Content: schema,
- AuthorName: vcsplugin.BytebaseAuthorName,
- AuthorEmail: vcsplugin.BytebaseAuthorEmail,
- }
- if createSchemaFile {
- slog.Debug("Create latest schema file",
- slog.String("schema_file", latestSchemaFile),
- )
-
- err := vcsplugin.Get(vcs2.Type, vcsplugin.ProviderConfig{}).CreateFile(
- ctx,
- oauthContext,
- vcs2.InstanceURL,
- repo2.ExternalID,
- latestSchemaFile,
- schemaFileCommit,
- )
- if err != nil {
- return "", errors.Wrapf(err, "failed to create file after applying migration %s to %q", mi.Version.Version, mi.Database)
- }
- } else {
- slog.Debug("Update latest schema file",
- slog.String("schema_file", latestSchemaFile),
- )
-
- schemaFileCommit.LastCommitID = schemaFileMeta.LastCommitID
- schemaFileCommit.SHA = schemaFileMeta.SHA
- err := vcsplugin.Get(vcs2.Type, vcsplugin.ProviderConfig{}).OverwriteFile(
- ctx,
- oauthContext,
- vcs2.InstanceURL,
- repo2.ExternalID,
- latestSchemaFile,
- schemaFileCommit,
- )
- if err != nil {
- return "", errors.Wrapf(err, "failed to create file after applying migration %s to %q", mi.Version.Version, mi.Database)
- }
- }
-
- // Retrieve the latest AccessToken and RefreshToken as the previous VCS call may have
- // updated the stored token pair. VCS will fetch and store the new token pair if the
- // existing token pair has expired.
- repo2, vcs2, err = getRepositoryAndVCS(ctx, storage, repository.UID, repository.VCSUID)
- if err != nil {
- return "", err
- }
-
- // VCS such as GitLab API doesn't return the commit on write, so we have to call ReadFileMeta again
- schemaFileMeta, err = vcsplugin.Get(vcs2.Type, vcsplugin.ProviderConfig{}).ReadFileMeta(
- ctx,
- oauthContext,
- vcs2.InstanceURL,
- repo2.ExternalID,
- latestSchemaFile,
- vcsplugin.RefInfo{
- RefType: vcsplugin.RefTypeBranch,
- RefName: writebackBranch,
- },
- )
-
- if err != nil {
- return "", errors.Wrapf(err, "failed to fetch latest schema file %s after update", latestSchemaFile)
- }
- return schemaFileMeta.LastCommitID, nil
-}
-
-func getRepositoryAndVCS(ctx context.Context, storage *store.Store, repoUID, vcsUID int) (*store.RepositoryMessage, *store.VCSProviderMessage, error) {
- repo, err := storage.GetRepositoryV2(ctx, &store.FindRepositoryMessage{
- UID: &repoUID,
- })
- if err != nil {
- return nil, nil, errors.Wrap(err, "failed to fetch repository after schema write-back")
- }
- if repo == nil {
- return nil, nil, errors.Errorf("repository not found after schema write-back: %v", repoUID)
- }
- vcs, err := storage.GetVCSProviderV2(ctx, vcsUID)
- if err != nil {
- return nil, nil, errors.Wrap(err, "failed to fetch vcs for schema write-back")
- }
- if vcs == nil {
- return nil, nil, errors.Errorf("vcs not found for schema write-back: %v", vcsUID)
- }
- return repo, vcs, nil
+ return postMigration(ctx, store, task, mi, migrationID, sheetID)
}
diff --git a/backend/runner/taskrun/schema_baseline_executor.go b/backend/runner/taskrun/schema_baseline_executor.go
index 4146647257..38a76ef877 100644
--- a/backend/runner/taskrun/schema_baseline_executor.go
+++ b/backend/runner/taskrun/schema_baseline_executor.go
@@ -69,7 +69,7 @@ func (exec *SchemaBaselineExecutor) RunOnce(ctx context.Context, driverCtx conte
}
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.activityManager, exec.license, exec.stateCfg, exec.profile, task, taskRunUID, db.Baseline, "" /* statement */, version, nil /* sheetID */)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Baseline, "" /* statement */, version, nil /* sheetID */)
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
slog.Error("failed to sync database schema",
slog.String("instanceName", instance.ResourceID),
diff --git a/backend/runner/taskrun/schema_update_executor.go b/backend/runner/taskrun/schema_update_executor.go
index 8b39795113..b2f21cd6bc 100644
--- a/backend/runner/taskrun/schema_update_executor.go
+++ b/backend/runner/taskrun/schema_update_executor.go
@@ -74,7 +74,7 @@ func (exec *SchemaUpdateExecutor) RunOnce(ctx context.Context, driverCtx context
}
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.activityManager, exec.license, exec.stateCfg, exec.profile, task, taskRunUID, db.Migrate, statement, version, &payload.SheetID)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.Migrate, statement, version, &payload.SheetID)
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
slog.Error("failed to sync database schema",
slog.String("instanceName", instance.ResourceID),
diff --git a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
index f9277843c0..c4e2aad786 100644
--- a/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
+++ b/backend/runner/taskrun/schema_update_ghost_cutover_executor.go
@@ -111,7 +111,7 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskCont
// not using the rendered statement here because we want to avoid leaking the rendered statement
version := model.Version{Version: payload.SchemaVersion}
- terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.activityManager, e.stateCfg, e.license, e.profile, task, taskRunUID, statement, payload.SheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)
+ terminated, result, err := cutover(ctx, taskContext, e.store, e.dbFactory, e.stateCfg, e.profile, task, taskRunUID, statement, payload.SheetID, version, postponeFilename, sharedGhost.migrationContext, sharedGhost.errCh)
if err := e.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
slog.Error("failed to sync database schema",
slog.String("instanceName", instance.ResourceID),
@@ -123,7 +123,7 @@ func (e *SchemaUpdateGhostCutoverExecutor) RunOnce(ctx context.Context, taskCont
return terminated, result, err
}
-func cutover(ctx context.Context, taskContext context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, activityManager *activity.Manager, stateCfg *state.State, license enterprise.LicenseService, profile config.Profile, task *store.TaskMessage, taskRunUID int, statement string, sheetID int, schemaVersion model.Version, postponeFilename string, migrationContext *base.MigrationContext, errCh <-chan error) (terminated bool, result *api.TaskRunResultPayload, err error) {
+func cutover(ctx context.Context, taskContext context.Context, stores *store.Store, dbFactory *dbfactory.DBFactory, stateCfg *state.State, profile config.Profile, task *store.TaskMessage, taskRunUID int, statement string, sheetID int, schemaVersion model.Version, postponeFilename string, migrationContext *base.MigrationContext, errCh <-chan error) (terminated bool, result *api.TaskRunResultPayload, err error) {
statement = strings.TrimSpace(statement)
instance, err := stores.GetInstanceV2(ctx, &store.FindInstanceMessage{UID: &task.InstanceID})
if err != nil {
@@ -161,12 +161,12 @@ func cutover(ctx context.Context, taskContext context.Context, stores *store.Sto
return true, nil, err
}
defer driver.Close(ctx)
- migrationID, schema, err := utils.ExecuteMigrationWithFunc(ctx, ctx, stores, stateCfg, taskRunUID, driver, mi, statement, &sheetID, execFunc)
+ migrationID, _, err := utils.ExecuteMigrationWithFunc(ctx, ctx, stores, stateCfg, taskRunUID, driver, mi, statement, &sheetID, execFunc)
if err != nil {
return true, nil, err
}
- return postMigration(ctx, stores, activityManager, license, task, mi, migrationID, schema, &sheetID)
+ return postMigration(ctx, stores, task, mi, migrationID, &sheetID)
}
func waitForCutover(ctx context.Context, taskContext context.Context, migrationContext *base.MigrationContext) bool {
diff --git a/backend/runner/taskrun/schema_update_sdl_executor.go b/backend/runner/taskrun/schema_update_sdl_executor.go
index d24077d1af..e1d60c95f3 100644
--- a/backend/runner/taskrun/schema_update_sdl_executor.go
+++ b/backend/runner/taskrun/schema_update_sdl_executor.go
@@ -84,7 +84,7 @@ func (exec *SchemaUpdateSDLExecutor) RunOnce(ctx context.Context, driverCtx cont
if err != nil {
return true, nil, errors.Wrap(err, "invalid database schema diff")
}
- terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.activityManager, exec.license, exec.stateCfg, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &payload.SheetID)
+ terminated, result, err := runMigration(ctx, driverCtx, exec.store, exec.dbFactory, exec.stateCfg, exec.profile, task, taskRunUID, db.MigrateSDL, ddl, version, &payload.SheetID)
if err := exec.schemaSyncer.SyncDatabaseSchema(ctx, database, true /* force */); err != nil {
slog.Error("failed to sync database schema",
diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.go
index 14ae5fcf1a..a2eb2fc1f5 100644
--- a/backend/tests/schema_update_test.go
+++ b/backend/tests/schema_update_test.go
@@ -471,11 +471,6 @@ func TestSimpleVCS(t *testing.T) {
// Create an issue that updates database schema.
err = ctl.changeDatabase(ctx, ctl.project, database, sheet, v1pb.Plan_ChangeDatabaseConfig_MIGRATE)
a.NoError(err)
- latestFileName := fmt.Sprintf("%s/%s/.%s##LATEST.sql", baseDirectory, "prod", databaseName)
- files, err := ctl.vcsProvider.GetFiles(test.externalID, latestFileName)
- a.NoError(err)
- a.Len(files, 1)
- a.Equal(dumpedSchema4, files[latestFileName])
// Get migration history.
resp, err := ctl.databaseServiceClient.ListChangeHistories(ctx, &v1pb.ListChangeHistoriesRequest{
diff --git a/frontend/src/components/RepositoryForm.vue b/frontend/src/components/RepositoryForm.vue
index fc935ee275..7ae1e0b57c 100644
--- a/frontend/src/components/RepositoryForm.vue
+++ b/frontend/src/components/RepositoryForm.vue
@@ -146,101 +146,6 @@
}}
</div>
</div>
- <div>
- <div class="textlabel flex gap-x-1">
- {{ $t("repository.schema-path-template") }}
- <span v-if="isProjectSchemaChangeTypeSDL" class="text-red-600">*</span>
- <FeatureBadge feature="bb.feature.vcs-schema-write-back" />
- </div>
- <div class="mt-1 textinfolabel space-x-1">
- <span v-if="isProjectSchemaChangeTypeSDL">
- {{ $t("project.settings.schema-path-template-sdl-description") }}
- </span>
- <template v-else>
- <span>{{ $t("repository.schema-writeback-description") }}</span>
- <span class="font-medium text-main">
- {{ $t("repository.schema-writeback-protected-branch") }}
- </span>
- </template>
- <span v-if="!hasFeature('bb.feature.vcs-schema-write-back')">
- {{
- $t(
- subscriptionStore.getFeatureRequiredPlanString(
- "bb.feature.vcs-schema-write-back"
- )
- )
- }}
- </span>
- <LearnMoreLink
- url="https://www.bytebase.com/docs/vcs-integration/name-and-organize-schema-files?source=console#schema-path-template"
- class="ml-1"
- />
- </div>
- <BBAttention
- v-if="
- instanceWithoutLicense.length > 0 &&
- hasFeature('bb.feature.vcs-schema-write-back')
- "
- class="my-4"
- type="warning"
- :title="
- $t('subscription.features.bb-feature-vcs-schema-write-back.title')
- "
- :description="
- $t('subscription.instance-assignment.missing-license-for-instances', {
- count: instanceWithoutLicense.length,
- name: instanceWithoutLicense.map((ins) => ins.title).join(','),
- })
- "
- :action-text="$t('subscription.instance-assignment.assign-license')"
- @click="state.showInstanceAssignmentDrawer = true"
- />
- <BBTextField
- v-if="hasFeature('bb.feature.vcs-schema-write-back')"
- id="schemapathtemplate"
- v-model:value="repositoryConfig.schemaPathTemplate"
- name="schemapathtemplate"
- class="mt-2 w-full"
- :disabled="!allowEdit"
- />
- <BBTextField
- v-else-if="isProjectSchemaChangeTypeSDL"
- id="schemapathtemplate"
- v-model:value="repositoryConfig.schemaPathTemplate"
- name="schemapathtemplate"
- class="mt-2 w-full"
- :disabled="!allowEdit"
- />
- <BBTextField
- v-else-if="isProjectSchemaChangeTypeDDL"
- class="mt-2 w-full"
- :value="
- subscriptionStore.getRquiredPlanString(
- 'bb.feature.vcs-schema-write-back'
- )
- "
- :disabled="true"
- />
- <div v-if="schemaTagPlaceholder" class="mt-2 textinfolabel">
- <span class="text-red-600">*</span>
- <span v-if="isProjectSchemaChangeTypeDDL" class="ml-1">
- {{ $t("repository.if-specified") }},
- </span>
- <span class="ml-1">{{ schemaTagPlaceholder }}</span>
- </div>
- <div
- v-if="repositoryConfig.schemaPathTemplate"
- class="mt-2 textinfolabel"
- >
- • {{ $t("repository.schema-path-example") }}:
- {{
- sampleSchemaPath(
- repositoryConfig.baseDirectory,
- repositoryConfig.schemaPathTemplate
- )
- }}
- </div>
- </div>
<div v-if="canEnableSQLReview">
<div class="textlabel flex gap-x-1">
{{ $t("repository.sql-review-ci") }}
@@ -253,10 +158,7 @@
vcsType === VCSProvider_Type.GITLAB
? $t("repository.merge-request")
: $t("repository.pull-request"),
- pathTemplate:
- schemaChangeType == SchemaChange.DDL
- ? $t("repository.file-path-template")
- : $t("repository.schema-path-template"),
+ pathTemplate: $t("repository.file-path-template"),
})
}}
</div>
@@ -329,7 +231,6 @@ import { VCSProvider_Type } from "@/types/proto/v1/vcs_provider_service";
import { hasWorkspacePermissionV2, supportSQLReviewCI } from "@/utils";
const FILE_REQUIRED_PLACEHOLDER = "{{DB_NAME}}, {{VERSION}}, {{TYPE}}";
-const SCHEMA_REQUIRED_PLACEHOLDER = "{{DB_NAME}}";
const FILE_OPTIONAL_DIRECTORY_WILDCARD = "*, **";
const SINGLE_ASTERISK_REGEX = /\/\*\//g;
const DOUBLE_ASTERISKS_REGEX = /\/\*\*\//g;
@@ -393,9 +294,6 @@ const isTenantProject = computed(() => {
const isProjectSchemaChangeTypeDDL = computed(() => {
return (props.schemaChangeType || SchemaChange.DDL) === SchemaChange.DDL;
});
-const isProjectSchemaChangeTypeSDL = computed(() => {
- return (props.schemaChangeType || SchemaChange.DDL) === SchemaChange.SDL;
-});
const canEnableSQLReview = computed(() => {
return supportSQLReviewCI(props.vcsType);
});
@@ -458,36 +356,6 @@ const sampleFilePath = (
return result;
};
-const sampleSchemaPath = (
- baseDirectory: string,
- schemaPathTemplate: string
-): string => {
- type Item = {
- placeholder: string;
- sampleText: string;
- };
- const placeholderList: Item[] = [
- {
- placeholder: "{{DB_NAME}}",
- sampleText: "db1",
- },
- {
- placeholder: "{{ENV_ID}}",
- sampleText: "env1",
- },
- {
- placeholder: "{{ENV_NAME}}", // for legacy support
- sampleText: "env1",
- },
- ];
- let result = `${baseDirectory}/${schemaPathTemplate}`;
- for (const item of placeholderList) {
- const re = new RegExp(item.placeholder, "g");
- result = result.replace(re, item.sampleText);
- }
- return result;
-};
-
const getWebhookLink = computed(() => {
if (props.vcsType === VCSProvider_Type.AZURE_DEVOPS) {
const parts = props.repositoryInfo.externalId.split("/");
@@ -508,37 +376,6 @@ const fileOptionalPlaceholder = computed(() => {
return tags;
});
-const schemaRequiredTagPlaceholder = computed(() => {
- const tags = [] as string[];
- // Only allows {{DB_NAME}} to be an optional placeholder for non-tenant mode projects
- if (!isTenantProject.value) tags.push(SCHEMA_REQUIRED_PLACEHOLDER);
- return tags;
-});
-
-const schemaOptionalTagPlaceholder = computed(() => {
- const tags = [] as string[];
- // Only allows {{ENV_ID}} to be an optional placeholder for non-tenant mode projects
- if (!isTenantProject.value) tags.push("{{ENV_ID}}");
- return tags;
-});
-
-const schemaTagPlaceholder = computed(() => {
- const placeholders: string[] = [];
- const required = schemaRequiredTagPlaceholder.value;
- const optional = schemaOptionalTagPlaceholder.value;
- if (required.length > 0) {
- placeholders.push(
- `${t("common.required-placeholder")}: ${required.join(", ")}`
- );
- }
- if (optional.length > 0) {
- placeholders.push(
- `${t("common.optional-placeholder")}: ${optional.join(", ")}`
- );
- }
- return placeholders.join("; ");
-});
-
const onSQLReviewCIToggle = (on: boolean) => {
if (on && !hasFeature("bb.feature.vcs-sql-review")) {
state.showFeatureModal = true;
diff --git a/frontend/src/components/RepositoryPanel.vue b/frontend/src/components/RepositoryPanel.vue
index a353fb2104..cd462250c6 100644
--- a/frontend/src/components/RepositoryPanel.vue
+++ b/frontend/src/components/RepositoryPanel.vue
@@ -326,7 +326,6 @@ const state = reactive<LocalState>({
branchFilter: props.repository.branchFilter,
filePathTemplate: props.repository.filePathTemplate,
schemaPathTemplate: props.repository.schemaPathTemplate,
- sheetPathTemplate: props.repository.sheetPathTemplate,
enableSQLReviewCI: props.repository.enableSqlReviewCi,
},
schemaChangeType: props.project.schemaChange,
@@ -348,7 +347,6 @@ watch(
branchFilter: cur.branchFilter,
filePathTemplate: cur.filePathTemplate,
schemaPathTemplate: cur.schemaPathTemplate,
- sheetPathTemplate: cur.sheetPathTemplate,
enableSQLReviewCI: cur.enableSqlReviewCi,
};
}
@@ -398,8 +396,6 @@ const allowUpdate = computed(() => {
state.repositoryConfig.filePathTemplate ||
props.repository.schemaPathTemplate !==
state.repositoryConfig.schemaPathTemplate ||
- props.repository.sheetPathTemplate !==
- state.repositoryConfig.sheetPathTemplate ||
props.repository.enableSqlReviewCi !==
state.repositoryConfig.enableSQLReviewCI ||
props.project.schemaChange !== state.schemaChangeType)
@@ -502,13 +498,6 @@ const doUpdate = async () => {
repositoryPatch.schemaPathTemplate =
state.repositoryConfig.schemaPathTemplate;
}
- if (
- props.repository.sheetPathTemplate !=
- state.repositoryConfig.sheetPathTemplate
- ) {
- repositoryPatch.sheetPathTemplate =
- state.repositoryConfig.sheetPathTemplate;
- }
if (
props.repository.enableSqlReviewCi !=
state.repositoryConfig.enableSQLReviewCI
diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vue
index 72bfe4ea55..14cfd0626b 100644
--- a/frontend/src/components/RepositorySetupWizard.vue
+++ b/frontend/src/components/RepositorySetupWizard.vue
@@ -155,15 +155,11 @@ const DEFAULT_FILE_PATH_TEMPLATE =
"{{ENV_ID}}/{{DB_NAME}}##{{VERSION}}##{{TYPE}}##{{DESCRIPTION}}.sql";
// Default schema path template is co-locate with the corresponding db's migration files and use .(dot) to appear the first.
const DEFAULT_SCHEMA_PATH_TEMPLATE = "{{ENV_ID}}/.{{DB_NAME}}##LATEST.sql";
-// Default sheet path template is to organize script files for SQL Editor.
-const DEFAULT_SHEET_PATH_TEMPLATE =
- "script/{{ENV_ID}}##{{DB_NAME}}##{{NAME}}.sql";
// For tenant mode projects, {{ENV_ID}} and {{DB_NAME}} is not supported.
const DEFAULT_TENANT_MODE_FILE_PATH_TEMPLATE =
"{{VERSION}}##{{TYPE}}##{{DESCRIPTION}}.sql";
const DEFAULT_TENANT_MODE_SCHEMA_PATH_TEMPLATE = ".LATEST.sql";
-const DEFAULT_TENANT_MODE_SHEET_PATH_TEMPLATE = "script/{{NAME}}.sql";
const CHOOSE_PROVIDER_STEP = 0;
// const CHOOSE_REPOSITORY_STEP = 1;
@@ -232,9 +228,6 @@ const state = reactive<LocalState>({
schemaPathTemplate: isTenantProject.value
? DEFAULT_TENANT_MODE_SCHEMA_PATH_TEMPLATE
: DEFAULT_SCHEMA_PATH_TEMPLATE,
- sheetPathTemplate: isTenantProject.value
- ? DEFAULT_TENANT_MODE_SHEET_PATH_TEMPLATE
- : DEFAULT_SHEET_PATH_TEMPLATE,
enableSQLReviewCI: false,
},
schemaChangeType: props.project.schemaChange,
@@ -317,7 +310,6 @@ const tryFinishSetup = async () => {
baseDirectory: state.config.repositoryConfig.baseDirectory,
filePathTemplate: state.config.repositoryConfig.filePathTemplate,
schemaPathTemplate: state.config.repositoryConfig.schemaPathTemplate,
- sheetPathTemplate: state.config.repositoryConfig.sheetPathTemplate,
externalId: externalId,
enableSqlReviewCi: false,
};
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 1773d27ba5..309d78cef3 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -1790,13 +1790,7 @@
"file-path-template-description": "Bytebase only observes the file path name matching the template pattern relative to the base directory.",
"file-path-example-schema-migration": "File path example for schema migration type",
"file-path-example-data-migration": "File path example for data migration type",
- "schema-path-template": "Schema path template",
- "schema-writeback-description": "When specified, after each migration, Bytebase will write the latest schema to the schema path relative to the base directory in the same branch as the original commit triggering the migration. Leave empty if you don't want Bytebase to do this.",
- "schema-writeback-protected-branch": "Make sure the changed branch is not protected or allow repository maintainer to push to that protected branch.",
"if-specified": "If specified",
- "schema-path-example": "Schema path example",
- "sheet-path-template": "Sheet path template",
- "sheet-path-template-description": "Bytebase only observes files with pathnames matching the template pattern relative to the base directory. The matched files will be synchronized to the SQL Editor for usage there.",
"sql-review-ci": "SQL Review CI",
"sql-review-ci-enable": "Enable SQL Review CI",
"sql-review-ci-enable-gitlab": "Enable SQL Review CI via GitLab CI",
@@ -2561,14 +2555,6 @@
"title": "Custom approval",
"desc": "Configure risk level and approval flow for different tasks."
},
- "bb-feature-vcs-schema-write-back": {
- "title": "Schema write-back",
- "desc": "After a successful schema change, schema write-back enables Bytebase to write back the latest full schema snapshot to your VCS repository."
- },
- "bb-feature-vcs-sheet-sync": {
- "title": "Synchronize SQL scripts from VCS",
- "desc": "Synchronize SQL scripts stored in VCS to Sheet."
- },
"bb-feature-vcs-sql-review": {
"title": "SQL Review in GitOps workflow",
"desc": "Add the SQL Review CI to your VCS repository pipeline. SQL Review will be triggered in the pull request for changed SQL files."
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index c11069d9b1..b9cce23dda 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -1789,13 +1789,7 @@
"file-path-template-description": "Bytebase solo observa la ruta del archivo que coincida con el patrón de plantilla en relación al directorio base.",
"file-path-example-schema-migration": "Ejemplo de ruta de archivo para el tipo de migración de esquema",
"file-path-example-data-migration": "Ejemplo de ruta de archivo para el tipo de migración de datos",
- "schema-path-template": "Plantilla de ruta de esquema",
- "schema-writeback-description": "Cuando se especifica, después de cada migración, Bytebase escribirá el último esquema en la ruta de esquema en relación al directorio base en la misma rama que el commit original que activó la migración. Deje en blanco si no desea que Bytebase haga esto.",
- "schema-writeback-protected-branch": "Asegúrese de que la rama modificada no esté protegida o permita que el mantenedor del repositorio haga push a esa rama protegida.",
"if-specified": "Si se especifica",
- "schema-path-example": "Ejemplo de ruta de esquema",
- "sheet-path-template": "Plantilla de ruta de hoja",
- "sheet-path-template-description": "Bytebase solo observa archivos con nombres de ruta que coincidan con el patrón de plantilla en relación al directorio base. Los archivos coincidentes se sincronizarán con el editor de SQL para su uso allí.",
"sql-review-ci": "Revisión de SQL CI",
"sql-review-ci-enable": "Habilitar la revisión de SQL CI",
"sql-review-ci-enable-gitlab": "Habilitar la revisión de SQL CI a través de GitLab CI",
@@ -2561,14 +2555,6 @@
"title": "Aprobación personalizada",
"desc": "Configure el nivel de riesgo y el flujo de aprobación para diferentes tareas."
},
- "bb-feature-vcs-schema-write-back": {
- "title": "Escritura de esquema",
- "desc": "Después de un cambio de esquema exitoso, la escritura de esquema permite a Bytebase escribir de nuevo la última instantánea completa del esquema en su repositorio de VCS."
- },
- "bb-feature-vcs-sheet-sync": {
- "title": "Sincronizar scripts SQL desde VCS",
- "desc": "Sincronice los scripts SQL almacenados en VCS en la hoja de cálculo."
- },
"bb-feature-vcs-sql-review": {
"title": "Revisión de SQL en el flujo de trabajo de GitOps",
"desc": "Agregue la integración de revisión de SQL a la tubería del repositorio de VCS. La revisión de SQL se activará en la solicitud de extracción para los archivos SQL modificados."
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index 1ea7777a42..923de091c6 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -1790,13 +1790,7 @@
"file-path-template-description": "Bytebaseは、ベースディレクトリに対して相対的なテンプレートパターンに一致するファイルパス名のみを監視します。",
"file-path-example-schema-migration": "スキーママイグレーションタイプのファイルパスの例",
"file-path-example-data-migration": "データマイグレーションタイプのファイルパスの例",
- "schema-path-template": "スキーマパスのテンプレート",
- "schema-writeback-description": "指定された場合、各マイグレーションの後、Bytebaseは元のコミットがトリガーとなったブランチ内のベースディレクトリに対するスキーマパスに最新のスキーマを書き込みます。これを行いたくない場合は空にしてください。",
- "schema-writeback-protected-branch": "変更されたブランチが保護されていないことを確認するか、リポジトリのメンテナがその保護されたブランチにプッシュできるようにします。",
"if-specified": "指定された場合",
- "schema-path-example": "スキーマパスの例",
- "sheet-path-template": "シートパスのテンプレート",
- "sheet-path-template-description": "Bytebaseは、ベースディレクトリに対して相対的なテンプレートパターンに一致するパス名を持つファイルのみを監視します。一致したファイルはSQLエディタに同期され、そこで使用されます。",
"sql-review-ci": "SQLレビューCI",
"sql-review-ci-enable": "SQLレビューCIを有効にする",
"sql-review-ci-enable-gitlab": "GitLab CIを介してSQLレビューCIを有効にする",
@@ -2561,14 +2555,6 @@
"title": "カスタム承認",
"desc": "さまざまなタスクに対してリスクレベルと承認フローを設定します。"
},
- "bb-feature-vcs-schema-write-back": {
- "title": "スキーマの書き戻し",
- "desc": "スキーマの変更が成功した後、スキーマの書き戻しにより、Bytebaseは最新の完全なスキーマスナップショットをVCSリポジトリに書き戻すことができます。"
- },
- "bb-feature-vcs-sheet-sync": {
- "title": "VCSからSQLスクリプトを同期する",
- "desc": "VCSに保存されているSQLスクリプトをシートに同期します。"
- },
"bb-feature-vcs-sql-review": {
"title": "GitOpsワークフローでのSQLレビュー",
"desc": "SQLレビューCIをVCSリポジトリのパイプラインに追加します。変更されたSQLファイルのプルリクエストでSQLレビューがトリガーされます。"
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index ab2ae557f2..c0b15598b4 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -1790,13 +1790,7 @@
"file-path-template-description": "Bytebase chỉ quan sát tên đường dẫn tệp khớp với mẫu mẫu liên quan đến thư mục cơ sở.",
"file-path-example-schema-migration": "Ví dụ về đường dẫn tệp cho kiểu di chuyển lược đồ",
"file-path-example-data-migration": "Ví dụ về đường dẫn tệp cho loại di chuyển dữ liệu",
- "schema-path-template": "Mẫu đường dẫn lược đồ",
- "schema-writeback-description": "Khi được chỉ định, sau mỗi lần di chuyển, Bytebase sẽ ghi lược đồ mới nhất vào đường dẫn lược đồ tương ứng với thư mục cơ sở trong cùng nhánh với cam kết ban đầu kích hoạt quá trình di chuyển. Để trống nếu bạn không muốn Bytebase thực hiện việc này.",
- "schema-writeback-protected-branch": "Đảm bảo nhánh đã thay đổi không được bảo vệ hoặc cho phép người bảo trì kho lưu trữ đẩy tới nhánh được bảo vệ đó.",
"if-specified": "Nếu được chỉ định",
- "schema-path-example": "Ví dụ về đường dẫn lược đồ",
- "sheet-path-template": "Mẫu đường dẫn trang tính",
- "sheet-path-template-description": "Bytebase chỉ quan sát các tệp có tên đường dẫn khớp với mẫu mẫu liên quan đến thư mục cơ sở. Các tệp phù hợp sẽ được đồng bộ hóa với SQL Editor để sử dụng ở đó.",
"sql-review-ci": "CI đánh giá SQL",
"sql-review-ci-enable": "Bật CI đánh giá SQL",
"sql-review-ci-enable-gitlab": "Kích hoạt CI đánh giá SQL thông qua GitLab CI",
@@ -2561,14 +2555,6 @@
"title": "Phê duyệt tùy chỉnh",
"desc": "Định cấu hình mức độ rủi ro và luồng phê duyệt cho các nhiệm vụ khác nhau."
},
- "bb-feature-vcs-schema-write-back": {
- "title": "Viết lại lược đồ",
- "desc": "Sau khi thay đổi lược đồ thành công, việc ghi lại lược đồ cho phép Bytebase ghi lại ảnh chụp nhanh lược đồ đầy đủ mới nhất vào kho lưu trữ VCS của bạn."
- },
- "bb-feature-vcs-sheet-sync": {
- "title": "Đồng bộ hóa tập lệnh SQL từ VCS",
- "desc": "Đồng bộ hóa các tập lệnh SQL được lưu trữ trong VCS sang Trang tính."
- },
"bb-feature-vcs-sql-review": {
"title": "Đánh giá SQL trong quy trình làm việc GitOps",
"desc": "Thêm CI đánh giá SQL vào quy trình kho lưu trữ VCS của bạn. Đánh giá SQL sẽ được kích hoạt trong yêu cầu kéo đối với các tệp SQL đã thay đổi."
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 90180fefb4..2ce4c8ae2a 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -1789,13 +1789,7 @@
"file-path-template-description": "Bytebase 仅会跟踪那些文件路径匹配模版 (相对于指定根目录)的文件。",
"file-path-example-schema-migration": "针对 schema 变更类型的文件路径样例",
"file-path-example-data-migration": "针对数据变更类型的文件路径样例",
- "schema-path-template": "Schema 路径模版",
- "schema-writeback-description": "如果指定,在每一次变更之后,Bytebase 将把最新的 Schema 回写到本来触发变更的提交分支,回写的具体路径则是相对于前面指定的根目录。如果您不希望 Bytebase 这样做,则置为空。",
- "schema-writeback-protected-branch": "请保证被变更的分支不是处于保护 (protected) 状态,或者仓库允许他的 maintainer 可以推送变更到保护分支。",
"if-specified": "如果指定",
- "schema-path-example": "Schema 路径样例",
- "sheet-path-template": "工作表路径模板",
- "sheet-path-template-description": "Bytebase 仅跟踪文件路径匹配模版 (相对于指定根目录)的文件。匹配的文件将被同步到 SQL Editor 以供使用。",
"sql-review-ci": "SQL 审核 CI",
"sql-review-ci-enable": "开启 SQL 审核 CI",
"sql-review-ci-enable-gitlab": "基于 GitLab CI 开启 SQL 审核",
@@ -2560,14 +2554,6 @@
"title": "自定义审批",
"desc": "为不同的任务配置风险等级和自定义审批流。"
},
- "bb-feature-vcs-schema-write-back": {
- "title": "Schema 回写",
- "desc": "当一个 Schema 变更完成后,可以将最新的 Schema 快照回写到 VCS。"
- },
- "bb-feature-vcs-sheet-sync": {
- "title": "从 VCS 同步 SQL 脚本",
- "desc": "将保存在 VCS 中的 SQL 脚本同步到 Sheet 中。"
- },
"bb-feature-vcs-sql-review": {
"title": "GitOps 工作流中的 SQL 审核",
"desc": "在您的 VCS 仓库流水线上添加 SQL 审核 CI,以便在拉取请求中对变动的 SQL 文件进行自动审核。"
diff --git a/frontend/src/store/modules/v1/repository.ts b/frontend/src/store/modules/v1/repository.ts
index 2c6471f986..be82f1a004 100644
--- a/frontend/src/store/modules/v1/repository.ts
+++ b/frontend/src/store/modules/v1/repository.ts
@@ -159,12 +159,6 @@ const getUpdateMaskForRepository = (
) {
updateMask.push("schema_path_template");
}
- if (
- !isUndefined(update.sheetPathTemplate) &&
- !isEqual(origin.sheetPathTemplate, update.sheetPathTemplate)
- ) {
- updateMask.push("sheet_path_template");
- }
if (
!isUndefined(update.enableSqlReviewCi) &&
!isEqual(origin.enableSqlReviewCi, update.enableSqlReviewCi)
diff --git a/frontend/src/types/plan.ts b/frontend/src/types/plan.ts
index bc489ffdf2..2a4ffc37dd 100644
--- a/frontend/src/types/plan.ts
+++ b/frontend/src/types/plan.ts
@@ -36,8 +36,6 @@ export type FeatureType =
| "bb.feature.database-grouping"
| "bb.feature.schema-template"
// VCS Integration
- | "bb.feature.vcs-schema-write-back"
- | "bb.feature.vcs-sheet-sync"
| "bb.feature.vcs-sql-review"
// Database management
| "bb.feature.pitr"
@@ -85,7 +83,6 @@ export const instanceLimitFeature = new Set<FeatureType>([
// VCS Integration
"bb.feature.vcs-sql-review",
"bb.feature.mybatis-sql-review",
- "bb.feature.vcs-schema-write-back",
]);
export const planTypeToString = (planType: PlanType): string => {
diff --git a/frontend/src/types/repository.ts b/frontend/src/types/repository.ts
index fda06b55e8..c892f414e8 100644
--- a/frontend/src/types/repository.ts
+++ b/frontend/src/types/repository.ts
@@ -3,7 +3,6 @@ export type RepositoryConfig = {
branchFilter: string;
filePathTemplate: string;
schemaPathTemplate: string;
- sheetPathTemplate: string;
enableSQLReviewCI: boolean;
};