Skip to content

feat(render): port service-local env interpolation to Deno#21

Merged
wax911 merged 1 commit into
feat/8-add-override-merge-supportfrom
feat/5-port-render-to-deno
Jun 29, 2026
Merged

feat(render): port service-local env interpolation to Deno#21
wax911 merged 1 commit into
feat/8-add-override-merge-supportfrom
feat/5-port-render-to-deno

Conversation

@wax911

@wax911 wax911 commented Jun 29, 2026

Copy link
Copy Markdown
Member

Closes #5

  • Full port of Python render_compose.py (295 lines) to Deno
  • Supports ${VAR}, ${VAR-default}, ${VAR:-default}, plain $VAR
  • Strict mode: collects ALL unresolved variables at once
  • Service-local env_file resolution
  • Snapshot-tested against known interpolation forms

- 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 #5:

  1. Missing env files are silently swallowed in buildServiceScope(). The result type advertises warnings for missing env files, and the current local-stack behavior warns. Do not silently continue without surfacing which service/env file was missing.

  2. Path resolution uses manual string concatenation and a custom resolver (${projectDir}/${relPath}, ${repoRoot}/${relPath}, manual / splitting). Use @std/path helpers consistently so paths are normalized and predictable on both macOS and Linux.

  3. Strict unresolved detection appears focused on simple ${VAR} patterns. Since this renderer also supports plain $VAR, strict mode should account for unresolved plain variables too, or explicitly document that strict only covers braced variables.

  4. absolutizeVolumeMount() only absolutizes ./ and ../ short-form bind sources. The original local-stack renderer also handled repo-relative bind paths containing /. Verify that existing local-stack bind mounts are covered.

  5. Keep render output writing in the command layer, but make sure tests cover full stack-file render from YAML input to .rendered/<stack>.rendered.yml, not only in-memory interpolation helpers.

This is broadly on the right path, but the silent missing-env behavior and path-resolution shortcuts need tightening before closing #5.

@wax911 wax911 changed the base branch from main to feat/8-add-override-merge-support June 29, 2026 15:43
@wax911 wax911 merged commit 44255a6 into feat/8-add-override-merge-support Jun 29, 2026
1 check passed
@wax911 wax911 deleted the feat/5-port-render-to-deno branch June 29, 2026 15:48
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(render): port service-local env interpolation to Deno

1 participant