refactor: migrate to DI container and ILogger<T>#7
Merged
Wintersta7e merged 11 commits intomainfrom Mar 5, 2026
Merged
Conversation
- Replace Serilog with Microsoft.Extensions.Logging.Abstractions in Core - Add ILogger<T> constructor injection to all 11 node classes - Migrate PipelineRunner and AppSettingsManager to ILogger<T> - Update NodeRegistry.CreateDefault to accept ILoggerFactory - Create ServiceCollectionExtensions for DI registration - Add M.E.DI/Logging packages to UI, CLI, and Tests projects - Suppress CA1848/CA1873 in Core (deferred to future optimization) Co-Authored-By: Rooty
Co-Authored-By: Rooty
Co-Authored-By: Rooty
- Hook ShutdownRequested to dispose ServiceProvider (flushes Serilog) - Constructor-inject EditorViewModel instead of service locator Co-Authored-By: Rooty
Use explicit factory registration for AppSettingsManager to avoid multi-constructor DI ambiguity (H4). Add XML documentation documenting registrations, lifetimes, and ILoggerFactory prerequisite (M5). Co-Authored-By: Rooty
Add ArgumentNullException.ThrowIfNull to all 11 node constructors, NodeRegistry.CreateDefault, and PipelineRunner constructor (H5). Add LogDebug in Configure methods and LogWarning on error paths for the 7 nodes that had unused logger fields (M1). Co-Authored-By: Rooty
Replace null! Services property with guarded property that throws descriptive InvalidOperationException on DI failure (C1). Surface settings load failures in ExecutionLog.Summary (C2). Change EditorViewModel to singleton to match its actual captive lifetime (H1). Wrap shutdown disposal in try-catch with Log.CloseAndFlush (H3). Register IDialogService in DI container (M2). Co-Authored-By: Rooty
Replace App.Services service locator with constructor-injected IServiceProvider for PipelineRunner resolution (H2). Replace new DialogService() with constructor-injected IDialogService (M2). Add null guards to all constructor parameters. Co-Authored-By: Rooty
Replace bare catch block in AppSettingsManager.SaveAsync with logged warning (M4). Add diagnostic comments to ConfigFieldTemplateSelector picker catch blocks (M3). Move GetRequiredService above try block in CLI so DI failures aren't caught as pipeline errors (M6). Add comments explaining await using disposal mechanism (M7). Co-Authored-By: Rooty
Verify all services resolve correctly and have expected lifetimes. Test that missing ILoggerFactory throws descriptive error (C3). Co-Authored-By: Rooty
Co-Authored-By: Rooty
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Serilog.Log.Loggerwith dependency-injectedMicrosoft.Extensions.Logging.ILogger<T>across the entire codebaseMicrosoft.Extensions.DependencyInjection) for Core, UI, and CLI projectsAddFlowForgeCore()extension method as single source of truth for Core service registrationILogger<T>viaILoggerFactoryinNodeRegistry.CreateDefault()NullLogger<T>.Instance— zero Serilog boilerplateChanges (41 files, +604 -240)
0543d1c835900d50f572eefe81a41705e7fd7d32105722245f19da83f5ff3bf4b6442c699b27f