Skip to content

feat(bootstrap): empty bootstrap - core services become explicit#38

Merged
tgiachi merged 3 commits into
developfrom
feature/empty-bootstrap
Jul 2, 2026
Merged

feat(bootstrap): empty bootstrap - core services become explicit#38
tgiachi merged 3 commits into
developfrom
feature/empty-bootstrap

Conversation

@tgiachi

@tgiachi tgiachi commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

The bootstrap no longer auto-registers the default services. From this change, SquidStdBootstrap.Create registers only the configuration core - DirectoriesConfig, the logger config section and the config manager (new RegisterConfigServices). Everything else is explicit.

Note for reviewers: this is intentionally a behavioral break for Create consumers, released as a minor (0.15.0). Commits deliberately carry no BREAKING CHANGE marker to avoid a 1.0.0 bump.

API

  • RegisterCoreServices() (parameterless) - services only: JSON serializer, event bus, job system, main-thread dispatcher, timer wheel, metrics, secrets. Call it after Create (e.g. bootstrap.ConfigureServices(c => c.RegisterCoreServices())) or pick individual RegisterX() 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.
  • New SquidStdBootstrap.Create(Action<SquidStdOptions>) - also fixes the latent bug where the dotnet new templates used this overload but it did not exist.
  • The storage config section moved from the core defaults into AddFileStorage() (SquidStd.Storage now references SquidStd.Abstractions); RegisterDefaultCoreConfigSections removed (each RegisterX owns its section, logger lives in the config core).

Consumers updated in the same pass

  • All samples call 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).
  • All 4 dotnet new templates updated (#if template directives untouched).
  • Docs: landing quick start, tutorials, DI/bootstrap concepts with a "Migrating to 0.15" section, Services.Core/AspNetCore/Templating READMEs.

Follow-ups (non-blocking, out of scope)

  • RegisterKmsSecretProtector/RegisterAwsSecretsManagerStore should use IfAlreadyRegistered.Replace so they override the defaults cleanly.

Test Plan

  • 5 new EmptyBootstrapTests (config-core-only, explicit completion + start, logging in empty mode, standalone overload unchanged, Create(Action))
  • Full suite 1004/1004; build 0 errors; docfx 0 warnings
  • Runtime sweep of the samples; templates syntax-checked
  • Guard: no !/BREAKING CHANGE markers in any commit (semantic-release must produce 0.15.0, not 1.0.0)

tgiachi added 3 commits July 2, 2026 18:02
…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).
@tgiachi
tgiachi merged commit 3ec0493 into develop Jul 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant