Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
refactor: modernize pointer construction for Go 1.26 (#19745)
p0ny7d81e51c3fba
diff --git a/action/command/api.go b/action/command/api.goindex 1fbbed7370..57bc5afd2a 100644--- a/action/command/api.go+++ b/action/command/api.go@@ -120,7 +120,7 @@ func createClient(url, accessToken, serviceAccount, serviceAccountSecret string,unifiedInt := newUnifiedInterceptor(opts.RetryConfig, tokenRefresher)interceptors := connect.WithInterceptors(unifiedInt)- c := Client{+ return &Client{httpClient: httpClient,url: url,serviceAccount: serviceAccount,@@ -130,9 +130,7 @@ func createClient(url, accessToken, serviceAccount, serviceAccountSecret string,planClient: v1connect.NewPlanServiceClient(httpClient, url, interceptors),rolloutClient: v1connect.NewRolloutServiceClient(httpClient, url, interceptors),actuatorClient: v1connect.NewActuatorServiceClient(httpClient, url, interceptors),- }-- return &c, nil+ }, nil}func getTokenRefresher(httpClient connect.HTTPClient, email, password, url string) func(ctx context.Context) (string, error) {@@ -234,10 +232,9 @@ func (c *Client) ListTaskRuns(ctx context.Context, r *v1pb.ListTaskRunsRequest)}func (c *Client) ListAllTaskRuns(ctx context.Context, rolloutName string) (*v1pb.ListTaskRunsResponse, error) {- request := &v1pb.ListTaskRunsRequest{+ return c.ListTaskRuns(ctx, &v1pb.ListTaskRunsRequest{Parent: rolloutName + "/stages/-/tasks/-",- }- return c.ListTaskRuns(ctx, request)+ })}func (c *Client) BatchCancelTaskRuns(ctx context.Context, r *v1pb.BatchCancelTaskRunsRequest) (*v1pb.BatchCancelTaskRunsResponse, error) {diff --git a/backend/api/directory-sync/webhook.go b/backend/api/directory-sync/webhook.goindex ac79cf7744..d4c4a5e832 100644--- a/backend/api/directory-sync/webhook.go+++ b/backend/api/directory-sync/webhook.go@@ -268,9 +268,8 @@ func (s *Service) RegisterDirectorySyncRoutes(g *echo.Group) {})}- deleteUser := trueif _, err := s.store.UpdateUser(ctx, user, &store.UpdateUserMessage{- Delete: &deleteUser,+ Delete: new(true),}); err != nil {return c.String(http.StatusInternalServerError, fmt.Sprintf("failed to delete user, error %v", err))}@@ -387,8 +386,7 @@ func (s *Service) RegisterDirectorySyncRoutes(g *echo.Group) {slog.Warn("unsupport value, expect bool or string", slog.String("operation", op.OP), slog.String("path", op.Path), slog.Any("value", op.Value))continue}- isDelete := !active- updateUser.Delete = &isDelete+ updateUser.Delete = new(!active)case "":// Empty path with replace operation - Okta sends full resource attributes.// Per RFC 7644 Section 3.5.2.3: If path is omitted, the value must be a complex@@ -411,8 +409,7 @@ func (s *Service) RegisterDirectorySyncRoutes(g *echo.Group) {}}if active, ok := parseBoolValue(valueMap["active"]); ok {- isDelete := !active- updateUser.Delete = &isDelete+ updateUser.Delete = new(!active)}// Handle nested name object (name.givenName, name.familyName)if nameObj, ok := valueMap["name"].(map[string]any); ok {@@ -424,8 +421,7 @@ func (s *Service) RegisterDirectorySyncRoutes(g *echo.Group) {nameParts = append(nameParts, familyName)}if len(nameParts) > 0 {- fullName := strings.Join(nameParts, " ")- updateUser.Name = &fullName+ updateUser.Name = new(strings.Join(nameParts, " "))}}default:@@ -929,9 +925,8 @@ func (s *Service) updateUserFromSCIM(ctx context.Context, user *store.UserMessagif !common.IsValidEmail(normalizedEmail) {return nil, errors.Errorf("email %q contains non-ASCII characters", scimUser.UserName)}- deleted := !scimUser.Activepatch := &store.UpdateUserMessage{- Delete: &deleted,+ Delete: new(!scimUser.Active),Name: &scimUser.DisplayName,Email: &normalizedEmail,Profile: user.Profile,diff --git a/backend/api/lsp/handler.go b/backend/api/lsp/handler.goindex 95a361e827..0f715fff8d 100644--- a/backend/api/lsp/handler.go+++ b/backend/api/lsp/handler.go@@ -108,8 +108,7 @@ func (h *Handler) ShutDown() {func (h *Handler) setMetadata(arg SetMetadataCommandArguments) {h.mu.Lock()defer h.mu.Unlock()- tmp := arg- h.metadata = &tmp+ h.metadata = new(arg)}func (h *Handler) getDefaultDatabase() string {diff --git a/backend/api/v1/access_grant_service.go b/backend/api/v1/access_grant_service.goindex d06c634441..9db2564652 100644--- a/backend/api/v1/access_grant_service.go+++ b/backend/api/v1/access_grant_service.go@@ -182,8 +182,7 @@ func (s *AccessGrantService) CreateAccessGrant(ctx context.Context, request *conif exp.ExpireTime == nil {return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("expire_time is required"))}- t := exp.ExpireTime.AsTime()- expireTime = &t+ expireTime = new(exp.ExpireTime.AsTime())case *v1pb.AccessGrant_Ttl:if exp.Ttl == nil {return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("ttl is required"))@@ -296,15 +295,13 @@ func activateAccessGrant(ctx context.Context, stores *store.Store, accessGrantNareturn nil, connect.NewError(connect.CodeNotFound, errors.Errorf("access grant %q not found", accessGrantName))}- status := storepb.AccessGrant_ACTIVEupdate := &store.UpdateAccessGrantMessage{- Status: &status,+ Status: new(storepb.AccessGrant_ACTIVE),}// If the grant was created with a TTL, compute expire_time at activation time.if refreshExpireTime && grant.Payload != nil && grant.Payload.RequestedDuration != nil {- expireTime := time.Now().Add(grant.Payload.RequestedDuration.AsDuration())- update.ExpireTime = &expireTime+ update.ExpireTime = new(time.Now().Add(grant.Payload.RequestedDuration.AsDuration()))}updated, err := stores.UpdateAccessGrant(ctx, accessGrantID, update)@@ -341,9 +338,8 @@ func (s *AccessGrantService) RevokeAccessGrant(ctx context.Context, request *conreturn nil, connect.NewError(connect.CodeFailedPrecondition, errors.Errorf("access grant %q is not in ACTIVE status", req.Name))}- status := storepb.AccessGrant_REVOKEDupdated, err := s.store.UpdateAccessGrant(ctx, accessGrantID, &store.UpdateAccessGrantMessage{- Status: &status,+ Status: new(storepb.AccessGrant_REVOKED),})if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to revoke access grant"))diff --git a/backend/api/v1/ai_service.go b/backend/api/v1/ai_service.goindex 62609f1f60..22216f8fef 100644--- a/backend/api/v1/ai_service.go+++ b/backend/api/v1/ai_service.go@@ -158,8 +158,7 @@ func buildChatToolCallMetadata(rawOpenAIToolCall json.RawMessage, geminiThoughtSif err != nil {return nil, err}- metadataString := string(metadataBytes)- return &metadataString, nil+ return new(string(metadataBytes)), nil}func openAIToolCallFromMetadata(raw string) json.RawMessage {diff --git a/backend/api/v1/database_service.go b/backend/api/v1/database_service.goindex 917ec191d1..3309712963 100644--- a/backend/api/v1/database_service.go+++ b/backend/api/v1/database_service.go@@ -84,7 +84,7 @@ func (s *DatabaseService) BatchGetDatabases(ctx context.Context, req *connect.Reif err != nil {return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid parent %q", req.Msg.Parent))}- projectIDFilter = &projectID+ projectIDFilter = new(projectID)}// For instances/{instance} or "-" (wildcard), no project filter is applied.databases := make([]*v1pb.Database, 0, len(req.Msg.Names))@@ -346,8 +346,7 @@ func (s *DatabaseService) UpdateDatabase(ctx context.Context, req *connect.Reque}patch.EnvironmentID = &environmentID} else {- unsetEnvironment := ""- patch.EnvironmentID = &unsetEnvironment+ patch.EnvironmentID = new("")}case "drifted":// Create a new base schema.@@ -509,8 +508,7 @@ func getDatabaseMetadataFilter(filter string) (*metadataFilter, error) {}switch variable {case "schema":- lowerValue := strings.ToLower(strValue)- metaFilter.schema = &lowerValue+ metaFilter.schema = new(strings.ToLower(strValue))case "table":metaFilter.table = &tableMetadataFilter{name: strings.ToLower(strValue),@@ -1006,12 +1004,10 @@ func (s *DatabaseService) convertToDatabase(ctx context.Context, database *storevar environment, effectiveEnvironment *stringif database.EnvironmentID != nil && *database.EnvironmentID != "" {- env := common.FormatEnvironment(*database.EnvironmentID)- environment = &env+ environment = new(common.FormatEnvironment(*database.EnvironmentID))}if database.EffectiveEnvironmentID != nil && *database.EffectiveEnvironmentID != "" {- effEnv := common.FormatEnvironment(*database.EffectiveEnvironmentID)- effectiveEnvironment = &effEnv+ effectiveEnvironment = new(common.FormatEnvironment(*database.EffectiveEnvironmentID))}instanceResource := convertToV1InstanceResource(instance)return &v1pb.Database{diff --git a/backend/api/v1/instance_service.go b/backend/api/v1/instance_service.goindex 3cedb5f08b..eedd0b860f 100644--- a/backend/api/v1/instance_service.go+++ b/backend/api/v1/instance_service.go@@ -352,8 +352,7 @@ func (s *InstanceService) UpdateInstance(ctx context.Context, req *connect.Requecase "environment":if req.Msg.Instance.Environment == nil || *req.Msg.Instance.Environment == "" {// Clear the environment if null or empty string is provided- emptyStr := ""- patch.EnvironmentID = &emptyStr+ patch.EnvironmentID = new("")} else {envID, err := common.GetEnvironmentID(*req.Msg.Instance.Environment)if err != nil {diff --git a/backend/api/v1/issue_hook.go b/backend/api/v1/issue_hook.goindex b994542cf9..bf64ea7fa0 100644--- a/backend/api/v1/issue_hook.go+++ b/backend/api/v1/issue_hook.go@@ -109,8 +109,7 @@ func completeAccessRequestIssue(ctx context.Context, stores *store.Store, userEmreturn issue, nil}- newStatus := storepb.Issue_DONE- updatedIssue, err := stores.UpdateIssue(ctx, issue.ProjectID, issue.UID, &store.UpdateIssueMessage{Status: &newStatus})+ updatedIssue, err := stores.UpdateIssue(ctx, issue.ProjectID, issue.UID, &store.UpdateIssueMessage{Status: new(storepb.Issue_DONE)})if err != nil {return nil, errors.Wrapf(err, "failed to update issue %q's status", issue.Title)}diff --git a/backend/api/v1/issue_service.go b/backend/api/v1/issue_service.goindex 68a2fcba60..acd3bde840 100644--- a/backend/api/v1/issue_service.go+++ b/backend/api/v1/issue_service.go@@ -134,8 +134,7 @@ func (s *IssueService) getIssueFind(if !ok {return "", connect.NewError(connect.CodeInvalidArgument, errors.Errorf(`invalid approval_status %q`, value))}- approvalStatus := v1pb.Issue_ApprovalStatus(approvalStatusValue)- filterIssue.ApprovalStatus = &approvalStatus+ filterIssue.ApprovalStatus = new(v1pb.Issue_ApprovalStatus(approvalStatusValue))case "current_approver", "creator":user, err := s.getUserByIdentifier(ctx, value.(string))if err != nil {@@ -187,7 +186,7 @@ func (s *IssueService) getIssueFind(issueFind.StatusList = append(issueFind.StatusList, newStatus)}case "type":- types := []storepb.Issue_Type{}+ var types []storepb.Issue_Typefor _, raw := range rawList {issueType, err := convertToAPIIssueType(v1pb.Issue_Type(v1pb.Issue_Type_value[raw.(string)]))if err != nil {@@ -1029,7 +1028,6 @@ func (s *IssueService) BatchUpdateIssuesStatus(ctx context.Context, req *connect// Batch create issue comments.issueComments := make([]*store.IssueCommentMessage, 0, len(issueUIDs))for _, issueUID := range issueUIDs {- oldStatus := oldIssueStatuses[issueUID]issueComments = append(issueComments, &store.IssueCommentMessage{ProjectID: projectID,IssueUID: issueUID,@@ -1037,7 +1035,7 @@ func (s *IssueService) BatchUpdateIssuesStatus(ctx context.Context, req *connectComment: req.Msg.Reason,Event: &storepb.IssueCommentPayload_IssueUpdate_{IssueUpdate: &storepb.IssueCommentPayload_IssueUpdate{- FromStatus: &oldStatus,+ FromStatus: new(oldIssueStatuses[issueUID]),ToStatus: &newStatus,},},diff --git a/backend/api/v1/masking_evaluator_test.go b/backend/api/v1/masking_evaluator_test.goindex bfc1eacdfb..1164772404 100644--- a/backend/api/v1/masking_evaluator_test.go+++ b/backend/api/v1/masking_evaluator_test.go@@ -38,10 +38,7 @@ func TestEvalMaskingLevelOfColumn(t *testing.T) {"1-1-1": {Id: "1-1-1",Title: "personal",- Level: func() *int32 {- a := int32(2)- return &a- }(),+ Level: new(int32(2)),},},},diff --git a/backend/api/v1/plan_service.go b/backend/api/v1/plan_service.goindex b074d90da0..a5c91c9fa9 100644--- a/backend/api/v1/plan_service.go+++ b/backend/api/v1/plan_service.go@@ -294,14 +294,11 @@ func (s *PlanService) UpdatePlan(ctx context.Context, request *connect.Request[vfor _, path := range req.UpdateMask.Paths {switch path {case "title":- title := req.Plan.Title- planUpdate.Name = &title+ planUpdate.Name = new(req.Plan.Title)case "description":- description := req.Plan.Description- planUpdate.Description = &description+ planUpdate.Description = new(req.Plan.Description)case "state":- deleted := req.Plan.State == v1pb.State_DELETED- planUpdate.Deleted = &deleted+ planUpdate.Deleted = new(req.Plan.State == v1pb.State_DELETED)case "specs":// Block all spec changes if plan has a rollout (pipeline).// Block all spec changes if plan has a rollout (pipeline).diff --git a/backend/api/v1/project_service_converter.go b/backend/api/v1/project_service_converter.goindex a2ffef6d7d..f549178532 100644--- a/backend/api/v1/project_service_converter.go+++ b/backend/api/v1/project_service_converter.go@@ -19,12 +19,11 @@ import (func convertToProtoAny(i any) (*anypb.Any, error) {switch deltas := i.(type) {case []*v1pb.BindingDelta:- auditData := v1pb.AuditData{+ return anypb.New(&v1pb.AuditData{PolicyDelta: &v1pb.PolicyDelta{BindingDeltas: deltas,},- }- return anypb.New(&auditData)+ })default:return &anypb.Any{}, nil}@@ -319,23 +318,22 @@ func convertToStoreExecutionRetryPolicy(policy *v1pb.Project_ExecutionRetryPolic}func convertToProjectMessage(resourceID string, project *v1pb.Project) *store.ProjectMessage {- setting := &storepb.Project{- EnforceIssueTitle: project.EnforceIssueTitle,- PostgresDatabaseTenantMode: project.PostgresDatabaseTenantMode,- AllowSelfApproval: project.AllowSelfApproval,- CiSamplingSize: project.CiSamplingSize,- ParallelTasksPerRollout: project.ParallelTasksPerRollout,- Labels: project.Labels,- EnforceSqlReview: project.EnforceSqlReview,- RequireIssueApproval: project.RequireIssueApproval,- RequirePlanCheckNoError: project.RequirePlanCheckNoError,- AllowRequestRole: project.AllowRequestRole,- AllowJustInTimeAccess: project.AllowJustInTimeAccess,- DataClassificationConfigId: project.DataClassificationConfigId,- }return &store.ProjectMessage{ResourceID: resourceID,Title: project.Title,- Setting: setting,+ Setting: &storepb.Project{+ EnforceIssueTitle: project.EnforceIssueTitle,+ PostgresDatabaseTenantMode: project.PostgresDatabaseTenantMode,+ AllowSelfApproval: project.AllowSelfApproval,+ CiSamplingSize: project.CiSamplingSize,+ ParallelTasksPerRollout: project.ParallelTasksPerRollout,+ Labels: project.Labels,+ EnforceSqlReview: project.EnforceSqlReview,+ RequireIssueApproval: project.RequireIssueApproval,+ RequirePlanCheckNoError: project.RequirePlanCheckNoError,+ AllowRequestRole: project.AllowRequestRole,+ AllowJustInTimeAccess: project.AllowJustInTimeAccess,+ DataClassificationConfigId: project.DataClassificationConfigId,+ },}}diff --git a/backend/api/v1/release_service_check.go b/backend/api/v1/release_service_check.goindex 01166691f4..7fb60f8557 100644--- a/backend/api/v1/release_service_check.go+++ b/backend/api/v1/release_service_check.go@@ -193,7 +193,7 @@ loop:revisions, err := s.store.ListRevisions(ctx, &store.FindRevisionMessage{InstanceID: database.InstanceID,DatabaseName: &database.DatabaseName,- Type: common.NewP(storepb.SchemaChangeType_VERSIONED),+ Type: new(storepb.SchemaChangeType_VERSIONED),Versions: &releaseFileVersions,ShowDeleted: false,})@@ -371,8 +371,8 @@ func (s *ReleaseService) checkReleaseDeclarative(ctx context.Context, files []*vrevisions, err := s.store.ListRevisions(ctx, &store.FindRevisionMessage{InstanceID: database.InstanceID,DatabaseName: &database.DatabaseName,- Type: common.NewP(storepb.SchemaChangeType_DECLARATIVE),- Limit: common.NewP(1),+ Type: new(storepb.SchemaChangeType_DECLARATIVE),+ Limit: new(1),ShowDeleted: false,})if err != nil {diff --git a/backend/api/v1/review_config_service.go b/backend/api/v1/review_config_service.goindex d46828935e..e10ff4a1ca 100644--- a/backend/api/v1/review_config_service.go+++ b/backend/api/v1/review_config_service.go@@ -191,12 +191,11 @@ func (s *ReviewConfigService) DeleteReviewConfig(ctx context.Context, req *conneif err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to marshal tag policy"))}- patch := string(payloadBytes)if _, err := s.store.UpdatePolicy(ctx, &store.UpdatePolicyMessage{ResourceType: policy.ResourceType,Resource: policy.Resource,Workspace: policy.Workspace,- Payload: &patch,+ Payload: new(string(payloadBytes)),}); err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrap(err, "failed to update tag policy"))}diff --git a/backend/api/v1/rollout_service_converter.go b/backend/api/v1/rollout_service_converter.goindex 1a64de4e11..d4eaaf2226 100644--- a/backend/api/v1/rollout_service_converter.go+++ b/backend/api/v1/rollout_service_converter.go@@ -312,11 +312,6 @@ func convertToTaskFromDatabaseDataExport(project *store.ProjectMessage, task *sttargetDatabaseName := fmt.Sprintf("%s%s/%s%s", common.InstanceNamePrefix, task.InstanceID, common.DatabaseIDPrefix, *(task.DatabaseName))sheet := common.FormatSheet(project.ResourceID, task.Payload.GetSheetSha256())- v1pbTaskPayload := v1pb.Task_DatabaseDataExport_{- DatabaseDataExport: &v1pb.Task_DatabaseDataExport{- Sheet: sheet,- },- }stageID := common.FormatStageID(task.Environment)v1pbTask := &v1pb.Task{Name: common.FormatTask(project.ResourceID, task.PlanID, stageID, task.ID),@@ -325,7 +320,11 @@ func convertToTaskFromDatabaseDataExport(project *store.ProjectMessage, task *stStatus: convertToTaskStatus(task.LatestTaskRunStatus, task.Payload.GetSkipped()),SkippedReason: task.Payload.GetSkippedReason(),Target: targetDatabaseName,- Payload: &v1pbTaskPayload,+ Payload: &v1pb.Task_DatabaseDataExport_{+ DatabaseDataExport: &v1pb.Task_DatabaseDataExport{+ Sheet: sheet,+ },+ },}if task.UpdatedAt != nil {v1pbTask.UpdateTime = timestamppb.New(*task.UpdatedAt)@@ -386,15 +385,14 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrfor _, l := range logs {switch l.Payload.Type {case storepb.TaskRunLog_SCHEMA_DUMP_START:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_SCHEMA_DUMP,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,SchemaDump: &v1pb.TaskRunLogEntry_SchemaDump{StartTime: timestamppb.New(l.T),},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_SCHEMA_DUMP_END:if len(entries) == 0 {@@ -408,7 +406,7 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrprev.SchemaDump.Error = l.Payload.SchemaDumpEnd.Errorcase storepb.TaskRunLog_COMMAND_EXECUTE:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_COMMAND_EXECUTE,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,@@ -417,8 +415,7 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrRange: convertToRange(l.Payload.CommandExecute.Range),Statement: l.Payload.CommandExecute.Statement,},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_COMMAND_RESPONSE:if len(entries) == 0 {@@ -436,15 +433,14 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntr}case storepb.TaskRunLog_DATABASE_SYNC_START:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_DATABASE_SYNC,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,DatabaseSync: &v1pb.TaskRunLogEntry_DatabaseSync{StartTime: timestamppb.New(l.T),},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_DATABASE_SYNC_END:if len(entries) == 0 {@@ -458,7 +454,7 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrprev.DatabaseSync.Error = l.Payload.DatabaseSyncEnd.Errorcase storepb.TaskRunLog_TRANSACTION_CONTROL:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_TRANSACTION_CONTROL,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,@@ -466,19 +462,17 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrType: convertTaskRunLogTransactionControlType(l.Payload.TransactionControl.Type),Error: l.Payload.TransactionControl.Error,},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_PRIOR_BACKUP_START:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_PRIOR_BACKUP,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,PriorBackup: &v1pb.TaskRunLogEntry_PriorBackup{StartTime: timestamppb.New(l.T),},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_PRIOR_BACKUP_END:if len(entries) == 0 {@@ -493,15 +487,14 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrprev.PriorBackup.PriorBackupDetail = convertToTaskRunLogPriorBackupDetail(l.Payload.PriorBackupEnd.PriorBackupDetail)case storepb.TaskRunLog_COMPUTE_DIFF_START:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_COMPUTE_DIFF,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,ComputeDiff: &v1pb.TaskRunLogEntry_ComputeDiff{StartTime: timestamppb.New(l.T),},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_COMPUTE_DIFF_END:if len(entries) == 0 {@@ -515,7 +508,7 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrprev.ComputeDiff.Error = l.Payload.ComputeDiffEnd.Errorcase storepb.TaskRunLog_RETRY_INFO:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_RETRY_INFO,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,@@ -524,11 +517,10 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrMaximumRetries: l.Payload.RetryInfo.MaximumRetries,Error: l.Payload.RetryInfo.Error,},- }- entries = append(entries, e)+ })case storepb.TaskRunLog_RELEASE_FILE_EXECUTE:- e := &v1pb.TaskRunLogEntry{+ entries = append(entries, &v1pb.TaskRunLogEntry{Type: v1pb.TaskRunLogEntry_RELEASE_FILE_EXECUTE,LogTime: timestamppb.New(l.T),ReplicaId: l.Payload.ReplicaId,@@ -536,8 +528,7 @@ func convertToTaskRunLogEntries(logs []*store.TaskRunLog) []*v1pb.TaskRunLogEntrVersion: l.Payload.ReleaseFileExecute.Version,FilePath: l.Payload.ReleaseFileExecute.FilePath,},- }- entries = append(entries, e)+ })default:}}diff --git a/backend/api/v1/service_account_service.go b/backend/api/v1/service_account_service.goindex 402bc00428..1e5e7ce731 100644--- a/backend/api/v1/service_account_service.go+++ b/backend/api/v1/service_account_service.go@@ -150,8 +150,7 @@ func (s *ServiceAccountService) ListServiceAccounts(ctx context.Context, requestcase strings.HasPrefix(parent, common.WorkspacePrefix):// workspace-level list: parent = "workspaces/{id}"// use empty string to filter workspace-level SAs- emptyProjectID := ""- projectID = &emptyProjectID+ projectID = new("")default:return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid parent format %q, expected projects/{project} or workspaces/{id}", parent))}@@ -246,8 +245,7 @@ func (s *ServiceAccountService) UpdateServiceAccount(ctx context.Context, requesif err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to hash service key"))}- passwordHashStr := string(passwordHash)- patch.ServiceKeyHash = &passwordHashStr+ patch.ServiceKeyHash = new(string(passwordHash))default:// Ignore unknown fields}diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex 4000f5d0f5..0bf75e9298 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -923,7 +923,6 @@ func (s *SQLService) doExportFromIssue(ctx context.Context, requestName string)}pendingEncrypts := []*encryptContent{}- targetTaskRunStatus := []storepb.TaskRun_Status{storepb.TaskRun_DONE}for _, task := range tasks {// Skip tasks that are marked as skipped (they don't have archives)@@ -935,7 +934,7 @@ func (s *SQLService) doExportFromIssue(ctx context.Context, requestName string)Workspace: common.GetWorkspaceIDFromContext(ctx),ProjectID: projectID,TaskUID: &task.ID,- Status: &targetTaskRunStatus,+ Status: &[]storepb.TaskRun_Status{storepb.TaskRun_DONE},})if err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Errorf("failed to get task run: %v", err))@@ -1241,8 +1240,7 @@ func (s *SQLService) createQueryHistory(database *store.DatabaseMessage, queryTy},}if queryErr != nil {- queryErrString := queryErr.Error()- qh.Payload.Error = &queryErrString+ qh.Payload.Error = new(queryErr.Error())}// Use a fresh context with timeout for creating query historydiff --git a/backend/api/v1/user_service.go b/backend/api/v1/user_service.goindex 420c1f8612..639fd5501e 100644--- a/backend/api/v1/user_service.go+++ b/backend/api/v1/user_service.go@@ -426,8 +426,7 @@ func (s *UserService) UpdateUser(ctx context.Context, request *connect.Request[vif err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to generate password hash"))}- passwordHashStr := string(passwordHash)- patch.PasswordHash = &passwordHashStr+ patch.PasswordHash = new(string(passwordHash))// Revoke all refresh tokens for this user (including current session)// User must re-login after password change for securitydiff --git a/backend/api/v1/workload_identity_service.go b/backend/api/v1/workload_identity_service.goindex cae2bacdce..d31fe4baf0 100644--- a/backend/api/v1/workload_identity_service.go+++ b/backend/api/v1/workload_identity_service.go@@ -139,8 +139,7 @@ func (s *WorkloadIdentityService) ListWorkloadIdentities(ctx context.Context, recase strings.HasPrefix(parent, common.WorkspacePrefix):// workspace-level list: parent = "workspaces/{id}"// use empty string to filter workspace-level WIs- emptyProjectID := ""- projectID = &emptyProjectID+ projectID = new("")default:return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("invalid parent format %q, expected projects/{project} or workspaces/{id}", parent))}diff --git a/backend/api/v1/workspace_service.go b/backend/api/v1/workspace_service.goindex bce6c8269c..4ea35598ed 100644--- a/backend/api/v1/workspace_service.go+++ b/backend/api/v1/workspace_service.go@@ -231,13 +231,12 @@ func (s *WorkspaceService) SetIamPolicy(ctx context.Context, req *connect.Requesif err != nil {return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to marshal iam policy"))}- payloadStr := string(payloadBytes)patch := &store.UpdatePolicyMessage{ResourceType: storepb.Policy_WORKSPACE,Resource: request.Resource,Type: storepb.Policy_IAM,Workspace: workspaceID,- Payload: &payloadStr,+ Payload: new(string(payloadBytes)),}if _, err := s.store.UpdatePolicy(ctx, patch); err != nil {diff --git a/backend/common/util.go b/backend/common/util.goindex 02dacbd602..e06795c2cf 100644--- a/backend/common/util.go+++ b/backend/common/util.go@@ -243,10 +243,6 @@ func IsNil(val any) bool {return false}-func NewP[T any](x T) *T {- return &x-}-// Uniq returns a new slice with duplicate elements removed, preserving order.func Uniq[T comparable](array []T) []T {res := make([]T, 0, len(array))diff --git a/backend/component/sampleinstance/manager.go b/backend/component/sampleinstance/manager.goindex 56336c7fde..b22ef4c728 100644--- a/backend/component/sampleinstance/manager.go+++ b/backend/component/sampleinstance/manager.go@@ -176,12 +176,10 @@ func (m *Manager) GenerateOnboardingData(ctx context.Context, workspaceID stringproject = sampleProject}- testEnvID := common.DefaultTestEnvironmentID- prodEnvID := common.DefaultProdEnvironmentIDinstanceMessages := []*store.InstanceMessage{{ResourceID: "test-sample-instance",- EnvironmentID: &testEnvID,+ EnvironmentID: new(common.DefaultTestEnvironmentID),Workspace: workspaceID,Metadata: &storepb.Instance{Title: "Test Sample Instance",@@ -195,7 +193,7 @@ func (m *Manager) GenerateOnboardingData(ctx context.Context, workspaceID string},{ResourceID: "prod-sample-instance",- EnvironmentID: &prodEnvID,+ EnvironmentID: new(common.DefaultProdEnvironmentID),Workspace: workspaceID,Metadata: &storepb.Instance{Title: "Prod Sample Instance",diff --git a/backend/enterprise/license.go b/backend/enterprise/license.goindex 41a7b8c1d7..2c5bd1d275 100644--- a/backend/enterprise/license.go+++ b/backend/enterprise/license.go@@ -448,8 +448,7 @@ func (s *LicenseService) GetAuditLogRetentionCutoff(ctx context.Context, workspaif days <= 0 {return nil // Either no access (0) or unlimited (-1)}- cutoff := time.Now().AddDate(0, 0, -days)- return &cutoff+ return new(time.Now().AddDate(0, 0, -days))}// CountActiveReplicas returns the count of active replicas.diff --git a/backend/plugin/db/cassandra/cassandra_test.go b/backend/plugin/db/cassandra/cassandra_test.goindex 7741e385c9..72b47f5988 100644--- a/backend/plugin/db/cassandra/cassandra_test.go+++ b/backend/plugin/db/cassandra/cassandra_test.go@@ -78,11 +78,8 @@ func TestConvertRowValuePrimitives(t *testing.T) {expected *v1pb.RowValue}{{- name: "string pointer",- value: func() *string {- s := "hello"- return &s- }(),+ name: "string pointer",+ value: new("hello"),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_StringValue{StringValue: "hello"}},},{@@ -93,43 +90,28 @@ func TestConvertRowValuePrimitives(t *testing.T) {expected: util.NullRowValue,},{- name: "int64 pointer",- value: func() *int64 {- i := int64(42)- return &i- }(),+ name: "int64 pointer",+ value: new(int64(42)),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_Int64Value{Int64Value: 42}},},{- name: "bool pointer true",- value: func() *bool {- b := true- return &b- }(),+ name: "bool pointer true",+ value: new(true),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_BoolValue{BoolValue: true}},},{- name: "bool pointer false",- value: func() *bool {- b := false- return &b- }(),+ name: "bool pointer false",+ value: new(false),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_BoolValue{BoolValue: false}},},{- name: "float64 pointer",- value: func() *float64 {- f := 3.14159- return &f- }(),+ name: "float64 pointer",+ value: new(3.14159),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_DoubleValue{DoubleValue: 3.14159}},},{- name: "bytes pointer",- value: func() *[]byte {- b := []byte("hello")- return &b- }(),+ name: "bytes pointer",+ value: new([]byte("hello")),expected: &v1pb.RowValue{Kind: &v1pb.RowValue_BytesValue{BytesValue: []byte("hello")}},},}diff --git a/backend/plugin/db/dynamodb/dynamodb.go b/backend/plugin/db/dynamodb/dynamodb.goindex 43096d381f..87bc1c01a0 100644--- a/backend/plugin/db/dynamodb/dynamodb.go+++ b/backend/plugin/db/dynamodb/dynamodb.go@@ -67,9 +67,8 @@ func (*Driver) Close(_ context.Context) error {func (d *Driver) Ping(ctx context.Context) error {// DynamoDB does not support ping method, we list tables instead. To avoid network overhead,// we set the limit to 1.- var limit int32 = 1_, err := d.client.ListTables(ctx, &dynamodb.ListTablesInput{- Limit: &limit,+ Limit: new(int32(1)),})if err != nil {return errors.Wrapf(err, "failed to list dynamodb tables")@@ -171,8 +170,7 @@ func (d *Driver) querySinglePartiQL(ctx context.Context, statement string, queryStatement: &statement,}if queryContext.Limit > 0 {- limit := int32(queryContext.Limit)- input.Limit = &limit+ input.Limit = new(int32(queryContext.Limit))}var nextToken *stringdiff --git a/backend/plugin/db/dynamodb/sync.go b/backend/plugin/db/dynamodb/sync.goindex 526b9f6b3b..51e8132fc8 100644--- a/backend/plugin/db/dynamodb/sync.go+++ b/backend/plugin/db/dynamodb/sync.go@@ -140,11 +140,10 @@ func (d *Driver) syncTable(ctx context.Context, tableName string) (*storepb.Tablfunc (d *Driver) listAllTables(ctx context.Context) ([]string, error) {var result []string- var limit int32 = 100var exclusiveStartTableName *stringfor {out, err := d.client.ListTables(ctx, &dynamodb.ListTablesInput{- Limit: &limit,+ Limit: new(int32(100)),ExclusiveStartTableName: exclusiveStartTableName,})if err != nil {diff --git a/backend/runner/approval/runner.go b/backend/runner/approval/runner.goindex 2885e35f01..3c336e9a39 100644--- a/backend/runner/approval/runner.go+++ b/backend/runner/approval/runner.go@@ -466,12 +466,11 @@ func unfoldSpecTargets(ctx context.Context, stores *store.Store, specs []*storep}// For CREATE_DATABASE, create a synthetic database message// since the database doesn't exist yet- envID := config.CreateDatabaseConfig.Environmenttargets = append(targets, specTarget{database: &store.DatabaseMessage{InstanceID: instanceID,DatabaseName: config.CreateDatabaseConfig.Database,- EffectiveEnvironmentID: &envID,+ EffectiveEnvironmentID: new(config.CreateDatabaseConfig.Environment),},sheetSha256: "",})diff --git a/backend/runner/schemasync/syncer.go b/backend/runner/schemasync/syncer.goindex 167660a0a1..039ae46173 100644--- a/backend/runner/schemasync/syncer.go+++ b/backend/runner/schemasync/syncer.go@@ -356,11 +356,10 @@ func (s *Syncer) SyncInstance(ctx context.Context, instance *store.InstanceMessafor _, database := range databases {idx := slices.IndexFunc(filteredDatabaseMetadatas, func(db *storepb.DatabaseSchemaMetadata) bool { return db.Name == database.DatabaseName })if idx < 0 {- d := trueif _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{InstanceID: instance.ResourceID,DatabaseName: database.DatabaseName,- Deleted: &d,+ Deleted: new(true),}); err != nil {return nil, nil, nil, errors.Errorf("failed to update database %q for instance %q", database.DatabaseName, instance.ResourceID)}@@ -427,7 +426,7 @@ func (s *Syncer) doSyncDatabaseSchema(ctx context.Context, database *store.Databif _, err := s.store.UpdateDatabase(ctx, &store.UpdateDatabaseMessage{InstanceID: database.InstanceID,DatabaseName: database.DatabaseName,- Deleted: proto.Bool(false),+ Deleted: new(false),MetadataUpdates: metadataUpdates,}); err != nil {return "", errors.Wrapf(err, "failed to update database %q for instance %q", database.DatabaseName, database.InstanceID)diff --git a/backend/runner/taskrun/database_migrate_executor.go b/backend/runner/taskrun/database_migrate_executor.goindex 38c204a781..015f729a8f 100644--- a/backend/runner/taskrun/database_migrate_executor.go+++ b/backend/runner/taskrun/database_migrate_executor.go@@ -129,11 +129,10 @@ func (exec *DatabaseMigrateExecutor) RunOnce(ctx context.Context, driverCtx cont// ensureBaselineChangelog creates a baseline changelog if this is the first migration for the database.func (exec *DatabaseMigrateExecutor) ensureBaselineChangelog(ctx context.Context, database *store.DatabaseMessage, _ *store.InstanceMessage) error {// Check if this database has any existing changelogs- limit := 1existingChangelogs, err := exec.store.ListChangelogs(ctx, &store.FindChangelogMessage{InstanceID: database.InstanceID,DatabaseName: &database.DatabaseName,- Limit: &limit,+ Limit: new(1),})if err != nil {return errors.Wrapf(err, "failed to check for existing changelogs")@@ -275,11 +274,9 @@ func (exec *DatabaseMigrateExecutor) runStandardMigration(ctx context.Context, d}}if migrationErr == nil {- status := store.ChangelogStatusDone- update.Status = &status+ update.Status = new(store.ChangelogStatusDone)} else {- status := store.ChangelogStatusFailed- update.Status = &status+ update.Status = new(store.ChangelogStatusFailed)}if err := exec.store.UpdateChangelog(ctx, update); err != nil {slog.Error("failed to update changelog", log.BBError(err))@@ -426,11 +423,9 @@ func (exec *DatabaseMigrateExecutor) runGhostMigration(ctx context.Context, drivupdate.SyncHistory = &syncHistory}if migrationErr == nil {- status := store.ChangelogStatusDone- update.Status = &status+ update.Status = new(store.ChangelogStatusDone)} else {- status := store.ChangelogStatusFailed- update.Status = &status+ update.Status = new(store.ChangelogStatusFailed)}if err := exec.store.UpdateChangelog(ctx, update); err != nil {slog.Error("failed to update changelog", log.BBError(err))@@ -582,11 +577,9 @@ func (exec *DatabaseMigrateExecutor) runVersionedRelease(ctx context.Context, drupdate.SyncHistory = &syncHistory}if migrationErr == nil {- status := store.ChangelogStatusDone- update.Status = &status+ update.Status = new(store.ChangelogStatusDone)} else {- status := store.ChangelogStatusFailed- update.Status = &status+ update.Status = new(store.ChangelogStatusFailed)}if err := exec.store.UpdateChangelog(ctx, update); err != nil {slog.Error("failed to update changelog", log.BBError(err))@@ -713,11 +706,9 @@ func (exec *DatabaseMigrateExecutor) runDeclarativeRelease(ctx context.Context,update.SyncHistory = &syncHistory}if migrationErr == nil {- status := store.ChangelogStatusDone- update.Status = &status+ update.Status = new(store.ChangelogStatusDone)} else {- status := store.ChangelogStatusFailed- update.Status = &status+ update.Status = new(store.ChangelogStatusFailed)}if err := exec.store.UpdateChangelog(ctx, update); err != nil {slog.Error("failed to update changelog", log.BBError(err))diff --git a/backend/runner/taskrun/scheduler.go b/backend/runner/taskrun/scheduler.goindex fb92ec6d4d..048bf44b94 100644--- a/backend/runner/taskrun/scheduler.go+++ b/backend/runner/taskrun/scheduler.go@@ -203,8 +203,7 @@ func (s *Scheduler) autoResolveIssue(ctx context.Context, projectID string, planreturn}- newStatus := storepb.Issue_DONE- if _, err := s.store.UpdateIssue(ctx, issue.ProjectID, issue.UID, &store.UpdateIssueMessage{Status: &newStatus}); err != nil {+ if _, err := s.store.UpdateIssue(ctx, issue.ProjectID, issue.UID, &store.UpdateIssueMessage{Status: new(storepb.Issue_DONE)}); err != nil {slog.Error("failed to auto-resolve issue", slog.String("project", projectID), slog.Int64("issueUID", issue.UID), log.BBError(err))return}diff --git a/backend/store/policy.go b/backend/store/policy.goindex b276024bcd..43c6e387c5 100644--- a/backend/store/policy.go+++ b/backend/store/policy.go@@ -33,12 +33,10 @@ func generateEtag(t time.Time) string {}func (s *Store) GetWorkspaceIamPolicy(ctx context.Context, workspaceID string) (*IamPolicyMessage, error) {- workspaceResource := common.FormatWorkspace(workspaceID)- resourceType := storepb.Policy_WORKSPACEreturn s.getIamPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,- ResourceType: &resourceType,- Resource: &workspaceResource,+ ResourceType: new(storepb.Policy_WORKSPACE),+ Resource: new(common.FormatWorkspace(workspaceID)),})}@@ -111,12 +109,10 @@ func (s *Store) PatchWorkspaceIamPolicy(ctx context.Context, patch *PatchIamPoli}func (s *Store) GetProjectIamPolicy(ctx context.Context, workspaceID string, projectID string) (*IamPolicyMessage, error) {- resource := common.FormatProject(projectID)- resourceType := storepb.Policy_PROJECTreturn s.getIamPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,- ResourceType: &resourceType,- Resource: &resource,+ ResourceType: new(storepb.Policy_PROJECT),+ Resource: new(common.FormatProject(projectID)),})}@@ -138,8 +134,7 @@ func (s *Store) GetProjectIamPolicySnapshot(ctx context.Context, workspaceID str}func (s *Store) getIamPolicy(ctx context.Context, find *FindPolicyMessage) (*IamPolicyMessage, error) {- pType := storepb.Policy_IAM- find.Type = &pType+ find.Type = new(storepb.Policy_IAM)policy, err := s.GetPolicy(ctx, find)if err != nil {return nil, err@@ -176,14 +171,11 @@ func GetDefaultRolloutPolicy() *storepb.RolloutPolicy {}func (s *Store) GetRolloutPolicy(ctx context.Context, workspaceID string, environment string) (*storepb.RolloutPolicy, error) {- resource := common.FormatEnvironment(environment)- resourceType := storepb.Policy_ENVIRONMENT- pType := storepb.Policy_ROLLOUTpolicy, err := s.GetPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,- ResourceType: &resourceType,- Resource: &resource,- Type: &pType,+ ResourceType: new(storepb.Policy_ENVIRONMENT),+ Resource: new(common.FormatEnvironment(environment)),+ Type: new(storepb.Policy_ROLLOUT),})if err != nil {return nil, errors.Wrapf(err, "failed to get policy")@@ -262,12 +254,11 @@ func (s *Store) getQueryDataPolicy(ctx context.Context, workspaceID string, resoif err != nil {return nil, err}- pType := storepb.Policy_QUERY_DATApolicy, err := s.GetPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,ResourceType: &resourceType,Resource: &resource,- Type: &pType,+ Type: new(storepb.Policy_QUERY_DATA),})if err != nil {return nil, errors.Wrapf(err, "failed to get policy")@@ -318,13 +309,11 @@ func (s *Store) GetReviewConfigForDatabase(ctx context.Context, workspaceID stri}func (s *Store) getReviewConfigByResource(ctx context.Context, workspaceID string, resourceType storepb.Policy_Resource, resource string) (*storepb.ReviewConfigPayload, error) {- pType := storepb.Policy_TAG-policy, err := s.GetPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,ResourceType: &resourceType,Resource: &resource,- Type: &pType,+ Type: new(storepb.Policy_TAG),})if err != nil {return nil, err@@ -366,14 +355,11 @@ func (s *Store) getReviewConfigByResource(ctx context.Context, workspaceID strin// GetMaskingRulePolicy will get the masking rule policy.func (s *Store) GetMaskingRulePolicy(ctx context.Context, workspaceID string) (*storepb.MaskingRulePolicy, error) {- workspaceResource := common.FormatWorkspace(workspaceID)- resourceType := storepb.Policy_WORKSPACE- pType := storepb.Policy_MASKING_RULEpolicy, err := s.GetPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,- ResourceType: &resourceType,- Resource: &workspaceResource,- Type: &pType,+ ResourceType: new(storepb.Policy_WORKSPACE),+ Resource: new(common.FormatWorkspace(workspaceID)),+ Type: new(storepb.Policy_MASKING_RULE),})if err != nil {return nil, err@@ -393,14 +379,11 @@ func (s *Store) GetMaskingRulePolicy(ctx context.Context, workspaceID string) (*// GetMaskingExemptionPolicyByProject gets the masking exemption policy for a project.func (s *Store) GetMaskingExemptionPolicyByProject(ctx context.Context, workspaceID string, projectID string) (*storepb.MaskingExemptionPolicy, error) {- resourceType := storepb.Policy_PROJECT- resource := common.FormatProject(projectID)- pType := storepb.Policy_MASKING_EXEMPTIONpolicy, err := s.GetPolicy(ctx, &FindPolicyMessage{Workspace: workspaceID,- ResourceType: &resourceType,- Resource: &resource,- Type: &pType,+ ResourceType: new(storepb.Policy_PROJECT),+ Resource: new(common.FormatProject(projectID)),+ Type: new(storepb.Policy_MASKING_EXEMPTION),})if err != nil {return nil, errdiff --git a/backend/store/project.go b/backend/store/project.goindex 50ece15dda..fe0c6e3db8 100644--- a/backend/store/project.go+++ b/backend/store/project.go@@ -60,8 +60,7 @@ type UpdateProjectMessage struct {// Checks for new format ("default-{workspaceID}") first, falls back to legacy ("default").func (s *Store) GetDefaultProjectID(ctx context.Context, workspace string) (string, error) {newID := common.DefaultProjectID(workspace)- resourceID := newID- project, err := s.GetProject(ctx, &FindProjectMessage{Workspace: workspace, ResourceID: &resourceID})+ project, err := s.GetProject(ctx, &FindProjectMessage{Workspace: workspace, ResourceID: new(newID)})if err != nil {return "", err}@@ -298,8 +297,7 @@ func (s *Store) UpdateProjects(ctx context.Context, patches ...*UpdateProjectMesif err != nil {return err}- s := string(payload)- settings[i] = &s+ settings[i] = new(string(payload))}}diff --git a/backend/store/service_account.go b/backend/store/service_account.goindex 9012bdfb61..8126129e67 100644--- a/backend/store/service_account.go+++ b/backend/store/service_account.go@@ -255,13 +255,11 @@ func (s *Store) UpdateServiceAccount(ctx context.Context, sa *ServiceAccountMess// DeleteServiceAccount soft-deletes a service account.func (s *Store) DeleteServiceAccount(ctx context.Context, sa *ServiceAccountMessage) error {- deleted := true- _, err := s.UpdateServiceAccount(ctx, sa, &UpdateServiceAccountMessage{Delete: &deleted})+ _, err := s.UpdateServiceAccount(ctx, sa, &UpdateServiceAccountMessage{Delete: new(true)})return err}// UndeleteServiceAccount restores a soft-deleted service account.func (s *Store) UndeleteServiceAccount(ctx context.Context, sa *ServiceAccountMessage) (*ServiceAccountMessage, error) {- deleted := false- return s.UpdateServiceAccount(ctx, sa, &UpdateServiceAccountMessage{Delete: &deleted})+ return s.UpdateServiceAccount(ctx, sa, &UpdateServiceAccountMessage{Delete: new(false)})}diff --git a/backend/store/workload_identity.go b/backend/store/workload_identity.goindex 56caa2ab0b..7ef6aeac0d 100644--- a/backend/store/workload_identity.go+++ b/backend/store/workload_identity.go@@ -286,13 +286,11 @@ func (s *Store) UpdateWorkloadIdentity(ctx context.Context, wi *WorkloadIdentity// DeleteWorkloadIdentity soft-deletes a workload identity.func (s *Store) DeleteWorkloadIdentity(ctx context.Context, wi *WorkloadIdentityMessage) error {- deleted := true- _, err := s.UpdateWorkloadIdentity(ctx, wi, &UpdateWorkloadIdentityMessage{Delete: &deleted})+ _, err := s.UpdateWorkloadIdentity(ctx, wi, &UpdateWorkloadIdentityMessage{Delete: new(true)})return err}// UndeleteWorkloadIdentity restores a soft-deleted workload identity.func (s *Store) UndeleteWorkloadIdentity(ctx context.Context, wi *WorkloadIdentityMessage) (*WorkloadIdentityMessage, error) {- deleted := false- return s.UpdateWorkloadIdentity(ctx, wi, &UpdateWorkloadIdentityMessage{Delete: &deleted})+ return s.UpdateWorkloadIdentity(ctx, wi, &UpdateWorkloadIdentityMessage{Delete: new(false)})}diff --git a/backend/tests/action_test.go b/backend/tests/action_test.goindex e90a351677..39697f31b9 100644--- a/backend/tests/action_test.go+++ b/backend/tests/action_test.go@@ -544,7 +544,7 @@ func (ctl *controller) createTestDatabase(ctx context.Context, t *testing.T) *v1Instance: &v1pb.Instance{Title: "Test Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -583,7 +583,7 @@ func (ctl *controller) createTestMySQLDatabase(ctx context.Context, t *testing.TInstance: &v1pb.Instance{Title: "Test MySQL Instance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -625,7 +625,7 @@ func (ctl *controller) createTestPostgreSQLDatabase(ctx context.Context, t *testInstance: &v1pb.Instance{Title: "Test PostgreSQL Instance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,diff --git a/backend/tests/approval_test.go b/backend/tests/approval_test.goindex 09357700c6..e49e0a4332 100644--- a/backend/tests/approval_test.go+++ b/backend/tests/approval_test.go@@ -35,7 +35,7 @@ func TestDirectApprovalRuleMatching(t *testing.T) {Instance: &v1pb.Instance{Title: "Prod Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -169,7 +169,7 @@ func TestApprovalRuleFirstMatchWins(t *testing.T) {Instance: &v1pb.Instance{Title: "Prod Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -314,7 +314,7 @@ func TestApprovalRuleNoMatch(t *testing.T) {Instance: &v1pb.Instance{Title: "Test Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -515,7 +515,7 @@ func TestFallbackRuleMatchesWhenSourceSpecificDoesNot(t *testing.T) {Instance: &v1pb.Instance{Title: "Test Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -654,7 +654,7 @@ func TestSourceSpecificRuleTakesPriorityOverFallback(t *testing.T) {Instance: &v1pb.Instance{Title: "Prod Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -805,7 +805,7 @@ func TestSelfApprovalBlocked(t *testing.T) {Instance: &v1pb.Instance{Title: "Prod Instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,diff --git a/backend/tests/common.go b/backend/tests/common.goindex 3abe9561d8..58c1f3ff8b 100644--- a/backend/tests/common.go+++ b/backend/tests/common.go@@ -9,8 +9,3 @@ import (func generateRandomString(prefix string) string {return fmt.Sprintf("%s-%s", prefix, uuid.New().String()[:10])}--// stringPtr returns a pointer to the string value.-func stringPtr(s string) *string {- return &s-}diff --git a/backend/tests/data_source_test.go b/backend/tests/data_source_test.goindex e216f493a1..64deeb079a 100644--- a/backend/tests/data_source_test.go+++ b/backend/tests/data_source_test.go@@ -29,7 +29,7 @@ func TestDataSource(t *testing.T) {Instance: &v1pb.Instance{Title: "test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Id: "admin-ds", Host: instanceDir}},},diff --git a/backend/tests/environment_test.go b/backend/tests/environment_test.goindex 7878efb77d..23f92231b3 100644--- a/backend/tests/environment_test.go+++ b/backend/tests/environment_test.go@@ -35,7 +35,7 @@ func TestDatabaseEnvironment(t *testing.T) {Instance: &v1pb.Instance{Title: "test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr(prodEnvironment.Name),+ Environment: new(prodEnvironment.Name),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Id: "admin-ds", Host: instanceDir}},},@@ -81,7 +81,7 @@ func TestDatabaseEnvironment(t *testing.T) {db2Resp, err = ctl.databaseServiceClient.UpdateDatabase(ctx, connect.NewRequest(&v1pb.UpdateDatabaseRequest{Database: &v1pb.Database{Name: db2.Name,- Environment: stringPtr(testEnvironment.Name),+ Environment: new(testEnvironment.Name),},UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"environment"},@@ -98,7 +98,7 @@ func TestDatabaseEnvironment(t *testing.T) {db2Resp, err = ctl.databaseServiceClient.UpdateDatabase(ctx, connect.NewRequest(&v1pb.UpdateDatabaseRequest{Database: &v1pb.Database{Name: db2.Name,- Environment: stringPtr(""),+ Environment: new(""),},UpdateMask: &fieldmaskpb.FieldMask{Paths: []string{"environment"},diff --git a/backend/tests/ghost_test.go b/backend/tests/ghost_test.goindex d93afbd65b..ec260dc595 100644--- a/backend/tests/ghost_test.go+++ b/backend/tests/ghost_test.go@@ -71,7 +71,7 @@ func TestGhostSchemaUpdate(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},diff --git a/backend/tests/gitops_test.go b/backend/tests/gitops_test.goindex a89913b370..d9cc033521 100644--- a/backend/tests/gitops_test.go+++ b/backend/tests/gitops_test.go@@ -52,7 +52,7 @@ func TestGitOpsCheck(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-check-test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},},@@ -65,7 +65,7 @@ func TestGitOpsCheck(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-check-prod",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir, Id: "admin"}},},@@ -183,7 +183,7 @@ func TestGitOpsRollout(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-rollout-test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},},@@ -354,7 +354,7 @@ func TestGitOpsRolloutGhostDirective(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-rollout-ghost",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},@@ -490,7 +490,7 @@ func TestGitOpsRolloutMultiTarget(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-multi-test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},},@@ -503,7 +503,7 @@ func TestGitOpsRolloutMultiTarget(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-multi-prod",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir, Id: "admin"}},},@@ -734,7 +734,7 @@ func TestGitOpsCheckAppliedButChanged(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-changed-test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: testInstanceDir, Id: "admin"}},},@@ -940,7 +940,7 @@ func TestGitOpsCheckDeclarative(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-decl-pg",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -1081,7 +1081,7 @@ ALTER TABLE public.users ADD COLUMN name VARCHAR(255);`,Instance: &v1pb.Instance{Title: "gitops-disallow-pg",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -1263,7 +1263,7 @@ func TestGitOpsCheckVersionedDependency(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-dep-pg",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,@@ -1361,7 +1361,7 @@ func TestGitOpsCheckDeclarativeMultipleFiles(t *testing.T) {Instance: &v1pb.Instance{Title: "gitops-multi-decl-pg",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,diff --git a/backend/tests/grouping_change_test.go b/backend/tests/grouping_change_test.goindex 67e68d4d0e..f6c4855f51 100644--- a/backend/tests/grouping_change_test.go+++ b/backend/tests/grouping_change_test.go@@ -128,7 +128,7 @@ func TestCreateDatabaseGroup(t *testing.T) {Instance: &v1pb.Instance{Title: prepareInstance.instanceTitle,Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},Activation: true,},diff --git a/backend/tests/pg_sdl_rollout_test.go b/backend/tests/pg_sdl_rollout_test.goindex 83246810a0..51843704cd 100644--- a/backend/tests/pg_sdl_rollout_test.go+++ b/backend/tests/pg_sdl_rollout_test.go@@ -44,7 +44,7 @@ func TestPgSDLRollout(t *testing.T) {Instance: &v1pb.Instance{Title: "SDL Test Instance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN,diff --git a/backend/tests/project_test.go b/backend/tests/project_test.goindex 02f6ed307c..b6afa31bb1 100644--- a/backend/tests/project_test.go+++ b/backend/tests/project_test.go@@ -30,7 +30,7 @@ func TestArchiveProject(t *testing.T) {Instance: &v1pb.Instance{Title: "test",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},},diff --git a/backend/tests/schema_update_test.go b/backend/tests/schema_update_test.goindex 2e1e734192..afd5883bd1 100644--- a/backend/tests/schema_update_test.go+++ b/backend/tests/schema_update_test.go@@ -36,7 +36,7 @@ func TestSchemaAndDataUpdate(t *testing.T) {Instance: &v1pb.Instance{Title: instanceName,Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},},@@ -251,7 +251,7 @@ CREATE TABLE "public"."book" (Instance: &v1pb.Instance{Title: test.name,Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr(environment.Name),+ Environment: new(environment.Name),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},@@ -270,7 +270,7 @@ CREATE TABLE "public"."book" (Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr(environment.Name),+ Environment: new(environment.Name),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -341,7 +341,7 @@ func TestMarkTaskAsDone(t *testing.T) {Instance: &v1pb.Instance{Title: instanceName,Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},},diff --git a/backend/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.goindex eda54ae080..ff8eb44057 100644--- a/backend/tests/sensitive_data_test.go+++ b/backend/tests/sensitive_data_test.go@@ -154,7 +154,7 @@ func TestSensitiveData(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},diff --git a/backend/tests/sql_editor_test.go b/backend/tests/sql_editor_test.goindex 15e701a940..900192a423 100644--- a/backend/tests/sql_editor_test.go+++ b/backend/tests/sql_editor_test.go@@ -148,7 +148,7 @@ func TestAdminQueryAffectedRows(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -161,7 +161,7 @@ func TestAdminQueryAffectedRows(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},diff --git a/backend/tests/sql_export_test.go b/backend/tests/sql_export_test.goindex 5538da5c55..90df699ecd 100644--- a/backend/tests/sql_export_test.go+++ b/backend/tests/sql_export_test.go@@ -168,7 +168,7 @@ func TestSQLExport(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -181,7 +181,7 @@ func TestSQLExport(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},diff --git a/backend/tests/sql_query_test.go b/backend/tests/sql_query_test.goindex 7738d4d67c..12f1b37d45 100644--- a/backend/tests/sql_query_test.go+++ b/backend/tests/sql_query_test.go@@ -123,7 +123,7 @@ func TestSQLAdminQuery(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -136,7 +136,7 @@ func TestSQLAdminQuery(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},diff --git a/backend/tests/sql_review_test.go b/backend/tests/sql_review_test.goindex 7e9862dace..f9bd05e8cf 100644--- a/backend/tests/sql_review_test.go+++ b/backend/tests/sql_review_test.go@@ -145,7 +145,7 @@ func TestSQLReviewForPostgreSQL(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},@@ -312,7 +312,7 @@ func TestSQLReviewForMySQL(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},diff --git a/backend/tests/sql_stop_on_error_test.go b/backend/tests/sql_stop_on_error_test.goindex 8e57236932..f1ca2edeaf 100644--- a/backend/tests/sql_stop_on_error_test.go+++ b/backend/tests/sql_stop_on_error_test.go@@ -117,7 +117,7 @@ func TestSQLQueryStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -130,7 +130,7 @@ func TestSQLQueryStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},@@ -144,7 +144,7 @@ func TestSQLQueryStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlTestInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -157,7 +157,7 @@ func TestSQLQueryStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "pgTestInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/test"),+ Environment: new("environments/test"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},@@ -322,7 +322,7 @@ func TestSQLAdminExecuteStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "root", Password: "root-password", Id: "admin"}},},@@ -335,7 +335,7 @@ func TestSQLAdminExecuteStopOnError(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "postgres", Password: "root-password", Id: "admin"}},},diff --git a/backend/tests/sync_schema_test.go b/backend/tests/sync_schema_test.goindex cb6c62398d..53dc7a6ddc 100644--- a/backend/tests/sync_schema_test.go+++ b/backend/tests/sync_schema_test.go@@ -56,7 +56,7 @@ func TestSyncSchema(t *testing.T) {Instance: &v1pb.Instance{Title: "pgTestSyncSchema",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},@@ -198,7 +198,7 @@ func TestSyncSchemaWithTempSchema(t *testing.T) {Instance: &v1pb.Instance{Title: "pgTestSyncSchemaWithTemp",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "testuser", Password: "testpass", Id: "admin"}},},diff --git a/backend/tests/syncer_test.go b/backend/tests/syncer_test.goindex 88223c30a7..d9e12fbc2f 100644--- a/backend/tests/syncer_test.go+++ b/backend/tests/syncer_test.go@@ -209,7 +209,7 @@ func TestSyncerForPostgreSQL(t *testing.T) {Instance: &v1pb.Instance{Title: "pgInstance",Engine: v1pb.Engine_POSTGRES,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: pgContainer.host, Port: pgContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},@@ -492,7 +492,7 @@ func TestSyncerForMySQL(t *testing.T) {Instance: &v1pb.Instance{Title: "mysqlInstance",Engine: v1pb.Engine_MYSQL,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: mysqlContainer.host, Port: mysqlContainer.port, Username: "bytebase", Password: "bytebase", Id: "admin"}},},diff --git a/backend/tests/task_run_idempotent_test.go b/backend/tests/task_run_idempotent_test.goindex 247c80f0f9..7b37527fbc 100644--- a/backend/tests/task_run_idempotent_test.go+++ b/backend/tests/task_run_idempotent_test.go@@ -33,7 +33,7 @@ func TestBatchRunTasks_Idempotent(t *testing.T) {Instance: &v1pb.Instance{Title: instanceName,Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},},diff --git a/backend/tests/tenant_test.go b/backend/tests/tenant_test.goindex a9908da50c..9e5c0df660 100644--- a/backend/tests/tenant_test.go+++ b/backend/tests/tenant_test.go@@ -62,7 +62,7 @@ func TestTenantBackfill(t *testing.T) {Instance: &v1pb.Instance{Title: "prod-instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: prodInstanceDir, Id: "admin"}},},diff --git a/backend/tests/webhook_test.go b/backend/tests/webhook_test.goindex 43b3f7ba85..05671940a0 100644--- a/backend/tests/webhook_test.go+++ b/backend/tests/webhook_test.go@@ -168,7 +168,7 @@ func TestWebhookIntegration(t *testing.T) {Instance: &v1pb.Instance{Title: "test instance",Engine: v1pb.Engine_SQLITE,- Environment: stringPtr("environments/prod"),+ Environment: new("environments/prod"),Activation: true,DataSources: []*v1pb.DataSource{{Type: v1pb.DataSourceType_ADMIN, Host: instanceDir, Id: "admin"}},},