Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
refactor: update pointer usages with new() (#2251)
Kyle Mendell5e572e57ad2c
diff --git a/backend/cli/upgrade/upgrade.go b/backend/cli/upgrade/upgrade.goindex 72320ab25..2b5412597 100644--- a/backend/cli/upgrade/upgrade.go+++ b/backend/cli/upgrade/upgrade.go@@ -414,8 +414,7 @@ func upgradeContainer(ctx context.Context, dockerClient *client.Client, oldContafmt.Println("PROGRESS:70:Stopping old container")slog.Info("Stopping old container", "name", oldName)- timeout := 10- if _, err := dockerClient.ContainerStop(ctx, oldContainer.ID, client.ContainerStopOptions{Timeout: &timeout}); err != nil {+ if _, err := dockerClient.ContainerStop(ctx, oldContainer.ID, client.ContainerStopOptions{Timeout: new(10)}); err != nil {_, _ = dockerClient.ContainerRename(ctx, oldContainer.ID, client.ContainerRenameOptions{NewName: originalName})return fmt.Errorf("stop old container: %w", err)}diff --git a/backend/internal/bootstrap/edge_bootstrap.go b/backend/internal/bootstrap/edge_bootstrap.goindex f46507bd3..f2826c60a 100644--- a/backend/internal/bootstrap/edge_bootstrap.go+++ b/backend/internal/bootstrap/edge_bootstrap.go@@ -118,13 +118,12 @@ func createEdgeConnectionEvent(ctx context.Context, eventService *services.Eventseverity = models.EventSeveritySuccess}- resourceType := "environment"_, err := eventService.CreateEvent(ctx, services.CreateEventRequest{Type: eventType,Severity: severity,Title: title,Description: description,- ResourceType: &resourceType,+ ResourceType: new("environment"),ResourceID: &envID,ResourceName: &envName,EnvironmentID: &envID,diff --git a/backend/internal/huma/handlers/dashboard_test.go b/backend/internal/huma/handlers/dashboard_test.goindex a7dbaf46b..674f62c0c 100644--- a/backend/internal/huma/handlers/dashboard_test.go+++ b/backend/internal/huma/handlers/dashboard_test.go@@ -97,7 +97,6 @@ func TestDashboardHandlerGetDashboardReturnsSnapshot(t *testing.T) {{ID: "sha256:image-b", RepoTags: []string{"repo/worker:latest"}, Created: 1720000000, Size: 250},}- expiresSoon := time.Now().Add(12 * time.Hour)require.NoError(t, db.WithContext(context.Background()).Create(&models.ImageUpdateRecord{ID: "sha256:image-b",HasUpdate: true,@@ -107,7 +106,7 @@ func TestDashboardHandlerGetDashboardReturnsSnapshot(t *testing.T) {KeyHash: "hash-soon",KeyPrefix: "arc_test_handler",UserID: "user-1",- ExpiresAt: &expiresSoon,+ ExpiresAt: new(time.Now().Add(12 * time.Hour)),}).Error)dockerSvc := newDashboardHandlerTestDockerService(t, settingsSvc, containers, images)diff --git a/backend/internal/huma/handlers/environments.go b/backend/internal/huma/handlers/environments.goindex f57da6a3b..92026dd0d 100644--- a/backend/internal/huma/handlers/environments.go+++ b/backend/internal/huma/handlers/environments.go@@ -709,8 +709,7 @@ func (h *EnvironmentHandler) TestConnection(ctx context.Context, input *TestConnstatus, err := h.environmentService.TestConnection(ctx, input.ID, apiUrl)resp := environment.Test{Status: status}if err != nil {- msg := err.Error()- resp.Message = &msg+ resp.Message = new(err.Error())return &TestConnectionOutput{Body: base.ApiResponse[environment.Test]{Success: false,diff --git a/backend/internal/huma/handlers/events.go b/backend/internal/huma/handlers/events.goindex a4774bf14..698b65d53 100644--- a/backend/internal/huma/handlers/events.go+++ b/backend/internal/huma/handlers/events.go@@ -235,8 +235,7 @@ func (h *EventHandler) CreateEvent(ctx context.Context, input *CreateEventInput)return nil, huma.Error401Unauthorized("invalid environment API key")}if resolvedEnvironmentID != nil && *resolvedEnvironmentID != "" {- environmentID := *resolvedEnvironmentID- input.Body.EnvironmentID = &environmentID+ input.Body.EnvironmentID = new(*resolvedEnvironmentID)}}diff --git a/backend/internal/huma/handlers/swarm.go b/backend/internal/huma/handlers/swarm.goindex ab26389b0..3731c76f9 100644--- a/backend/internal/huma/handlers/swarm.go+++ b/backend/internal/huma/handlers/swarm.go@@ -1978,26 +1978,21 @@ func (h *SwarmHandler) auditSwarmMutation(ctx context.Context, environmentID, acvar userID *stringvar username *stringif user, ok := humamw.GetCurrentUserFromContext(ctx); ok {- uid := user.ID- uname := user.Username- userID = &uid- username = &uname+ userID = new(user.ID)+ username = new(user.Username)}var resourceTypePtr *stringif strings.TrimSpace(resourceType) != "" {- rt := resourceType- resourceTypePtr = &rt+ resourceTypePtr = new(resourceType)}var resourceIDPtr *stringif strings.TrimSpace(resourceID) != "" {- rid := resourceID- resourceIDPtr = &rid+ resourceIDPtr = new(resourceID)}var resourceNamePtr *stringif strings.TrimSpace(resourceName) != "" {- rn := resourceName- resourceNamePtr = &rn+ resourceNamePtr = new(resourceName)}env := strings.TrimSpace(environmentID)diff --git a/backend/internal/huma/handlers/users.go b/backend/internal/huma/handlers/users.goindex 115287a61..c4b67eeaf 100644--- a/backend/internal/huma/handlers/users.go+++ b/backend/internal/huma/handlers/users.go@@ -314,8 +314,7 @@ func (h *UserHandler) UpdateUser(ctx context.Context, input *UpdateUserInput) (*userModel.PasswordHash = hashedPassword}- now := time.Now()- userModel.UpdatedAt = &now+ userModel.UpdatedAt = new(time.Now())updatedUser, err := h.userService.UpdateUser(ctx, userModel)if err != nil {diff --git a/backend/internal/middleware/auth_middleware.go b/backend/internal/middleware/auth_middleware.goindex 1693f28ed..8714c2142 100644--- a/backend/internal/middleware/auth_middleware.go+++ b/backend/internal/middleware/auth_middleware.go@@ -196,10 +196,9 @@ func isPreflight(c *gin.Context) bool {}func agentSudo(c *gin.Context) {- email := "[email protected]"agentUser := &models.User{BaseModel: models.BaseModel{ID: "agent"},- Email: &email,+ Email: new("[email protected]"),Roles: []string{"admin"},}c.Set("userID", agentUser.ID)diff --git a/backend/internal/models/base.go b/backend/internal/models/base.goindex a9dd5351c..884d59ff2 100644--- a/backend/internal/models/base.go+++ b/backend/internal/models/base.go@@ -26,8 +26,7 @@ func (m *BaseModel) BeforeCreate(_ *gorm.DB) (err error) {}func (m *BaseModel) BeforeUpdate(_ *gorm.DB) (err error) {- now := time.Now()- m.UpdatedAt = &now+ m.UpdatedAt = new(time.Now())return nil}diff --git a/backend/internal/models/settings.go b/backend/internal/models/settings.goindex 1bdf6b848..ec2e9096a 100644--- a/backend/internal/models/settings.go+++ b/backend/internal/models/settings.go@@ -214,8 +214,7 @@ func (s *Settings) Clone() *Settings {return &Settings{}}- clone := *s- return &clone+ return new(*s)}func (s *Settings) ToSettingVariableSlice(showAll bool, redactSensitiveValues bool) []SettingVariable {diff --git a/backend/internal/services/api_key_service.go b/backend/internal/services/api_key_service.goindex e7fee5f10..9a2255207 100644--- a/backend/internal/services/api_key_service.go+++ b/backend/internal/services/api_key_service.go@@ -36,8 +36,7 @@ const ()var defaultAdminAPIKeyDescription = func() *string {- description := "Environment-managed static API key for the built-in admin account"- return &description+ return new("Environment-managed static API key for the built-in admin account")}()type ApiKeyService struct {@@ -169,11 +168,10 @@ func toAPIKeyDTOInternal(ak *models.ApiKey) apikey.ApiKey {}func (s *ApiKeyService) CreateDefaultAdminAPIKey(ctx context.Context, userID, rawKey string) (*apikey.ApiKeyCreatedDto, error) {- managedBy := managedByAdminBootstrapreturn s.createAPIKeyWithRawKey(ctx, userID, rawKey, apikey.CreateApiKey{Name: defaultAdminAPIKeyName,Description: defaultAdminAPIKeyDescription,- }, &managedBy, nil)+ }, new(managedByAdminBootstrap), nil)}func (s *ApiKeyService) getDefaultAdminUser(ctx context.Context) (*models.User, error) {@@ -254,13 +252,12 @@ func (s *ApiKeyService) createManagedDefaultAdminAPIKey(tx *gorm.DB, userID, rawreturn fmt.Errorf("failed to hash API key: %w", err)}- managedBy := managedByAdminBootstrapak := &models.ApiKey{Name: defaultAdminAPIKeyName,Description: defaultAdminAPIKeyDescription,KeyHash: keyHash,KeyPrefix: keyPrefix,- ManagedBy: &managedBy,+ ManagedBy: new(managedByAdminBootstrap),UserID: userID,}@@ -319,11 +316,9 @@ func (s *ApiKeyService) CreateEnvironmentApiKey(ctx context.Context, environmentenvIDShort = environmentID[:8]}name := fmt.Sprintf("Environment Bootstrap Key - %s", envIDShort)- description := "Auto-generated key for environment pairing"-return s.createAPIKeyWithRawKey(ctx, userID, rawKey, apikey.CreateApiKey{Name: name,- Description: &description,+ Description: new("Auto-generated key for environment pairing"),}, nil, &environmentID)}diff --git a/backend/internal/services/api_key_service_test.go b/backend/internal/services/api_key_service_test.goindex 57c4f0e01..f7b6cbf71 100644--- a/backend/internal/services/api_key_service_test.go+++ b/backend/internal/services/api_key_service_test.go@@ -191,11 +191,9 @@ func TestUpdateApiKeyRejectsStaticKey(t *testing.T) {created, err := service.CreateDefaultAdminAPIKey(ctx, adminUser.ID, "arc_bootstrapupdateprotected1234567890")require.NoError(t, err)- name := "renamed"- description := "updated description"updated, err := service.UpdateApiKey(ctx, created.ApiKey.ID, apikey.UpdateApiKey{- Name: &name,- Description: &description,+ Name: new("renamed"),+ Description: new("updated description"),})require.Nil(t, updated)require.ErrorIs(t, err, ErrApiKeyProtected)diff --git a/backend/internal/services/auth_service_test.go b/backend/internal/services/auth_service_test.goindex 0343075b0..cb7161839 100644--- a/backend/internal/services/auth_service_test.go+++ b/backend/internal/services/auth_service_test.go@@ -76,13 +76,11 @@ func TestVerifyToken_ValidClaims(t *testing.T) {s.userService = userSvc// Create user in DB- email := "[email protected]"- displayName := "Alice"user := &models.User{BaseModel: models.BaseModel{ID: "u123"},Username: "alice",- Email: &email,- DisplayName: &displayName,+ Email: new("[email protected]"),+ DisplayName: new("Alice"),Roles: models.StringSlice{"user", "admin"},}_, err := userSvc.CreateUser(context.Background(), user)diff --git a/backend/internal/services/build_service.go b/backend/internal/services/build_service.goindex 3d5678fc2..4b867a109 100644--- a/backend/internal/services/build_service.go+++ b/backend/internal/services/build_service.go@@ -125,8 +125,6 @@ func (s *BuildService) BuildImage(ctx context.Context, environmentID string, req}completedAt := time.Now()- durationMs := completedAt.Sub(startedAt).Milliseconds()-if cleanupErr := cleanupResolvedContext(); cleanupErr != nil {slog.WarnContext(ctx, "failed to cleanup temporary git build context", "error", cleanupErr)}@@ -153,11 +151,10 @@ func (s *BuildService) BuildImage(ctx context.Context, environmentID string, reqvar errMsg *stringif err != nil {status = models.ImageBuildStatusFailed- msg := err.Error()- errMsg = &msg+ errMsg = new(err.Error())}- if updateErr := s.completeBuildRecord(ctx, buildRecordID, status, outputPtr, logCapture.Truncated(), errMsg, digest, provider, completedAt, &durationMs); updateErr != nil {+ if updateErr := s.completeBuildRecord(ctx, buildRecordID, status, outputPtr, logCapture.Truncated(), errMsg, digest, provider, completedAt, new(completedAt.Sub(startedAt).Milliseconds())); updateErr != nil {slog.WarnContext(ctx, "failed to update build history record", "error", updateErr)}}@@ -348,8 +345,7 @@ func (s *BuildService) GetImageBuildByID(ctx context.Context, environmentID, buireturn nil, err}- record := buildToRecord(build, true)- return &record, nil+ return new(buildToRecord(build, true)), nil}func (s *BuildService) createBuildRecord(ctx context.Context, environmentID string, req imagetypes.BuildRequest, user *models.User) (*models.ImageBuild, error) {diff --git a/backend/internal/services/container_registry_service_test.go b/backend/internal/services/container_registry_service_test.goindex 3de11728e..a3339736f 100644--- a/backend/internal/services/container_registry_service_test.go+++ b/backend/internal/services/container_registry_service_test.go@@ -188,9 +188,8 @@ func TestContainerRegistryService_UpdateRegistry_RejectsBlankingUsername(t *test})require.NoError(t, err)- empty := ""_, err = svc.UpdateRegistry(context.Background(), reg.ID, models.UpdateContainerRegistryRequest{- Username: &empty,+ Username: new(""),})require.Error(t, err)@@ -211,9 +210,8 @@ func TestContainerRegistryService_UpdateRegistry_KeepsExistingTokenWhenNotProvidrequire.NoError(t, err)originalToken := reg.Token- newUser := "updated-user"updated, err := svc.UpdateRegistry(context.Background(), reg.ID, models.UpdateContainerRegistryRequest{- Username: &newUser,+ Username: new("updated-user"),})require.NoError(t, err)assert.Equal(t, "updated-user", updated.Username)@@ -231,9 +229,8 @@ func TestContainerRegistryService_UpdateRegistry_RejectsChangingRegistryType(t *})require.NoError(t, err)- ecrType := "ecr"_, err = svc.UpdateRegistry(context.Background(), reg.ID, models.UpdateContainerRegistryRequest{- RegistryType: &ecrType,+ RegistryType: new("ecr"),})require.Error(t, err)@@ -253,11 +250,9 @@ func TestContainerRegistryService_UpdateRegistry_AllowsSameRegistryType(t *testi})require.NoError(t, err)- genericType := "generic"- newUser := "updated-user"updated, err := svc.UpdateRegistry(context.Background(), reg.ID, models.UpdateContainerRegistryRequest{- RegistryType: &genericType,- Username: &newUser,+ RegistryType: new("generic"),+ Username: new("updated-user"),})require.NoError(t, err)assert.Equal(t, "updated-user", updated.Username)diff --git a/backend/internal/services/container_service.go b/backend/internal/services/container_service.goindex af34c58c8..5d783d8c3 100644--- a/backend/internal/services/container_service.go+++ b/backend/internal/services/container_service.go@@ -183,8 +183,7 @@ func (s *ContainerService) prepareContainerForRedeployInternal(ctx context.Contereturn nil}- timeout := 30- _, err := dockerClient.ContainerStop(ctx, containerID, client.ContainerStopOptions{Timeout: &timeout})+ _, err := dockerClient.ContainerStop(ctx, containerID, client.ContainerStopOptions{Timeout: new(30)})if err == nil {return nil}@@ -270,8 +269,7 @@ func (s *ContainerService) StopContainer(ctx context.Context, containerID stringreturn fmt.Errorf("failed to log action: %w", err)}- timeout := 30- _, err = dockerClient.ContainerStop(ctx, containerID, client.ContainerStopOptions{Timeout: &timeout})+ _, err = dockerClient.ContainerStop(ctx, containerID, client.ContainerStopOptions{Timeout: new(30)})if err != nil {s.eventService.LogErrorEvent(ctx, models.EventTypeContainerError, "container", containerID, "", user.ID, user.Username, "0", err, models.JSON{"action": "stop"})}@@ -433,8 +431,7 @@ func (s *ContainerService) GetContainerByReference(ctx context.Context, ref strireturn nil, fmt.Errorf("container not found: %w", err)}- containerInfo := containerInspect.Container- return &containerInfo, nil+ return new(containerInspect.Container), nil}func (s *ContainerService) GetContainerByID(ctx context.Context, id string) (*container.InspectResponse, error) {@@ -581,8 +578,7 @@ func (s *ContainerService) CreateContainer(ctx context.Context, config *containereturn nil, fmt.Errorf("failed to inspect created container: %w", err)}- containerInfo := containerJSON.Container- return &containerInfo, nil+ return new(containerJSON.Container), nil}func (s *ContainerService) StreamStats(ctx context.Context, containerID string, statsChan chan<- any) error {diff --git a/backend/internal/services/dashboard_service_test.go b/backend/internal/services/dashboard_service_test.goindex 3516f496e..f1f6db0e8 100644--- a/backend/internal/services/dashboard_service_test.go+++ b/backend/internal/services/dashboard_service_test.go@@ -86,30 +86,26 @@ func TestDashboardService_GetActionItems_IncludesExpiringAPIKeys(t *testing.T) {svc := NewDashboardService(db, nil, nil, settingsSvc, nil)now := time.Now()- expiringSoon := now.Add(24 * time.Hour)- alreadyExpired := now.Add(-24 * time.Hour)- farFuture := now.Add(45 * 24 * time.Hour)-createDashboardTestAPIKey(t, db, models.ApiKey{Name: "expiring-soon",KeyHash: "hash-soon",KeyPrefix: "arc_test_s",UserID: "user-1",- ExpiresAt: &expiringSoon,+ ExpiresAt: new(now.Add(24 * time.Hour)),})createDashboardTestAPIKey(t, db, models.ApiKey{Name: "already-expired",KeyHash: "hash-expired",KeyPrefix: "arc_test_e",UserID: "user-1",- ExpiresAt: &alreadyExpired,+ ExpiresAt: new(now.Add(-24 * time.Hour)),})createDashboardTestAPIKey(t, db, models.ApiKey{Name: "future",KeyHash: "hash-future",KeyPrefix: "arc_test_f",UserID: "user-1",- ExpiresAt: &farFuture,+ ExpiresAt: new(now.Add(45 * 24 * time.Hour)),})createDashboardTestAPIKey(t, db, models.ApiKey{Name: "never-expires",@@ -133,13 +129,12 @@ func TestDashboardService_GetActionItems_DebugAllGoodReturnsNoItems(t *testing.Tdb, settingsSvc := setupDashboardServiceTestDB(t)svc := NewDashboardService(db, nil, nil, settingsSvc, nil)- expiresAt := time.Now().Add(2 * time.Hour)createDashboardTestAPIKey(t, db, models.ApiKey{Name: "expiring-soon",KeyHash: "hash-soon",KeyPrefix: "arc_test_d",UserID: "user-1",- ExpiresAt: &expiresAt,+ ExpiresAt: new(time.Now().Add(2 * time.Hour)),})actionItems, err := svc.GetActionItems(context.Background(), DashboardActionItemsOptions{@@ -195,13 +190,12 @@ func TestDashboardService_GetSnapshot_ReturnsDashboardSnapshot(t *testing.T) {createDashboardTestImageUpdateRecord(t, db, models.ImageUpdateRecord{ID: "sha256:image-b", HasUpdate: true})- expiresSoon := time.Now().Add(12 * time.Hour)createDashboardTestAPIKey(t, db, models.ApiKey{Name: "expiring-soon",KeyHash: "hash-soon",KeyPrefix: "arc_test_snapshot",UserID: "user-1",- ExpiresAt: &expiresSoon,+ ExpiresAt: new(time.Now().Add(12 * time.Hour)),})dockerSvc := newDashboardTestDockerService(t, settingsSvc, containers, images)diff --git a/backend/internal/services/environment_service.go b/backend/internal/services/environment_service.goindex 658d3fd11..abc20af6f 100644--- a/backend/internal/services/environment_service.go+++ b/backend/internal/services/environment_service.go@@ -329,8 +329,6 @@ func (s *EnvironmentService) EnsureSwarmNodeAgentEnvironment(}if errors.Is(err, gorm.ErrRecordNotFound) {- parentEnvironmentIDCopy := parentEnvironmentID- nodeIDCopy := nodeIDcreatedEnv := &models.Environment{Name: buildSwarmNodeAgentNameInternal(hostname, nodeID),ApiUrl: buildSwarmNodeAgentURLInternal(nodeID),@@ -338,13 +336,11 @@ func (s *EnvironmentService) EnsureSwarmNodeAgentEnvironment(Enabled: true,IsEdge: true,Hidden: true,- ParentEnvironmentID: &parentEnvironmentIDCopy,- SwarmNodeID: &nodeIDCopy,+ ParentEnvironmentID: new(parentEnvironmentID),+ SwarmNodeID: new(nodeID),}- userIDCopy := userID- usernameCopy := username- if _, createErr := s.CreateEnvironment(ctx, createdEnv, &userIDCopy, &usernameCopy); createErr != nil {+ if _, createErr := s.CreateEnvironment(ctx, createdEnv, new(userID), new(username)); createErr != nil {return nil, "", fmt.Errorf("failed to create swarm node agent environment: %w", createErr)}env = *createdEnv@@ -370,9 +366,7 @@ func (s *EnvironmentService) EnsureSwarmNodeAgentEnvironment(updates["swarm_node_id"] = nodeID}if len(updates) > 0 {- userIDCopy := userID- usernameCopy := username- updatedEnv, updateErr := s.UpdateEnvironment(ctx, env.ID, updates, &userIDCopy, &usernameCopy)+ updatedEnv, updateErr := s.UpdateEnvironment(ctx, env.ID, updates, new(userID), new(username))if updateErr != nil {return nil, "", fmt.Errorf("failed to update swarm node agent environment: %w", updateErr)}@@ -394,10 +388,9 @@ func (s *EnvironmentService) EnsureSwarmNodeAgentEnvironment(}func (s *EnvironmentService) UpdateSwarmNodeIdentity(ctx context.Context, envID, swarmNodeID string) error {- now := time.Now()updates := map[string]any{"swarm_node_id": swarmNodeID,- "updated_at": &now,+ "updated_at": new(time.Now()),}if err := s.db.WithContext(ctx).Model(&models.Environment{}).Where("id = ?", envID).Updates(updates).Error; err != nil {@@ -499,8 +492,7 @@ func (s *EnvironmentService) SyncRegistriesToRemoteEnvironments(ctx context.Cont}func (s *EnvironmentService) UpdateEnvironment(ctx context.Context, id string, updates map[string]any, userID, username *string) (*models.Environment, error) {- now := time.Now()- updates["updated_at"] = &now+ updates["updated_at"] = new(time.Now())if err := s.db.WithContext(ctx).Model(&models.Environment{}).Where("id = ?", id).Updates(updates).Error; err != nil {return nil, fmt.Errorf("failed to update environment: %w", err)@@ -713,15 +705,13 @@ func (s *EnvironmentService) UpdateEnvironmentConnectionState(ctx context.Contex// Live edge tunnels are process-local runtime state, so persisted "online" flags can be stale// after a restart until agents reconnect. Pending environments are left untouched.func (s *EnvironmentService) ReconcileEdgeStatusesOnStartup(ctx context.Context) error {- now := time.Now()-result := s.db.WithContext(ctx).Model(&models.Environment{}).Where("is_edge = ?", true).Where("status <> ?", string(models.EnvironmentStatusPending)).Where("status <> ?", string(models.EnvironmentStatusOffline)).Updates(map[string]any{"status": string(models.EnvironmentStatusOffline),- "updated_at": &now,+ "updated_at": new(time.Now()),})if result.Error != nil {return fmt.Errorf("failed to reconcile edge environment statuses: %w", result.Error)diff --git a/backend/internal/services/environment_service_test.go b/backend/internal/services/environment_service_test.goindex ce4a5aba8..6a46798e4 100644--- a/backend/internal/services/environment_service_test.go+++ b/backend/internal/services/environment_service_test.go@@ -227,7 +227,6 @@ func TestEnvironmentService_SyncRegistriesToEnvironment_IncludesECRFields(t *tescreateTestECRRegistry(t, db, "reg-ecr")- token := "token-1"server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {require.Equal(t, http.MethodPost, r.Method)require.Equal(t, "/api/container-registries/sync", r.URL.Path)@@ -250,7 +249,7 @@ func TestEnvironmentService_SyncRegistriesToEnvironment_IncludesECRFields(t *tes}))defer server.Close()- createTestEnvironment(t, db, "env-1", server.URL, &token)+ createTestEnvironment(t, db, "env-1", server.URL, new("token-1"))err := svc.SyncRegistriesToEnvironment(ctx, "env-1")require.NoError(t, err)@@ -264,7 +263,6 @@ func TestEnvironmentService_SyncRegistriesToRemoteEnvironments_SkipsRemoteWithoucreateTestRegistry(t, db, "reg-1")var syncCalls atomic.Int32- token := "token-with-auth"server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {syncCalls.Add(1)w.Header().Set("Content-Type", "application/json")@@ -272,7 +270,7 @@ func TestEnvironmentService_SyncRegistriesToRemoteEnvironments_SkipsRemoteWithou}))defer server.Close()- createTestEnvironment(t, db, "env-auth", server.URL, &token)+ createTestEnvironment(t, db, "env-auth", server.URL, new("token-with-auth"))createTestEnvironment(t, db, "env-no-token", "http://127.0.0.1:1", nil)err := svc.SyncRegistriesToRemoteEnvironments(ctx)@@ -288,7 +286,6 @@ func TestEnvironmentService_SyncRegistriesToRemoteEnvironments_ReportsFailuresBucreateTestRegistry(t, db, "reg-1")var successCalls atomic.Int32- successToken := "token-success"successServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {successCalls.Add(1)w.Header().Set("Content-Type", "application/json")@@ -296,9 +293,8 @@ func TestEnvironmentService_SyncRegistriesToRemoteEnvironments_ReportsFailuresBu}))defer successServer.Close()- failingToken := "token-fail"- createTestEnvironment(t, db, "env-success", successServer.URL, &successToken)- createTestEnvironment(t, db, "env-fail", "http://127.0.0.1:1", &failingToken)+ createTestEnvironment(t, db, "env-success", successServer.URL, new("token-success"))+ createTestEnvironment(t, db, "env-fail", "http://127.0.0.1:1", new("token-fail"))err := svc.SyncRegistriesToRemoteEnvironments(ctx)require.Error(t, err)@@ -568,11 +564,8 @@ func TestEnvironmentService_ListMethods_ExcludeHiddenEnvironments(t *testing.T)svc := NewEnvironmentService(db, nil, nil, nil, nil, nil)createTestEnvironment(t, db, "0", "http://localhost:3552", nil)- visibleToken := "visible-token"- hiddenToken := "hidden-token"-- createNamedTestEnvironmentInternal(t, db, "env-visible", "Visible Remote", "http://visible.example", &visibleToken)- createNamedTestEnvironmentInternal(t, db, "env-hidden", "Hidden Node Agent", "edge://swarm-node-hidden", &hiddenToken)+ createNamedTestEnvironmentInternal(t, db, "env-visible", "Visible Remote", "http://visible.example", new("visible-token"))+ createNamedTestEnvironmentInternal(t, db, "env-hidden", "Hidden Node Agent", "edge://swarm-node-hidden", new("hidden-token"))require.NoError(t, db.WithContext(ctx).Model(&models.Environment{}).diff --git a/backend/internal/services/event_service.go b/backend/internal/services/event_service.goindex 619c1d22f..3b8c06355 100644--- a/backend/internal/services/event_service.go+++ b/backend/internal/services/event_service.go@@ -256,10 +256,8 @@ func normalizeEventActor(userID, username *string) (*string, *string) {normalizedUserID = copyOptionalStringPtr(normalizedUsername)}if normalizedUserID == nil && normalizedUsername == nil {- systemID := "system"- systemName := "System"- normalizedUserID = &systemID- normalizedUsername = &systemName+ normalizedUserID = new("system")+ normalizedUsername = new("System")}return normalizedUserID, normalizedUsername@@ -280,8 +278,7 @@ func copyOptionalStringPtr(value *string) *string {if value == nil {return nil}- cloned := *value- return &cloned+ return new(*value)}func (s *EventService) CreateEventFromDto(ctx context.Context, req event.CreateEvent) (*event.Event, error) {diff --git a/backend/internal/services/event_service_test.go b/backend/internal/services/event_service_test.goindex d9926595f..d90dd6597 100644--- a/backend/internal/services/event_service_test.go+++ b/backend/internal/services/event_service_test.go@@ -208,13 +208,12 @@ func TestEventService_CreateEvent_ForwardsToManagerAPIInAgentMode(t *testing.T)}svc := NewEventService(db, cfg, server.Client())- envID := "0"_, err := svc.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeContainerStart,Severity: models.EventSeverityInfo,Title: "Container started: web",Description: "Container 'web' has been started",- EnvironmentID: &envID,+ EnvironmentID: new("0"),Metadata: models.JSON{"source": "test"},})require.NoError(t, err)@@ -251,12 +250,11 @@ func TestEventService_CreateEvent_NormalizesActor(t *testing.T) {})t.Run("copies user id to username when username is missing", func(t *testing.T) {- uid := "u-123"evt, err := svc.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeProjectDeploy,Severity: models.EventSeverityInfo,Title: "Deploy",- UserID: &uid,+ UserID: new("u-123"),})require.NoError(t, err)require.NotNil(t, evt.UserID)@@ -266,12 +264,11 @@ func TestEventService_CreateEvent_NormalizesActor(t *testing.T) {})t.Run("copies username to user id when user id is missing", func(t *testing.T) {- name := "kmendell"evt, err := svc.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeProjectDeploy,Severity: models.EventSeverityInfo,Title: "Deploy",- Username: &name,+ Username: new("kmendell"),})require.NoError(t, err)require.NotNil(t, evt.UserID)diff --git a/backend/internal/services/git_repository_service.go b/backend/internal/services/git_repository_service.goindex 5043c6587..6228fa925 100644--- a/backend/internal/services/git_repository_service.go+++ b/backend/internal/services/git_repository_service.go@@ -112,8 +112,7 @@ func (s *GitRepositoryService) FindEnabledRepositoryByURL(ctx context.Context, rfor i := range repositories {if libbuild.NormalizeGitBuildContextSourceForMatch(repositories[i].URL) == normalizedURL {- repository := repositories[i]- return &repository, nil+ return new(repositories[i]), nil}}diff --git a/backend/internal/services/gitops_sync_service.go b/backend/internal/services/gitops_sync_service.goindex ab3043bd3..36b835c2b 100644--- a/backend/internal/services/gitops_sync_service.go+++ b/backend/internal/services/gitops_sync_service.go@@ -928,8 +928,7 @@ func marshalSyncedFiles(files []string) *string {if err != nil {return nil}- result := string(data)- return &result+ return new(string(data))}// walkAndParseSyncDirectory walks the repository directory and returns all files with their contents.diff --git a/backend/internal/services/job_service.go b/backend/internal/services/job_service.goindex 7eebe21d4..f95dc1919 100644--- a/backend/internal/services/job_service.go+++ b/backend/internal/services/job_service.go@@ -294,6 +294,5 @@ func (s *JobService) calculateNextRunInternal(schedule string) *time.Time {// Calculate next run using the configured timezone.now := time.Now().In(location)- nextRun := sched.Next(now)- return &nextRun+ return new(sched.Next(now))}diff --git a/backend/internal/services/network_service.go b/backend/internal/services/network_service.goindex 39e4d4066..eb76a9c98 100644--- a/backend/internal/services/network_service.go+++ b/backend/internal/services/network_service.go@@ -43,8 +43,7 @@ func (s *NetworkService) GetNetworkByID(ctx context.Context, id string) (*networreturn nil, fmt.Errorf("network not found: %w", err)}- inspect := networkInspect.Network- return &inspect, nil+ return new(networkInspect.Network), nil}func (s *NetworkService) GetNetworkTopology(ctx context.Context) (*networktypes.Topology, error) {diff --git a/backend/internal/services/project_service_test.go b/backend/internal/services/project_service_test.goindex 418ec2d62..8c389c871 100644--- a/backend/internal/services/project_service_test.go+++ b/backend/internal/services/project_service_test.go@@ -502,8 +502,7 @@ func TestProjectService_UpdateProject_RenamesDirectoryWhenNameChanges(t *testing}require.NoError(t, db.Create(project).Error)- updatedName := "bar"- updated, err := svc.UpdateProject(ctx, project.ID, &updatedName, nil, nil, models.User{+ updated, err := svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -554,8 +553,7 @@ func TestProjectService_UpdateProject_RenameFailsWhenTargetDirectoryExists(t *te}require.NoError(t, db.Create(project).Error)- updatedName := "bar"- _, err = svc.UpdateProject(ctx, project.ID, &updatedName, nil, nil, models.User{+ _, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -598,8 +596,7 @@ func TestProjectService_UpdateProject_RenameFailsWhenProjectRunning(t *testing.T}require.NoError(t, db.Create(project).Error)- updatedName := "bar"- _, err = svc.UpdateProject(ctx, project.ID, &updatedName, nil, nil, models.User{+ _, err = svc.UpdateProject(ctx, project.ID, new("bar"), nil, nil, models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -958,8 +955,7 @@ func TestProjectService_UpdateProject_DerivesProjectOverrideEnvWhenGitSourceExis}require.NoError(t, db.Create(project).Error)- env := "BASE=git\nTOKEN=secret\n"- updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, &env, models.User{+ updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, new("BASE=git\nTOKEN=secret\n"), models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -1006,8 +1002,7 @@ func TestProjectService_UpdateProject_DeletingGitBackedKeyFallsBackToGit(t *test}require.NoError(t, db.Create(project).Error)- env := "BASE=git\nLOCAL_ONLY=1\n"- updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, &env, models.User{+ updated, err := svc.UpdateProject(ctx, project.ID, nil, nil, new("BASE=git\nLOCAL_ONLY=1\n"), models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -1107,8 +1102,7 @@ func TestProjectService_ApplyGitSyncProjectFiles_NormalizesStaleCopiedGitOverrid}require.NoError(t, db.Create(project).Error)- gitEnv := "BASE=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"- updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", &gitEnv, models.User{+ updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", new("BASE=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"), models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -1156,8 +1150,7 @@ func TestProjectService_ApplyGitSyncProjectFiles_RemovesLegacyDeletedGitMasks(t}require.NoError(t, db.Create(project).Error)- gitEnv := "TOKEN=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"- updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", &gitEnv, models.User{+ updated, err := svc.ApplyGitSyncProjectFiles(ctx, project.ID, "services:\n app:\n image: nginx:alpine\n", new("TOKEN=git-updated\nSHARED=1\nREMOTE_ONLY=1\n"), models.User{BaseModel: models.BaseModel{ID: "u1"},Username: "tester",})@@ -1288,8 +1281,7 @@ func TestProjectService_PersistGitSyncEnvFiles_UsesPreparedState(t *testing.T) {require.NoError(t, os.WriteFile(filepath.Join(projectPath, ".env.git"), []byte("BASE=git\nTOKEN=git\n"), 0o600))require.NoError(t, os.WriteFile(filepath.Join(projectPath, "project.env"), []byte("TOKEN=local\n"), 0o600))- gitEnv := "BASE=git-updated\nTOKEN=git\nREMOTE=1\n"- update, err := svc.prepareGitSyncEnvUpdateInternal(projectPath, &gitEnv)+ update, err := svc.prepareGitSyncEnvUpdateInternal(projectPath, new("BASE=git-updated\nTOKEN=git\nREMOTE=1\n"))require.NoError(t, err)require.NotNil(t, update.effectiveContent)@@ -1565,14 +1557,13 @@ func TestProjectService_PrepareServiceBuildRequest_GeneratedImageProviderGuardrarequire.Error(t, err)assert.Contains(t, err.Error(), "must define an image when using depot")- push := true_, _, _, err = svc.prepareServiceBuildRequest(context.Background(),"project-id",proj,"web",serviceCfg,- ProjectBuildOptions{Provider: "local", Push: &push},+ ProjectBuildOptions{Provider: "local", Push: new(true)},nil,)require.Error(t, err)diff --git a/backend/internal/services/settings_service_test.go b/backend/internal/services/settings_service_test.goindex 369d0f363..5d1940456 100644--- a/backend/internal/services/settings_service_test.go+++ b/backend/internal/services/settings_service_test.go@@ -436,10 +436,8 @@ func TestSettingsService_UpdateSettings_MergeOidcSecret(t *testing.T) {}nb, err := json.Marshal(incoming)require.NoError(t, err)- s := string(nb)-updates := settings.Update{- AuthOidcConfig: &s,+ AuthOidcConfig: new(string(nb)),}_, err = svc.UpdateSettings(ctx, updates)require.NoError(t, err)@@ -546,9 +544,8 @@ func TestSettingsService_UpdateSettings_ReturnsEnvOverriddenValues(t *testing.T)require.NoError(t, err)require.NoError(t, svc.EnsureDefaultSettings(ctx))- newDir := "custom/projects2"settingsList, err := svc.UpdateSettings(ctx, settings.Update{- ProjectsDirectory: &newDir,+ ProjectsDirectory: new("custom/projects2"),})require.NoError(t, err)@@ -574,8 +571,7 @@ func TestSettingsService_UpdateSettings_TimeoutCallbackIncludesTrivyScanTimeout(callbackPayload = timeoutSettings}- newTimeout := "1200"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyScanTimeout: &newTimeout})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyScanTimeout: new("1200")})require.NoError(t, err)require.NotNil(t, callbackPayload)@@ -594,13 +590,10 @@ func TestSettingsService_UpdateSettings_TimeoutCallbackIncludesTrivyResourceLimicallbackPayload = timeoutSettings}- limitsEnabled := "false"- cpuLimit := "2.5"- memoryLimit := "3072"_, err = svc.UpdateSettings(ctx, settings.Update{- TrivyResourceLimitsEnabled: &limitsEnabled,- TrivyCpuLimit: &cpuLimit,- TrivyMemoryLimitMb: &memoryLimit,+ TrivyResourceLimitsEnabled: new("false"),+ TrivyCpuLimit: new("2.5"),+ TrivyMemoryLimitMb: new("3072"),})require.NoError(t, err)@@ -622,8 +615,7 @@ func TestSettingsService_UpdateSettings_TimeoutCallbackIncludesTrivyConcurrentSccallbackPayload = timeoutSettings}- concurrentContainers := "4"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyConcurrentScanContainers: &concurrentContainers})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyConcurrentScanContainers: new("4")})require.NoError(t, err)require.NotNil(t, callbackPayload)@@ -642,8 +634,7 @@ func TestSettingsService_UpdateSettings_TrivyNetworkTriggersVulnerabilityCallbaccallbackCalled = true}- trivyNetwork := "arcane-external"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyNetwork: &trivyNetwork})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyNetwork: new("arcane-external")})require.NoError(t, err)require.True(t, callbackCalled)}@@ -660,8 +651,7 @@ func TestSettingsService_UpdateSettings_TrivyNetworkDoesNotTriggerTimeoutCallbaccallbackPayload = timeoutSettings}- trivyNetwork := "arcane-external"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyNetwork: &trivyNetwork})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyNetwork: new("arcane-external")})require.NoError(t, err)require.Nil(t, callbackPayload)}@@ -678,11 +668,9 @@ func TestSettingsService_UpdateSettings_TrivyRuntimeSecurityTriggersVulnerabilitcallbackCalled = true}- securityOpts := "label=disable"- privileged := "true"_, err = svc.UpdateSettings(ctx, settings.Update{- TrivySecurityOpts: &securityOpts,- TrivyPrivileged: &privileged,+ TrivySecurityOpts: new("label=disable"),+ TrivyPrivileged: new("true"),})require.NoError(t, err)require.True(t, callbackCalled)@@ -700,11 +688,9 @@ func TestSettingsService_UpdateSettings_TrivyRuntimeSecurityDoesNotTriggerTimeoucallbackPayload = timeoutSettings}- securityOpts := "label=disable"- privileged := "true"_, err = svc.UpdateSettings(ctx, settings.Update{- TrivySecurityOpts: &securityOpts,- TrivyPrivileged: &privileged,+ TrivySecurityOpts: new("label=disable"),+ TrivyPrivileged: new("true"),})require.NoError(t, err)require.Nil(t, callbackPayload)@@ -717,8 +703,7 @@ func TestSettingsService_UpdateSettings_TrivyPreserveCacheOnVolumePrunePersists(require.NoError(t, err)require.NoError(t, svc.EnsureDefaultSettings(ctx))- preserveCache := "false"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyPreserveCacheOnVolumePrune: &preserveCache})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyPreserveCacheOnVolumePrune: new("false")})require.NoError(t, err)current, err := svc.GetSettings(ctx)@@ -743,8 +728,7 @@ func TestSettingsService_UpdateSettings_TrivyPreserveCacheOnVolumePruneDoesNotTrcallbackPayload = timeoutSettings}- preserveCache := "false"- _, err = svc.UpdateSettings(ctx, settings.Update{TrivyPreserveCacheOnVolumePrune: &preserveCache})+ _, err = svc.UpdateSettings(ctx, settings.Update{TrivyPreserveCacheOnVolumePrune: new("false")})require.NoError(t, err)require.Nil(t, callbackPayload)}diff --git a/backend/internal/services/swarm_service.go b/backend/internal/services/swarm_service.goindex 993d3c779..b4b51dbb1 100644--- a/backend/internal/services/swarm_service.go+++ b/backend/internal/services/swarm_service.go@@ -502,8 +502,7 @@ func (s *SwarmService) GetNode(ctx context.Context, environmentID, nodeID stringitems := []swarmtypes.NodeSummary{swarmtypes.NewNodeSummary(nodeResult.Node)}s.enrichNodeAgentStatusesInternal(ctx, environmentID, items)- out := items[0]- return &out, nil+ return new(items[0]), nil}func (s *SwarmService) GetLocalNodeIdentity(ctx context.Context) (*SwarmNodeIdentity, error) {@@ -801,8 +800,7 @@ func (s *SwarmService) ListStacksPaginated(ctx context.Context, environmentID stif _, exists := stacks[stackName]; exists {continue}- stack := persisted- stacks[stackName] = &stack+ stacks[stackName] = new(persisted)}items := make([]swarmtypes.StackSummary, 0, len(stacks))@@ -871,8 +869,7 @@ func (s *SwarmService) GetSwarmInfo(ctx context.Context) (*swarmtypes.SwarmInfo,return nil, fmt.Errorf("failed to inspect swarm: %w", err)}- out := swarmtypes.NewSwarmInfo(infoResult.Swarm)- return &out, nil+ return new(swarmtypes.NewSwarmInfo(infoResult.Swarm)), nil}func (s *SwarmService) InitSwarm(ctx context.Context, req swarmtypes.SwarmInitRequest) (*swarmtypes.SwarmInitResponse, error) {@@ -1218,13 +1215,11 @@ func (s *SwarmService) RemoveNode(ctx context.Context, nodeID string, force bool}func (s *SwarmService) PromoteNode(ctx context.Context, nodeID string) error {- role := swarm.NodeRoleManager- return s.UpdateNode(ctx, nodeID, swarmtypes.NodeUpdateRequest{Role: &role})+ return s.UpdateNode(ctx, nodeID, swarmtypes.NodeUpdateRequest{Role: new(swarm.NodeRoleManager)})}func (s *SwarmService) DemoteNode(ctx context.Context, nodeID string) error {- role := swarm.NodeRoleWorker- return s.UpdateNode(ctx, nodeID, swarmtypes.NodeUpdateRequest{Role: &role})+ return s.UpdateNode(ctx, nodeID, swarmtypes.NodeUpdateRequest{Role: new(swarm.NodeRoleWorker)})}func (s *SwarmService) ListNodeTasksPaginated(ctx context.Context, nodeID string, params pagination.QueryParams) ([]swarmtypes.TaskSummary, pagination.Response, error) {@@ -1657,8 +1652,7 @@ func (s *SwarmService) GetConfig(ctx context.Context, configID string) (*swarmtyreturn nil, fmt.Errorf("failed to inspect swarm config: %w", err)}- item := swarmtypes.NewConfigSummary(cfgResult.Config)- return &item, nil+ return new(swarmtypes.NewConfigSummary(cfgResult.Config)), nil}func (s *SwarmService) CreateConfig(ctx context.Context, req swarmtypes.ConfigCreateRequest) (*swarmtypes.ConfigSummary, error) {@@ -1744,8 +1738,7 @@ func (s *SwarmService) GetSecret(ctx context.Context, secretID string) (*swarmtyreturn nil, fmt.Errorf("failed to inspect swarm secret: %w", err)}- item := swarmtypes.NewSecretSummary(secretResult.Secret)- return &item, nil+ return new(swarmtypes.NewSecretSummary(secretResult.Secret)), nil}func (s *SwarmService) CreateSecret(ctx context.Context, req swarmtypes.SecretCreateRequest) (*swarmtypes.SecretSummary, error) {diff --git a/backend/internal/services/template_service.go b/backend/internal/services/template_service.goindex b0f294e78..0e1f1999f 100644--- a/backend/internal/services/template_service.go+++ b/backend/internal/services/template_service.go@@ -250,8 +250,7 @@ func (s *TemplateService) GetTemplate(ctx context.Context, id string) (*models.Cfor _, remoteTemplate := range copied {if remoteTemplate.ID == id {- t := remoteTemplate- return &t, nil+ return new(remoteTemplate), nil}}@@ -872,8 +871,7 @@ func cloneRegistry(registry *models.TemplateRegistry) *models.TemplateRegistry {return nil}- cloned := *registry- return &cloned+ return new(*registry)}func (s *TemplateService) invalidateRemoteCache() {diff --git a/backend/internal/services/updater_service.go b/backend/internal/services/updater_service.goindex 3418b1415..a6b729f6f 100644--- a/backend/internal/services/updater_service.go+++ b/backend/internal/services/updater_service.go@@ -1175,8 +1175,7 @@ func (s *UpdaterService) recordRun(ctx context.Context, item updater.ResourceResrec.NewImageVersions = newv}- end := time.Now()- rec.EndTime = &end+ rec.EndTime = new(time.Now())return s.db.WithContext(ctx).Create(rec).Error}@@ -1339,8 +1338,7 @@ func (s *UpdaterService) restartContainersUsingOldIDs(ctx context.Context, oldIDcontainersWithDeps[i] = libupdater.ExtractContainerDeps(ctx, dcli, cwd.Container, inspect)if p, ok := plansByName[containersWithDeps[i].Name]; ok {- inspectCopy := inspect- p.inspect = &inspectCopy+ p.inspect = new(inspect)}}}@@ -1445,8 +1443,7 @@ func (s *UpdaterService) restartContainersUsingOldIDs(ctx context.Context, oldIDcontinue}inspect := inspectResult.Container- inspectCopy := inspect- p.inspect = &inspectCopy+ p.inspect = new(inspect)// If this container belongs to a compose project that was missed during the// pre-scan (inspect was nil), register it now so the main loop routes itdiff --git a/backend/internal/services/volume_service.go b/backend/internal/services/volume_service.goindex a0be8757c..048f25850 100644--- a/backend/internal/services/volume_service.go+++ b/backend/internal/services/volume_service.go@@ -155,8 +155,7 @@ func (s *VolumeService) CreateVolume(ctx context.Context, options client.VolumeCdocker.InvalidateVolumeUsageCache()- dtoVol := volumetypes.NewSummary(vol.Volume)- return &dtoVol, nil+ return new(volumetypes.NewSummary(vol.Volume)), nil}func (s *VolumeService) DeleteVolume(ctx context.Context, name string, force bool, user models.User) error {diff --git a/backend/internal/services/vulnerability_service_test.go b/backend/internal/services/vulnerability_service_test.goindex 0f11d2e6f..6dfed9fdd 100644--- a/backend/internal/services/vulnerability_service_test.go+++ b/backend/internal/services/vulnerability_service_test.go@@ -880,14 +880,13 @@ func TestVulnerabilityService_ListAllVulnerabilities_FiltersIgnoredInline(t *tes}require.NoError(t, db.Create(&scan).Error)- reason := "accepted risk"ignore := models.VulnerabilityIgnore{EnvironmentID: "env-1",ImageID: scan.ID,VulnerabilityID: "CVE-2026-0001",PkgName: "openssl",InstalledVersion: "1.0.0",- Reason: &reason,+ Reason: new("accepted risk"),CreatedBy: "tester",}require.NoError(t, db.Create(&ignore).Error)diff --git a/backend/internal/services/webhook_service.go b/backend/internal/services/webhook_service.goindex 29918b078..52bab3f8b 100644--- a/backend/internal/services/webhook_service.go+++ b/backend/internal/services/webhook_service.go@@ -199,13 +199,12 @@ func (s *WebhookService) CreateWebhook(ctx context.Context, name, targetType, ac}if s.eventService != nil {- resourceType := "webhook"_, _ = s.eventService.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeWebhookCreate,Severity: models.EventSeveritySuccess,Title: fmt.Sprintf("Webhook created: %s", wh.Name),Description: fmt.Sprintf("Created webhook '%s' targeting %s (%s)", wh.Name, wh.TargetType, wh.ActionType),- ResourceType: &resourceType,+ ResourceType: new("webhook"),ResourceID: &wh.ID,ResourceName: &wh.Name,UserID: &actor.ID,@@ -335,13 +334,12 @@ func (s *WebhookService) DeleteWebhook(ctx context.Context, id, environmentID st}if s.eventService != nil {- resourceType := "webhook"_, _ = s.eventService.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeWebhookDelete,Severity: models.EventSeverityInfo,Title: fmt.Sprintf("Webhook deleted: %s", wh.Name),Description: fmt.Sprintf("Deleted webhook '%s'", wh.Name),- ResourceType: &resourceType,+ ResourceType: new("webhook"),ResourceID: &wh.ID,ResourceName: &wh.Name,UserID: &actor.ID,@@ -371,13 +369,12 @@ func (s *WebhookService) UpdateWebhook(ctx context.Context, id, environmentID st}if s.eventService != nil {- resourceType := "webhook"_, _ = s.eventService.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeWebhookUpdate,Severity: models.EventSeveritySuccess,Title: fmt.Sprintf("Webhook updated: %s", wh.Name),Description: fmt.Sprintf("Updated webhook '%s' enabled=%v", wh.Name, enabled),- ResourceType: &resourceType,+ ResourceType: new("webhook"),ResourceID: &wh.ID,ResourceName: &wh.Name,UserID: &actor.ID,@@ -631,13 +628,12 @@ func (s *WebhookService) logWebhookEventInternal(ctx context.Context, wh *modelsif errMsg != "" {description = errMsg}- resourceType := "webhook"_, _ = s.eventService.CreateEvent(ctx, CreateEventRequest{Type: models.EventTypeWebhookTrigger,Severity: severity,Title: title,Description: description,- ResourceType: &resourceType,+ ResourceType: new("webhook"),ResourceID: &wh.ID,ResourceName: &wh.Name,EnvironmentID: &wh.EnvironmentID,diff --git a/backend/pkg/libarcane/docker_compat.go b/backend/pkg/libarcane/docker_compat.goindex 0900aa8e4..0fe079f82 100644--- a/backend/pkg/libarcane/docker_compat.go+++ b/backend/pkg/libarcane/docker_compat.go@@ -145,8 +145,7 @@ func PrepareContainerCreateOptionsForDockerAPI(options client.ContainerCreateOptadjusted := optionsif options.HostConfig != nil {- hostConfigCopy := *options.HostConfig- adjusted.HostConfig = &hostConfigCopy+ adjusted.HostConfig = new(*options.HostConfig)}if adjusted.HostConfig == nil {adjusted.HostConfig = &container.HostConfig{}diff --git a/backend/pkg/libarcane/edge/transport.go b/backend/pkg/libarcane/edge/transport.goindex 8133c7017..88b4bf9e1 100644--- a/backend/pkg/libarcane/edge/transport.go+++ b/backend/pkg/libarcane/edge/transport.go@@ -154,10 +154,8 @@ func GetTunnelRuntimeState(envID string) (*TunnelRuntimeState, bool) {state.Transport = EdgeTransportWebSocket}- connectedAt := tunnel.ConnectedAt- lastHeartbeat := tunnel.GetLastHeartbeat()- state.ConnectedAt = &connectedAt- state.LastHeartbeat = &lastHeartbeat+ state.ConnectedAt = new(tunnel.ConnectedAt)+ state.LastHeartbeat = new(tunnel.GetLastHeartbeat())return state, true}diff --git a/backend/pkg/libarcane/engine_compat.go b/backend/pkg/libarcane/engine_compat.goindex 5918ed4c5..1b401e48d 100644--- a/backend/pkg/libarcane/engine_compat.go+++ b/backend/pkg/libarcane/engine_compat.go@@ -57,8 +57,7 @@ func cloneContainerHostConfigInternal(hostConfig *containertypes.HostConfig) *coreturn nil}- cloned := *hostConfig- return &cloned+ return new(*hostConfig)}func sanitizeRecreateHostConfigInternal(hostConfig *containertypes.HostConfig, engineInfo EngineCompatibilityInfo) bool {diff --git a/backend/pkg/libarcane/libbuild/builder_docker.go b/backend/pkg/libarcane/libbuild/builder_docker.goindex 93a3c221e..4b162c962 100644--- a/backend/pkg/libarcane/libbuild/builder_docker.go+++ b/backend/pkg/libarcane/libbuild/builder_docker.go@@ -150,8 +150,7 @@ func prepareDockerBuildInputInternal(req imagetypes.BuildRequest) (dockerBuildInbuildArgs := map[string]*string{}for key, val := range req.BuildArgs {- v := val- buildArgs[key] = &v+ buildArgs[key] = new(val)}labels := map[string]string{}diff --git a/backend/pkg/libarcane/swarm/stack_deploy_engine.go b/backend/pkg/libarcane/swarm/stack_deploy_engine.goindex a373bd336..634aa3978 100644--- a/backend/pkg/libarcane/swarm/stack_deploy_engine.go+++ b/backend/pkg/libarcane/swarm/stack_deploy_engine.go@@ -1063,16 +1063,14 @@ func convertDurationPtr(duration *composegotypes.Duration) *time.Duration {if duration == nil {return nil}- value := time.Duration(*duration)- return &value+ return new(time.Duration(*duration))}func toUint64Pointer(value int) *uint64 {if value < 0 {return nil}- converted := uint64(value)- return &converted+ return new(uint64(value))}func fileModeOrDefault(mode *composegotypes.FileMode) os.FileMode {diff --git a/backend/pkg/projects/fs_templates.go b/backend/pkg/projects/fs_templates.goindex f1682161e..048142a04 100644--- a/backend/pkg/projects/fs_templates.go+++ b/backend/pkg/projects/fs_templates.go@@ -29,8 +29,7 @@ func ReadFolderComposeTemplate(baseDir, folder string) (string, *string, string,for _, envName := range []string{".env.example", ".env"} {envPath := filepath.Join(baseDir, folder, envName)if eb, err := os.ReadFile(envPath); err == nil {- env := string(eb)- envPtr = &env+ envPtr = new(string(eb))break}}diff --git a/backend/pkg/projects/load.go b/backend/pkg/projects/load.goindex 81d08a796..f51587484 100644--- a/backend/pkg/projects/load.go+++ b/backend/pkg/projects/load.go@@ -157,8 +157,7 @@ func injectServiceConfiguration(project *composetypes.Project, injectionVars Envfor k, v := range injectionVars {if _, exists := s.Environment[k]; !exists {- vcopy := v- s.Environment[k] = &vcopy+ s.Environment[k] = new(v)}}diff --git a/backend/pkg/utils/update_value_util_test.go b/backend/pkg/utils/update_value_util_test.goindex 264f9d991..264d32d72 100644--- a/backend/pkg/utils/update_value_util_test.go+++ b/backend/pkg/utils/update_value_util_test.go@@ -64,8 +64,7 @@ func TestUpdateIfChanged(t *testing.T) {})t.Run("*string target with *string value", func(t *testing.T) {- initial := "initial"- target := &initial+ target := new("initial")newValue := "new"// Update from value to new valuediff --git a/cli/pkg/environments/cmd.go b/cli/pkg/environments/cmd.goindex c90dec7e9..44f21ac8a 100644--- a/cli/pkg/environments/cmd.go+++ b/cli/pkg/environments/cmd.go@@ -352,12 +352,10 @@ var updateCmd = &cobra.Command{req.ApiUrl = &envUpdateApiUrl}if cmd.Flags().Changed("enabled") {- enabled := true- req.Enabled = &enabled+ req.Enabled = new(true)}if cmd.Flags().Changed("disabled") {- enabled := false- req.Enabled = &enabled+ req.Enabled = new(false)}resp, err := c.Put(cmd.Context(), types.Endpoints.Environment(args[0]), req)diff --git a/cli/pkg/projects/cmd.go b/cli/pkg/projects/cmd.goindex 5ae517c12..bb12f2d99 100644--- a/cli/pkg/projects/cmd.go+++ b/cli/pkg/projects/cmd.go@@ -378,8 +378,7 @@ var createCmd = &cobra.Command{if err != nil {return fmt.Errorf("failed to read env file: %w", err)}- envStr := string(envBytes)- body.EnvContent = &envStr+ body.EnvContent = new(string(envBytes))}// Creating can take a long time as it may pull images@@ -445,8 +444,7 @@ var updateCmd = &cobra.Command{if err != nil {return fmt.Errorf("failed to read compose file: %w", err)}- composeStr := string(composeBytes)- body.ComposeContent = &composeStr+ body.ComposeContent = new(string(composeBytes))}if cmd.Flags().Changed("env-file") {@@ -454,8 +452,7 @@ var updateCmd = &cobra.Command{if err != nil {return fmt.Errorf("failed to read env file: %w", err)}- envStr := string(envBytes)- body.EnvContent = &envStr+ body.EnvContent = new(string(envBytes))}resp, err := c.Put(cmd.Context(), types.Endpoints.Project(c.EnvID(), resolved.ID), body)diff --git a/cli/pkg/repos/cmd.go b/cli/pkg/repos/cmd.goindex 2b1d28aca..ad7fce004 100644--- a/cli/pkg/repos/cmd.go+++ b/cli/pkg/repos/cmd.go@@ -283,8 +283,7 @@ var updateCmd = &cobra.Command{if err != nil {return fmt.Errorf("failed to read SSH key file: %w", err)}- sshKey := string(sshKeyData)- req.SSHKey = &sshKey+ req.SSHKey = new(string(sshKeyData))}if cmd.Flags().Changed("ssh-host-key-verification") {req.SSHHostKeyVerification = &repoUpdateSSHHostKeyVerifydiff --git a/cli/pkg/templates/cmd.go b/cli/pkg/templates/cmd.goindex 0115d664c..d6341afdf 100644--- a/cli/pkg/templates/cmd.go+++ b/cli/pkg/templates/cmd.go@@ -552,8 +552,7 @@ func selectTemplateMatch(identifier string, matches []template.Template) (*templreturn nil, err}- selected := ordered[choice]- return &selected, nil+ return new(ordered[choice]), nil}type rankedTemplateMatch struct {