Skip to content

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

chore: strict filename format (#11456)

Danny Xubaa4b8ef0ddf
diff --git a/backend/api/gitops/common.go b/backend/api/gitops/common.go
index c5371a872c..942175ee78 100644
--- a/backend/api/gitops/common.go
+++ b/backend/api/gitops/common.go
@@ -64,7 +64,7 @@ func getFileChange(path string) (*fileChange, error) {
}
version := matches[0]
description := strings.TrimPrefix(filename, version)
- description = strings.TrimLeft(description, "_-#")
+ description = strings.TrimLeft(description, "_")
changeType := v1pb.Plan_ChangeDatabaseConfig_MIGRATE
switch {
case strings.HasPrefix(description, "ddl"):
@@ -77,7 +77,7 @@ func getFileChange(path string) (*fileChange, error) {
description = strings.TrimPrefix(description, "ghost")
changeType = v1pb.Plan_ChangeDatabaseConfig_MIGRATE_GHOST
}
- description = strings.TrimLeft(description, "_-#")
+ description = strings.TrimLeft(description, "_")
return &fileChange{
path: path,
version: version,
diff --git a/backend/tests/vcs_test.go b/backend/tests/vcs_test.go
index 3bb2a842df..92637adb9a 100644
--- a/backend/tests/vcs_test.go
+++ b/backend/tests/vcs_test.go
@@ -21,8 +21,8 @@ import (
func TestVCS(t *testing.T) {
branchName := "feature/foo"
pullRequestFiles := []*vcs.PullRequestFile{
- {Path: "bbtest/0001##migrate##😊create_table_book1.sql"},
- {Path: "bbtest/0002##migrate##新建create_table_book2.sql"},
+ {Path: "bbtest/0001_😊create_table_book1.sql"},
+ {Path: "bbtest/0002_新建create_table_book2.sql"},
}
fileContentMap := map[string]string{
pullRequestFiles[0].Path: migrationStatement1,