Skip to content

feat(overrides): add profile and explicit override merge support#20

Open
wax911 wants to merge 3 commits into
feat/4-port-stack-generation-to-denofrom
feat/8-add-override-merge-support
Open

feat(overrides): add profile and explicit override merge support#20
wax911 wants to merge 3 commits into
feat/4-port-stack-generation-to-denofrom
feat/8-add-override-merge-support

Conversation

@wax911

@wax911 wax911 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Closes #8

  • Docker Compose override merge: scalars replace, maps merge, sequences append
  • --override flag support on generate and sync
  • Profile-based override auto-discovery
  • 26 tests for override logic

wax911 added 2 commits June 29, 2026 14:40
- 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 wax911 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review notes against #8:

  1. The PR body says --override <file> is supported on generate and sync. That contradicts the plan and issue non-goals. Overrides belong in the runtime path: base generated stack -> override merge -> render -> deploy. Canonical generate should emit base stack artifacts, and canonical sync should validate only base generated stacks unless a separate explicit override-validation command is added.

  2. sync must 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.

  3. 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.

  4. Keep explicit overrides for render, up, reload, and plan first. Add a future validate-overrides command only if there is a strong need.

Please correct the command surface before this closes #8.

@wax911 wax911 changed the base branch from main to feat/4-port-stack-generation-to-deno June 29, 2026 15:43
- Remove --override from generate command (base artifacts only)
- Remove --override from sync command (canonical comparison only)
- Keep --override on render, up, reload, plan only
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.

feat(overrides): add profile and explicit override merge support

1 participant