Migration: Props interface prune + props.New¶
Part of the GTB framework core follow-ups. Pre-1.0, so this ships as a minor bump.
Removed: eight unused provider interfaces¶
These narrow provider interfaces had zero production consumers — pure API
ornament — and were removed from pkg/props:
ConfigReader, ConfigFSProvider, FileSystemProvider, VersionProvider,
ErrorHandlerProvider, TelemetryProvider, LoggingConfigProvider,
CoreProvider.
The four interfaces with real consumers are kept: LoggerProvider,
ConfigProvider, AssetProvider, ToolMetadataProvider.
Every getter method on *Props is unchanged — GetFS, GetVersion,
GetErrorHandler, GetCollector, GetConfigView, GetConfigFS and the rest
all remain. Only the interface types were removed.
Migration:
- If you declared a parameter as one of the removed interfaces, take
*props.Propsdirectly (that is how the whole codebase already works), or reintroduce a one-method interface local to your package over the getter you need.
// before
func f(p props.FileSystemProvider) { fs := p.GetFS() }
// after — take the concrete container, or a local narrow interface
func f(p *props.Props) { fs := p.GetFS() }
Added: props.New(...) and Props.Validate()¶
A blessed construction path now checks the nil-field contract at one place:
New requires a named Tool, a Logger, and a filesystem; it defaults the
optional invariants (Collector → noop, ErrorHandler, Version) and leaves
Config nil (the pre-run assigns it; the init path runs with it nil by design).
Props.Validate() and Props.ApplyDefaults() are exposed for callers that still
build a struct literal. Building a Props struct literal continues to work
unchanged — New is additive.
Behaviour changes (not API)¶
doctorno longer ships a built-in Git check, and its AI-key check now runs only when the AI feature is enabled. A tool with a git-consuming feature should register its own git check viasetup.RegisterChecks.Assetsfs.FileInfo.Name()on merged structured reads now returns the base name (per thefs.FileInfocontract), not the full path passed toOpen. Code that relied on the old full-path return should join the path itself.