Skip to content

docs(charts): generate chart READMEs in the readthedocs pipeline - #298

Open
lemaitre-aneo wants to merge 4 commits into
feat/revamp-helmfrom
fl/helm-readthedocs
Open

docs(charts): generate chart READMEs in the readthedocs pipeline#298
lemaitre-aneo wants to merge 4 commits into
feat/revamp-helmfrom
fl/helm-readthedocs

Conversation

@lemaitre-aneo

@lemaitre-aneo lemaitre-aneo commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Motivation

The Helm chart README.md files are pure helm-docs output, yet they were committed and regenerated
by a pre-commit hook. That is the setup we already moved away from for the Terraform module
documentation, which is now generated inside the ReadTheDocs pipeline, and it carries the same two
costs: every values.yaml or Chart.yaml change drags a regenerated README through the diff, and the
generated files go stale whenever the hook does not run. All three failure modes were live on the
branch:

  • charts/armonik-dependencies/README.md was a copy of the ingress chart's README, titled
    # ingress, because helm-docs silently skips a chart with no values.yaml and that chart's file
    was named values.yml.
  • charts/armonik-configuration/README.md outlived its chart, leaving a directory whose only content
    was the README of a chart that no longer exists.
  • charts/armonik-operators/README.md, added one commit earlier in feat(helm): split operators into an install-once armonik-operators chart #294, was already missing every
    global.armonik.* value the operator split introduced.

Description

Chart READMEs are generated at documentation build time and no longer committed, mirroring the
Terraform setup. charts/*/README.md is git-ignored and the committed copies are removed.

Pipeline

  • .docs/generate-helm-docs.sh (new) runs helm-docs over charts/, with HELMDOCS selecting the
    binary exactly as TFDOCS does in generate-tf-docs.sh.
  • .readthedocs.yaml downloads helm-docs v1.14.2, pinned like terraform-docs v0.19.0, and runs
    the script before the symlink pass. Both archives are now unpacked with only their binary extracted,
    into .bin/: they also ship a README.md at their root, and helm-docs a CHANGELOG.md, so the
    previous | tar xz was overwriting the repository's own files on every build.
  • .docs/generate-docs-symlinks.sh: symlink_readme gained a keep-path mode, and a second find
    pass maps charts/<chart>/README.md to .docs/charts/<chart>/index.md. The mode is needed because
    armonik is in is_provider, so the default provider hoisting would send charts/armonik to
    .docs/armonik/charts and collide with the Terraform armonik/ module page.
  • The helm-docs pre-commit hook and its CI install step are dropped.

Rendering of the generated pages

  • Charts are listed explicitly in the Helm Charts toctree, ordered by deployment role rather than
    alphabetically. A glob can only sort by docname, and mixing an explicit list with a catch-all glob
    duplicates every named entry. A chart added later and left out of the list is reported by Sphinx as
    document isn't included in any toctree.
  • New .docs/_static/custom.css, wired through html_css_files. The theme caps content at 800px and
    sets white-space: nowrap on every table cell, which pushed the wide values tables off screen; the
    override raises the cap and lets cells wrap, keeping only the Key column unwrapped. This helps the
    Terraform tables too. _static/ had to come out of .docs/.gitignore, where it was listed as a
    build output.
  • --document-dependency-values includes the values of our own subcharts, taking the umbrella page
    from ~140 to ~590 rows under the compute-plane.*, control-plane.*, ingress.* and
    dependencies.* prefixes.
  • --skip-version-footer drops the "Autogenerated from chart metadata" notice.
  • New charts/_templates.gotmpl overrides the built-in chart.valuesTable so the Default and
    Description cells get their pipes escaped. helm-docs emits them raw, and a pipe splits a markdown
    row into further cells even inside a code span, so every default holding a template pipeline, which
    most of the conf.* ones do, was rendering half in the Default column and half in the Description
    one.
  • sources in every chart's Chart.yaml now points at this repository. Four charts pointed at
    https://aneoconsulting.github.io/, two carried deep tree/main/charts/<dir> links, and four had
    no sources at all, so their pages showed no Source Code section.

Adjacent fixes

  • charts/armonik-dependencies/values.yml renamed to values.yaml, without which helm-docs skips
    the chart and it gets no page. The file holds nothing but a comment, so the rename is
    behaviour-neutral.
  • charts/armonik-configuration/ deleted; the chart is gone and only its README remained.
  • The unused tfsec install step is removed from the pre-commit workflow. It fails on main too:
    the upstream install script resolves the version with a greedy
    sed -E 's/.*"([^"]+)".*/\1/' over the GitHub API response, which yielded mentions_count as the
    version and a 404. Nothing runs the tool, terraform_tfsec is commented out in
    .pre-commit-config.yaml, and upstream has folded tfsec into Trivy, so the step is dead weight
    rather than something to pin.

Testing

The documentation pipeline has no automated coverage, so this was verified by running it:

  • The ReadTheDocs PR build renders every chart page, in the intended order:
    https://armonikinfra--298.org.readthedocs.build/en/298/charts/armonik/index.html
  • helm-docs output is byte-identical to the READMEs this PR removes, for every chart it previously
    generated, and identical before and after the pipe-escaping template once \| is unescaped, so the
    override changes nothing but the escaping.
  • All 1221 values rows across the charts parse as exactly four columns.
  • The pipeline works with no vendored .tgz present, checked on a copy of charts/ with every
    charts/*/charts/ directory removed, so the build needs no helm dependency build step.
  • Local sphinx-build against .docs/requirements.txt: every chart page builds, every symlink
    resolves, custom.css loads after theme.css so both overrides win, and the only warning is for
    armonik-playground, which is git-ignored and absent from a clean checkout.
  • helm lint passes on every chart, and helm template armonik is unchanged across the
    values.yml rename (over 56k rendered lines, the only differences are the randomly generated
    secrets and the config checksum that depends on them). armonik-ingress fails helm lint both
    before and after this branch, on a pre-existing standalone-render bug: gui-static.yaml:12 reaches
    .Values.global.environment.description through a nil global.environment.
  • pre-commit run passes on every touched file.

Impact

  • Contributors no longer carry generated chart READMEs in their diffs, and pre-commit no longer
    needs helm-docs installed.
  • Chart documentation is authored where it belongs: # -- comments in values.yaml, Chart.yaml
    metadata, or a per-chart README.md.gotmpl.
  • Adding a chart means adding one line to the toctree in .docs/index.md; forgetting it is reported
    as a build warning.
  • A chart with no values.yaml gets no documentation page, silently. Noted in .docs/README.md.
  • The ReadTheDocs build downloads one more binary from GitHub releases.
  • The charts are not packaged or published to a Helm repository from this repository, so dropping the
    in-tree README has no ArtifactHub or helm package consequence. That changes if chart publishing
    is added later: the publish step would then have to run helm-docs before packaging.

Additional Information

  • Third-party dependency values are not documented: helm-docs only reads dependencies it finds as
    sources on disk, so our file:// subcharts are covered and the vendored archives
    (kube-prometheus-stack, grafana, rabbitmq, cert-manager, ...) are not. Including them would mean
    unpacking the archives in the pipeline and adding several thousand upstream rows per page.
  • --document-dependency-values appends the dependency values as a second block rather than merging
    them, so a key the umbrella overrides appears twice: once with the umbrella's value, once with the
    subchart default. 10 keys on the umbrella page and 1 on armonik-dependencies; no other page is
    affected.
  • Renovate will not bump the pinned helm-docs version: the URL lives in .readthedocs.yaml with no
    custom manager, exactly as terraform-docs does today. Worth a follow-up for both at once.
  • Nothing in CI catches a chart dropping out of the documentation. If we want that guard,
    bash .docs/generate-helm-docs.sh plus a chart-count assertion would fit in the Helm linter
    workflow.

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • I have thoroughly tested my modifications and added tests when necessary.
  • Tests pass locally and in the CI.
  • I have assessed the performance impact of my modifications.

@lemaitre-aneo lemaitre-aneo mentioned this pull request Aug 4, 2026
7 tasks

@Thibaut-Nurit Thibaut-Nurit left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me

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.

3 participants