Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: use environment resource ID for writeback file name (#4960)
Danny Xufed7a848718c
diff --git a/backend/runner/taskrun/database_create_executor.go b/backend/runner/taskrun/database_create_executor.goindex 3074530df0..690c54526d 100644--- a/backend/runner/taskrun/database_create_executor.go+++ b/backend/runner/taskrun/database_create_executor.go@@ -124,7 +124,7 @@ func (exec *DatabaseCreateExecutor) RunOnce(ctx context.Context, task *store.TasVersion: schemaVersion,Namespace: payload.DatabaseName,Database: payload.DatabaseName,- Environment: environment.Title,+ Environment: environment.ResourceID,Source: db.UI,Type: db.Migrate,Description: "Create database",diff --git a/backend/runner/taskrun/executor.go b/backend/runner/taskrun/executor.goindex 03d445e67d..11f77d7cb3 100644--- a/backend/runner/taskrun/executor.go+++ b/backend/runner/taskrun/executor.go@@ -82,7 +82,7 @@ func preMigration(ctx context.Context, stores *store.Store, profile config.Profi// TODO(d): support semantic versioning.Version: schemaVersion,Description: task.Name,- Environment: environment.Title,+ Environment: environment.ResourceID,}issue, err := stores.GetIssueV2(ctx, &store.FindIssueMessage{PipelineID: &task.PipelineID})diff --git a/backend/runner/taskrun/pitr_cutover_executor.go b/backend/runner/taskrun/pitr_cutover_executor.goindex 94cd819780..014e77ef37 100644--- a/backend/runner/taskrun/pitr_cutover_executor.go+++ b/backend/runner/taskrun/pitr_cutover_executor.go@@ -142,7 +142,7 @@ func (exec *PITRCutoverExecutor) pitrCutover(ctx context.Context, dbFactory *dbfVersion: common.DefaultMigrationVersion(),Namespace: database.DatabaseName,Database: database.DatabaseName,- Environment: environment.Title,+ Environment: environment.ResourceID,Source: db.MigrationSource(project.Workflow),Type: db.Branch,Status: db.Done,diff --git a/backend/runner/taskrun/pitr_restore_executor.go b/backend/runner/taskrun/pitr_restore_executor.goindex bdb4484236..93a534e8cb 100644--- a/backend/runner/taskrun/pitr_restore_executor.go+++ b/backend/runner/taskrun/pitr_restore_executor.go@@ -536,7 +536,7 @@ func createBranchMigrationHistory(ctx context.Context, stores *store.Store, dbFaVersion: common.DefaultMigrationVersion(),Namespace: targetDatabase.DatabaseName,Database: targetDatabase.DatabaseName,- Environment: targetInstanceEnvironment.Title,+ Environment: targetInstanceEnvironment.ResourceID,Source: db.MigrationSource(targetDatabaseProject.Workflow),Type: db.Branch,Description: description,diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.goindex c3376a225c..f6fcab743b 100644--- a/backend/tests/schema_update_test.go+++ b/backend/tests/schema_update_test.go@@ -273,7 +273,7 @@ func TestSchemaAndDataUpdate(t *testing.T) {a.NoError(err)}-func TestVCS1(t *testing.T) {+func TestVCS(t *testing.T) {tests := []struct {name stringvcsProviderCreator fake.VCSProviderCreator@@ -599,7 +599,7 @@ func TestVCS1(t *testing.T) {status, err = ctl.waitIssuePipeline(issue.ID)a.NoError(err)a.Equal(api.TaskDone, status)- latestFileName := fmt.Sprintf("%s/%s/.%s##LATEST.sql", baseDirectory, prodEnvironment.Name, database.Name)+ latestFileName := fmt.Sprintf("%s/%s/.%s##LATEST.sql", baseDirectory, prodEnvironment.ResourceID, database.Name)files, err := ctl.vcsProvider.GetFiles(test.externalID, latestFileName)a.NoError(err)a.Len(files, 1)