Skip to content

Flatten config templates, render inside the release - #127

Merged
ineedjet merged 4 commits into
mainfrom
flatten-config-templates
Aug 22, 2026
Merged

Flatten config templates, render inside the release#127
ineedjet merged 4 commits into
mainfrom
flatten-config-templates

Conversation

@ineedjet

Copy link
Copy Markdown
Collaborator

Summary

  • Rendered config templates were pushed straight into the non-versioned apps-data/{app}/config/ tree before the atomic symlink switch - not part of the release tarball, no history, and in tension with the atomicity guarantee AGENTS.md documents elsewhere.
  • Drop the config/ subdirectory convention entirely: any *.template.* file next to an app's docker-compose.yml is now rendered in place, on the runner, before the release is archived - so it rides inside the same release tarball as .env.
  • Compose files (traefik, codecov) now mount the rendered file by plain relative path, one line per file, instead of reaching into apps-data. apps-data stays reserved for state that must survive across releases and is never regenerated (acme.json, database data directories, codecov's archive/).
  • Removed push_app_configs and the rendered_configs dict threaded through resolve_app_envs/deploy_to_host/main - no longer needed.
  • Added a dedicated "Config Templates" section to AGENTS.md explaining the mechanism/rationale, which previously didn't exist (only scattered one-line mentions, one of which was stale/inconsistent with reality).

Closes #126.

Test plan

  • deploy/tests/test_deploy.py updated for the flattened layout; full suite (48 tests) passes
  • pre-commit run --all-files passes (yamllint, pymarkdown, ruff, actionlint)
  • docker compose config validated for both apps/traefik and apps/codecov - confirmed the rendered-file mounts resolve to apps/traefik/traefik.yml and apps/codecov/codecov.yml respectively, no apps-data involvement for config

…lease

Rendered config templates were pushed straight into the non-versioned
apps-data/{app}/config/ tree before the atomic symlink switch, breaking
the release's atomicity guarantee and leaving no history to fall back
to. Drop the config/ subdirectory convention entirely and rely on
naming alone: any *.template.* file next to an app's docker-compose.yml
is rendered in place, on the runner, before the release is archived -
so it rides inside the same release tarball as .env. Compose files now
mount the rendered file by plain relative path, one line per file,
instead of reaching into apps-data. apps-data stays reserved for state
that must survive across releases and is never regenerated.

Fixes #126.
.template as an infix (traefik.template.yml) meant a bespoke glob
(*.template.*) and extra care extracting the real extension. Match the
convention Terraform's templatefile() (.tpl) and Consul Template
(.tmpl) use instead: .template as a trailing suffix (traefik.yml.template),
stripped via Path.stem to get the rendered filename. Simpler glob
(*.template), no risk of the marker showing up mid-filename by accident.
.template as a terminal suffix (traefik.yml.template) loses default
syntax highlighting everywhere - editors and GitHub's diff view pick
a language by the last extension, and .template isn't a recognized
one anywhere out of the box. Use Terraform's own .tpl marker, but keep
it as an infix (traefik.tpl.yml) rather than terminal like Terraform
does, so the real extension (.yml) stays last and highlighting keeps
working with zero per-editor configuration.
traefik.tpl.yml -> traefik.yml.tpl, matching Terraform's own .tpl
placement (user_data.tpl) instead of an infix. Editors won't syntax-
highlight the template source out of the box with this placement -
noted in AGENTS.md, with a pointer to configuring a file association
if that matters. Rendered output (traefik.yml) is unaffected.
@ineedjet
ineedjet merged commit 2a03428 into main Aug 22, 2026
3 checks passed
@ineedjet
ineedjet deleted the flatten-config-templates branch August 22, 2026 19:04
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.

Rendered config templates aren't part of the atomic release

1 participant