EPMDEDP-17242: fix: generate the scaffold chart README instead of hand-writing it - #301
Closed
geekhubuser wants to merge 1 commit into
Closed
EPMDEDP-17242: fix: generate the scaffold chart README instead of hand-writing it#301geekhubuser wants to merge 1 commit into
geekhubuser wants to merge 1 commit into
Conversation
geekhubuser
force-pushed
the
EPMDEDP-17242
branch
from
July 29, 2026 09:34
7c4d555 to
3a46fbe
Compare
Collaborator
Pipeline
|
| Status | Task | Duration |
|---|---|---|
| ✅ | github-set-pending-status | 6s |
| ✅ | fetch-repository | 15s |
| ✅ | init-values | 4s |
| ✅ | get-cache | 2m8s |
| ✅ | commit-validate | 5s |
| ✅ | dockerfile-lint | 7s |
| ✅ | helm-lint | 7s |
| ✅ | helm-docs | 31s |
| ✅ | build | 1m9s |
| ✅ | sonar | 30s |
| ✅ | save-cache | 30s |
| ✅ | buildkit-build | 27s |
| ✅ | github-report-pipeline-status | 7s |
…d-writing it The README of the scaffolded application chart was a hand-transcribed copy of what helm-docs generates from values.tmpl. Adding the HTTPRoute exposure updated the values but transcribed the table wrongly, so on Envoy clusters every scaffolded project shipped a README helm-docs disagreed with, failing the helm-docs task of its review pipeline regardless of language. - Generate README.tmpl from the rendered chart with helm-docs, so the operator ships exactly what the review pipeline verifies and the table can no longer drift from the values next to it - Guard it in CI: make validate-scaffold-docs regenerates the templates and fails when they are stale - Document the parent Gateway per field and expose sectionName, which the collapsed map hid - Close the chart files the scaffold writes; the leaked handles broke test cleanup on Windows
geekhubuser
force-pushed
the
EPMDEDP-17242
branch
from
July 29, 2026 10:03
3a46fbe to
f99a080
Compare
Member
|
addressed in #302 - let's use simplify approach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The
deploy-templates/README.mdthat the operator writes into every scaffolded application wasnot generated — it was rendered from
README.tmpl, a hand-transcribed copy of whathelm-docsproduces from
values.tmpl. Two sources of truth for one file, with nothing enforcing that theyagree.
Adding the HTTPRoute exposure (
f3a3d76) updated the values and transcribed the new rows by hand,and the transcription was wrong in two ways:
helm-docssorts the table alphanumerically (httproute<image<imagePullSecrets<ingress). Thehttprouterows were put in the slot theingressrowsoccupy, which is correct for
ingressand wrong forhttproute.values.tmplcarried a# --comment on thegateway:map, sohelm-docsemits a single collapsedobjectrow and never descends into.name/.namespace.The template hardcoded the two child rows instead.
The result: on a cluster where the operator runs with
INGRESS_CONTROLLER_TYPE=envoy, every newlyscaffolded project shipped a README that
helm-docsdisagreed with, so thehelm-docstask failedin that project's review pipeline — for every language. It was latent on nginx clusters because the
ingressrows happen to sit in the right place.This PR fixes the cause rather than the transcription:
README.tmplis now generated and CIfails when it is stale.
hack/scaffolddocsrenders the scaffold through the operator's ownutil.CopyTemplate, runshelm-docsover the result the same way the review pipeline does, and substitutes thecodebase-specific values back as template actions. Both ingress-controller variants are rendered
for every platform and merged into a single template, each variant-specific run of rows behind
the guard that selects it. The controller is selected independently of the platform
(
INGRESS_CONTROLLER_TYPEvsPLATFORM_TYPE), so covering both everywhere is what keeps ascaffold that starts branching from being documented for only one of them — a platform whose
scaffold ignores the selection renders both variants identically and merges to unguarded output,
which is why OpenShift's template is unchanged.
make scaffold-docsregenerates the templates;make validate-scaffold-docsfails when thecommitted ones are stale, and runs as its own job on every PR.
values.tmplnow documents the parent Gateway per field, which also uncoverssectionName— itwas commented out and its
# --description was dead, because the collapsed map hid it. It isguarded by
{{- with }}inhttproute.yaml, so the empty default renders nothing.CopyHelmChartTemplatesnow closes the three chart files it creates. The leaked handles are whatmade
t.TempDir()cleanup fail across the suite on Windows.README.tmplfor OpenShift is regenerated byte-for-byte identical to the committed one, which is anindependent check that the generator reproduces a template that was already correct.
Fixes the
helm-docsfailures blocking the Tekton smoke suite.Type of change
How Has This Been Tested?
Reproduced first. Rendering the scaffold from
masterwith the sandbox's configuration(
envoy/main-gateway/envoy-gateway-system) and runninghelm-docsreproduced the pipelinefailure byte-for-byte — the same 13 changed lines seen in
review-go-beego-rls-crt-bld-release-1-2-5dsgqandreview-js-crt-br-smv-bld-new-knb9g.Verified against the exact image the task uses,
jnorwood/helm-docs:v1.13.1, invoked as thetask invokes it (
--chart-search-root deploy-templatesfrom the repo root), for every combination:Before this change,
kubernetes + envoywas the failing case; the rest passed and still pass.helm-docsv1.13.1 (the task) and v1.14.2 (this repo's pin) were confirmed to produce identicaloutput for this chart, so the pin validates what the pipeline checks.
Rendered manifests, to confirm the newly exposed
sectionNamebehaves:--set httproute.enabled=true→parentRefscarries nosectionName--set httproute.gateway.sectionName=https→sectionName: httpsis renderedIngress; the dormanthttproute.yamlrenders nothing and doesnot error when its values block is absent
Generator is idempotent — a second run reproduces byte-identical output.
Tests:
go test ./hack/... ./pkg/util/...passes. On the full suite this change takes thefailure count from 4 to 3; the three that remain fail identically on a clean
masterand areWindows-only
t.TempDir()teardown leaks in unrelated tests (TestIsDirectoryEmpty,TestPrepareTemplates_ShouldSkipSonarConfig,TestGitProvider_CommitChanges) plus the envtestwebhook suite.
golangci-lintis clean on every file touched.Checklist:
Additional context
Tests added.
pkg/utilasserts, for each platform and exposure, that the scaffolded README'srows keep the alphanumeric order
helm-docssorts by and document the exposure the platformselected — that is defect 1, caught without needing the
helm-docsbinary.hack/scaffolddocscovers the merge itself: variant-specific rows get guarded, a key both variants document with
different values keeps one guarded row each, a single-variant platform stays unguarded, and the
generator refuses to emit rather than guess when variants differ outside the values table or when a
row is shared by only some of them. A further test fails if a scaffold template gains a
{{.Field}}the generator does not supply — that failure mode is silent otherwise, since the fieldrenders empty and its row simply disappears.
Defect 2 is specific to
helm-docssemantics and is caught by thevalidate-scaffold-docsCI jobrather than by a unit test, which is deliberate: reimplementing those semantics in a test would
recreate the duplication this PR removes.
Backport. The defect ships in
release/2.34(2.34.0, pinned by edp-installrelease/3.14) aswell as
master.release/2.33is unaffected. A cherry-pick and a 2.34.1 patch are needed forclusters on 3.14 that enable Envoy.
Already-scaffolded repositories are not repaired by this change —
PutDeployConfigspushes thetemplates once per codebase, guarded by
Status.Git == ProjectTemplatesPushedStatus. Projectscreated on an Envoy cluster before the fix keep the stale README and need a one-off
helm-docs && git commit. The autotest fixtures are recreated each run and heal on their own.