Code Tidy: Clean up further obsoleted code scheduled for removal in Umbraco 18 (LogFiles, legacy permissions tables, LoggerConfigExtensions)#22679
Conversation
|
Claude finished @AndyButland's task in 4m 6s —— View job PR ReviewTarget: Removes a handful of
Suggestions
Approved with Suggestions for improvementGood to go, but please carefully consider the importance of the suggestions. |
There was a problem hiding this comment.
Pull request overview
Continues the Umbraco 18 cleanup by removing a set of long-obsoleted constants/DTOs and obsolete Serilog configuration overloads, while updating remaining code paths to use the current replacements.
Changes:
- Removed
Constants.SystemDirectories.LogFilesand inlined the default~/umbraco/Logspath where needed. - Removed legacy
UserGroup2Node*table constants and the orphanedUserGroup2NodePermissionDto. - Removed v13-scheduled obsolete overloads from
LoggerConfigExtensions; retained theIHostEnvironment-based APIs.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Infrastructure/Persistence/Dtos/UserGroup2NodePermissionDto.cs | Deletes orphaned legacy DTO for a dropped table. |
| src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/MigrateCharPermissionsToStrings.cs | Comments out node-permission migration block that referenced the removed DTO/constants. |
| src/Umbraco.Infrastructure/Migrations/Upgrade/Common/DeleteKeysAndIndexes.cs | Removes umbracoUserGroup2NodePermission from the v7.14 table cleanup list. |
| src/Umbraco.Infrastructure/Logging/Serilog/LoggerConfigExtensions.cs | Removes obsolete v13-scheduled overloads using IHostingEnvironment/IConfiguration. |
| src/Umbraco.Core/Persistence/Constants-DatabaseSchema.cs | Removes obsolete legacy table-name constants. |
| src/Umbraco.Core/Constants-SystemDirectories.cs | Removes obsolete LogFiles constant. |
| src/Umbraco.Core/Constants-Security.cs | Defers SuperUserId/SuperUserIdAsString removal to Umbraco 19 via updated [Obsolete] messages. |
| src/Umbraco.Core/Configuration/Models/LoggingSettings.cs | Replaces removed LogFiles constant usage with the literal default logging directory. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
This continues the v18 cleanup series, removing several smaller
[Obsolete]items: theConstants.SystemDirectories.LogFilesconstant, the legacyUserGroup2Node*database-table constants and their orphaned DTO, and the v13-scheduled overloads onLoggerConfigExtensions. Also defers theConstants.Security.SuperUserId/SuperUserIdAsStringremoval to Umbraco 19 — both are still load-bearing as default parameter values across the public service surface.Removed
Umbraco.Cms.Core.Constants.SystemDirectories.LogFiles—[Obsolete("Use LoggingSettings.GetLoggingDirectory() instead. Scheduled for removal in Umbraco 18.")]. The single internal use (LoggingSettings.StaticDirectory) now inlines the literal~/umbraco/Logs, identical to what the constant evaluated to.Umbraco.Cms.Core.Constants.DatabaseSchema.Tables.UserGroup2NodeandUserGroup2NodePermission—[Obsolete]since Umbraco 14, when the underlying tables were dropped.Umbraco.Cms.Infrastructure.Persistence.Dtos.UserGroup2NodePermissionDto— orphan DTO for the dropped table.[Obsolete]overloads onLoggerConfigExtensions(the twoMinimalConfiguration(LoggerConfiguration, IHostingEnvironment, …)overloads, plusOutputDefaultTextFile(LoggerConfiguration, IHostingEnvironment, …)andOutputDefaultJsonFile(LoggerConfiguration, IHostingEnvironment, ILoggingConfiguration, …)). Non-obsolete replacements takingIHostEnvironmentremain on the same class. The two internal call sites inUmbraco.Web.Common.Extensions.ServiceCollectionExtensionsalready use the replacements.Other notable changes
MigrateCharPermissionsToStrings(the v14 migration that previously referencedUserGroup2NodePermissionDto) has the now-orphaned block commented out. The migration as a whole is itself[Obsolete("Remove in Umbraco 18.")]and will be deleted in a another PR (Migrations: Removed obsoletedMigrationBaseand all migrations between old and current LTS (13-17) #22618); so I've just commented out references.DeleteKeysAndIndexes.csno longer enumeratesumbracoUserGroup2NodePermissionin its list of cleanable table names.Deferred
Constants.Security.SuperUserIdandSuperUserIdAsStringwere[Obsolete]and scheduled for removal in v18, but both are still consumed across the public service surface as default parameter values (int userId = Constants.Security.SuperUserIdonIContentService,IDataTypeService,IRelationService,IMediaService, etc.). Removing the constants requires reshaping those signatures fromint userIdtoGuid userKey, which is a much larger piece of work than this tidy. Obsoletion is deferred to Umbraco 19.Breaking changes
Constants.SystemDirectories.LogFilesis removed.Constants.DatabaseSchema.Tables.UserGroup2Node/UserGroup2NodePermissionare removed. The underlying tables haven't existed since Umbraco 14, so any external code referencing the constants was already non-functional against the live schema.UserGroup2NodePermissionDtois removed.LoggerConfigExtensionsare removed (see Removed above). Non-obsolete replacements on the same class take their place.Testing
Solution builds and tests pass.