Skip to content

Shrink the chart template helpers without changing output - #377

Merged
bruno-espino merged 4 commits into
mainfrom
bruno/shrink-chart-templates
Nov 20, 2026
Merged

bruno-espino merged 4 commits into
mainfrom
bruno/shrink-chart-templates

Conversation

@bruno-espino

@bruno-espino bruno-espino commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

Internal cleanup of the chart templates. Rendered manifests do not change.

  • Helpers with one caller are inlined. The HPA, KEDA and PDB helpers become one logfire.autoscaler call per workload, and the validate.* helpers become one logfire.validateConfig that keeps their order and messages.
  • Internal required guards on helper arguments are gone. Every check that a values change can trigger keeps its message, and the | default dict reads that --reuse-values upgrades rely on stay.
  • The _helpers*.tpl files wrap at 100 columns. The manifests keep one line per entry.
  • Templates go from 9,582 to 8,794 lines (−7.7% bytes), mostly in _helpers.tpl (2,369 → 1,780) and _helpers-validation.tpl (588 → 341).

Rendering every unit-test case, the values fixtures and about 50 extra value sets with helm template gives the same manifests as main, apart from random secrets. That includes the config checksums and the post-deploy migration Job name, which hash rendered text. A second run sets every values key to each of null, false, "", 0, {} and [], on top of values.prod.yaml and on top of a values file with most features on (about 25,000 cases). Every set that renders on main renders the same on this branch.

Upgrade notes

None.

Inline helpers that have one caller, drop internal `required` guards, and
merge the validators into one `logfire.validateConfig` that keeps their order
and messages. Wrap the `_helpers*.tpl` files at 100 columns; the manifests
keep one line per entry.

Rendered manifests do not change. Bump the chart to 0.15.4-rc.5.
… ifs

Move the trusted CA, dev Postgres wait and Absurd queue wait containers into
`logfire.initContainers`, their only caller. Their output keeps the same
whitespace, so the post-deploy migrations Job name does not change. Split the
one-line conditionals whose output does not depend on staying on one line.
The refactor read some values with multi-key `dig`, which fails on a null or
non-map step, and dropped a few fallbacks. Restore main's handling:

- `<service>.image`, `.service` and `.securityContext` set to null fall back
  to the chart defaults again.
- The RustFS bucket reads `rustfs.bucket` only when the URI names no bucket.
- `otel_collector.prometheus: false` turns the exporter off again.
- Dex `connectors` and `staticClients` keyed by name render as lists again.

Pin each shape in resource_shape_test.yaml.
- Dex `connectors` and `staticClients`, `groupOrganizationMapping`,
  `project_roles` and `hooksAnnotations` set to false render as empty again.
- `auth.passkeys`, `auth.passwordLogin` and `auth.passwordlessEmailSignup`
  set to "" still render their env var, as on main.
- A trusted CA bundle `key` set to a falsy value renders as given, as on main.

Pin the Dex and group mapping shapes in resource_shape_test.yaml.
@bruno-espino
bruno-espino merged commit 0bf840d into main Nov 20, 2026
6 checks passed
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.

1 participant