55 lines
3.0 KiB
Markdown
55 lines
3.0 KiB
Markdown
|
|
# ConfigKit v1.2.0
|
||
|
|
|
||
|
|
`LoadLayered` can now use the resolved main configuration's filesystem context
|
||
|
|
to find companion imports and the selected overlay in a single load. For example,
|
||
|
|
an application that discovers `/srv/campaign/config.yml` can import fragments
|
||
|
|
from `/srv/campaign/prompts/` and apply
|
||
|
|
`/srv/campaign/overlays/production.yml`, regardless of its working directory.
|
||
|
|
|
||
|
|
## Main-relative companion inputs
|
||
|
|
|
||
|
|
Set `Input.MainRelative` to `MainRelative()` on a non-file underlay to use the
|
||
|
|
main input's resolved context. Enable imports separately and declare the files
|
||
|
|
or directories to load. A concrete `Input.Filesystem` takes precedence over the
|
||
|
|
binding. The derived context keeps the main input's filesystem namespace and
|
||
|
|
containment root, with lookup starting at its resolved base directory.
|
||
|
|
|
||
|
|
When the main supplies no usable context, the companion can use a
|
||
|
|
`MainRelativeContext.Fallback`. Otherwise, optional imports are skipped and
|
||
|
|
the companion's own configuration still contributes. Required imports that
|
||
|
|
need targets fail, and `RequireBase` requires a usable context even when imports
|
||
|
|
are disabled. Skipped imports produce no filesystem search evidence.
|
||
|
|
|
||
|
|
The consumer example combines embedded defaults, operator imports, and a selected
|
||
|
|
overlay. [Example](../../examples/consumers/main_relative.go) ·
|
||
|
|
[Layered loading contract](../config.md#layered-loading)
|
||
|
|
|
||
|
|
## Overlay lookup and filesystem checks
|
||
|
|
|
||
|
|
`LoadLayered` now looks for a selected overlay using `OverlayFilesystem`, the
|
||
|
|
resolved main context, or `OverlayFallback`, in that order. Derived and fallback
|
||
|
|
lookups start at the context's base directory. Explicit overlay contexts and
|
||
|
|
ordinary `Load` use their existing root-relative lookup. A selected overlay
|
||
|
|
must exist in the chosen context.
|
||
|
|
|
||
|
|
Native overlays resolve symlink targets when the filesystem exposes link
|
||
|
|
inspection. This catches targets outside the configured root and aliases of
|
||
|
|
already acquired files in the same namespace. Derived standalone host contexts
|
||
|
|
now check root access the same way explicit contexts do. [Overlay contract](../config.md#selected-overlays)
|
||
|
|
|
||
|
|
## Upgrade notes
|
||
|
|
|
||
|
|
Use keyed Go literals when constructing `Input` and `LayeredOptions`. Both
|
||
|
|
types gained fields, so existing positional literals need updating. The minimum
|
||
|
|
consumer Go version is 1.27.0.
|
||
|
|
|
||
|
|
Internally, imports with and without a filesystem base share root placement
|
||
|
|
and accounting. Directory import policies reuse default patterns, and companions
|
||
|
|
in the same tier share one derived context.
|
||
|
|
|
||
|
|
The repository also adopted upstream documentation, licensing, and release
|
||
|
|
policy updates, including clearer guidance on when to write an ADR and what
|
||
|
|
compatibility means for existing configurations. [Repository policies](../policy/meta.md)
|
||
|
|
|
||
|
|
[COPYRIGHT](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.2.0/COPYRIGHT) | [LICENSE](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.2.0/LICENSE) | [ATTRIBUTION](https://forge.maximumdirect.net/base-layer/configkit/src/tag/v1.2.0/docs/oss/attribution.md)
|