feat(bootstrap): empty bootstrap - core services become explicit#38
Merged
Conversation
…explicit The bootstrap constructor now registers only DirectoriesConfig, the logger config section and the config manager (RegisterConfigServices). All other services are opt-in: call RegisterCoreServices() after Create, or the individual RegisterX() methods. The parameterless RegisterCoreServices() now registers services only (no config manager re-registration). Adds Create(Action<SquidStdOptions>) and moves the storage config section into AddFileStorage. Sample Program.cs files switch to an explicit new SquidStdOptions to disambiguate the new Create overload.
…ootstrap change Also fixes two pre-existing sample bugs surfaced by the runtime sweep: the Secrets sample now registers the individual core services to avoid the AES/KMS ISecretProtector clash, and the Storage sample User record is YAML-deserializable (init-only properties instead of positional).
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
The bootstrap no longer auto-registers the default services. From this change,
SquidStdBootstrap.Createregisters only the configuration core -DirectoriesConfig, theloggerconfig section and the config manager (newRegisterConfigServices). Everything else is explicit.API
RegisterCoreServices()(parameterless) - services only: JSON serializer, event bus, job system, main-thread dispatcher, timer wheel, metrics, secrets. Call it afterCreate(e.g.bootstrap.ConfigureServices(c => c.RegisterCoreServices())) or pick individualRegisterX()methods. It no longer re-registers a config manager with default name/dir.RegisterCoreServices(configName, configDirectory)- unchanged net behavior (config core + services) for standalone containers.SquidStdBootstrap.Create(Action<SquidStdOptions>)- also fixes the latent bug where thedotnet newtemplates used this overload but it did not exist.storageconfig section moved from the core defaults intoAddFileStorage()(SquidStd.Storage now references SquidStd.Abstractions);RegisterDefaultCoreConfigSectionsremoved (eachRegisterXowns its section,loggerlives in the config core).Consumers updated in the same pass
RegisterCoreServices()explicitly (runtime-verified: GettingStarted, EventsJobsScheduling, Messaging, Caching, Database, Templating, Vfs, Crypto, WorkerSystem, ScriptingLua, Secrets, Storage, AspNetCore). Two pre-existing sample bugs fixed along the way (Secrets ISecretProtector clash workaround, Storage YAML record).dotnet newtemplates updated (#iftemplate directives untouched).Follow-ups (non-blocking, out of scope)
RegisterKmsSecretProtector/RegisterAwsSecretsManagerStoreshould useIfAlreadyRegistered.Replaceso they override the defaults cleanly.Test Plan
EmptyBootstrapTests(config-core-only, explicit completion + start, logging in empty mode, standalone overload unchanged, Create(Action))!/BREAKING CHANGEmarkers in any commit (semantic-release must produce 0.15.0, not 1.0.0)