feat(overrides): add profile and explicit override merge support#20
feat(overrides): add profile and explicit override merge support#20wax911 wants to merge 3 commits into
Conversation
- composeOverrideMerge: scalars replace, maps merge, sequences append (distinct from fragment merge which replaces arrays) - loadOverrideFile: load YAML override from relative/absolute path - applyOverrides: load and apply chain of override files to base compose - Override integration in generateStacks via GenerateOptions.overrides - 26 tests covering all merge rules, file loading, edge cases - CLI generate command accepts --override flag
- Variable interpolation: ${VAR}, ${VAR-default}, ${VAR:-default}, $VAR, $$
- Variable scope resolution: shell env -> env_file(s) -> service.environment
- Deep interpolation through all string values in compose structures
- Path absolutization for env_file and bind-mount paths
- Strict mode (fail on unresolved) and non-strict mode (leave as-is with warnings)
- CLI pipeline: resolveConfig -> generateStacks -> renderStack -> output
- 49 comprehensive tests covering all interpolation forms and edge cases
wax911
left a comment
There was a problem hiding this comment.
Review notes against #8:
-
The PR body says
--override <file>is supported ongenerateandsync. That contradicts the plan and issue non-goals. Overrides belong in the runtime path: base generated stack -> override merge -> render -> deploy. Canonicalgenerateshould emit base stack artifacts, and canonicalsyncshould validate only base generated stacks unless a separate explicit override-validation command is added. -
syncmust remain focused on committed canonical stack drift. Applying overrides during sync risks making local/machine-specific state look canonical, which was explicitly rejected in the local-stack planning issue. -
If an override flag exists on
generate, it needs to be removed or renamed to a distinct non-canonical operation. Otherwise it creates exactly the class of generated-stack mutation we were trying to avoid. -
Keep explicit overrides for
render,up,reload, andplanfirst. Add a futurevalidate-overridescommand only if there is a strong need.
Please correct the command surface before this closes #8.
- Remove --override from generate command (base artifacts only) - Remove --override from sync command (canonical comparison only) - Keep --override on render, up, reload, plan only
Closes #8