Repository navigation
refactor(chart)!: finish the Helm conventions - #270
Conversation
Rename the values that #249 and #263 left out of Helm's conventions: ingress.rules -> ingress.enabled, ingress.ingressClassName -> ingress.className, transfer.active -> transfer.enabled, ftp.hostip -> ftp.hostIp and auth.envBasegroup -> auth.envBaseGroup. Replace the switch tesk.securityContext.enabled by the maps tesk.podSecurityContext and tesk.securityContext, with the same defaults, as in helm create. The old keys fail the chart with their replacements; the check now supports nested maps. Close the chart's own maps in values.schema.json (additionalProperties: false), so that typos fail; maps with Kubernetes' fields stay open, and the removed keys are declared so that the templates can name their replacements. Rename the TLS secret template to tls-secret.yaml-TEMPLATE, with a valid secret name. Update the docs and the upgrade notes. BREAKING CHANGE: the renamed values fail the installation; see the upgrade notes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Accept tesk.enabled, which parent charts set with condition: tesk.enabled, in the closed schema; create the OpenShift Route only for ingress.enabled: false, as before for ingress.rules; accept any scalar as ingress.className and quote it. Name the open maps and the strict switches in the schema and the docs, mention the omitted ingressClassName in the upgrade notes, and split the security context test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideAPIReview the values schema’s closed chart-owned maps, extensible Kubernetes maps, removed-key declarations, and parent-chart
Review the renamed values and split pod/container security-context defaults that supply the schema’s public values contract.
Uses of the APIReview template consumers of the renamed auth and transfer values and the merged container and pod security contexts.
Review the FTP endpoint and service conditions using the renamed
Review Ingress enablement and class rendering, including set values that YAML reads as zero or false.
Review the OpenShift Route condition so it is created only when Ingress is explicitly disabled.
ImplementationReview the removed-values table and nested-map lookup that report replacement values for deprecated keys.
DocumentationReview the configuration reference for the renamed values, schema behavior, and security-context defaults.
Review deployment guidance for the renamed Ingress and transfer switches and the OpenShift pod security-context override.
Review the local FTP guide’s
Review the MicroK8s example’s renamed Ingress values.
Review upgrade instructions and the rename table, including schema behavior and TLS template migration.
TestsReview chart tests covering removed-key hints, security-context defaults and merging, schema validation, dependency conditions, naming, and renamed-value rendering.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #270 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 229 229
=========================================
Hits 229 229 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="charts/tesk/templates/ingress/ingress-rules.yaml" line_range="17-19" />
<code_context>
{{- end }}
spec:
- ingressClassName: {{ .Values.ingress.ingressClassName }}
+ {{- with .Values.ingress.className }}
+ ingressClassName: {{ toString . | quote }}
+ {{- end }}
{{- if $tlsSecretName }}
tls:
</code_context>
<issue_to_address>
**Configured ingress class is skipped**
When `ingress.className` is set to `0` or `false`, the `with` block treats the value as empty and skips `ingressClassName`, so the Ingress silently uses the cluster's default class.
Replace the `with` block with a presence check that renders `ingress.className` through `toString` even when its value is `0` or `false`.
</issue_to_address>
### Comment 2
<location path="tests/test_chart.py" line_range="360" />
<code_context>
+ "runAsNonRoot": True,
+ "seccompProfile": {"type": "RuntimeDefault"},
+ }
+ assert container(manifests)["securityContext"]["readOnlyRootFilesystem"] is True
+
+
</code_context>
<issue_to_address>
**Container defaults can disappear**
When the chart replaces the container security context instead of merging the supplied value with defaults, if the chart replaces rather than merges container security-context values, `test_security_context_values` checks only `readOnlyRootFilesystem` at line 360 and still passes even though the default `allowPrivilegeEscalation` and dropped capabilities are gone. The test misses the lost security defaults.
Assert that the overridden container context also retains the default fields.
</issue_to_address>Linked issues
#228 refactor: follow the Helm conventions in the chart · 2 of 2 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Follow Helm conventions for values, images and resources, resource names and labels, schema, formatting, storage documentation, and chart metadata. | ✅ Met | The chart uses camelCase values and enabled switches, image and resources blocks, release-derived names and standard labels, a values schema, and the corrected chart metadata and storage documentation. |
| 2 | Rename old values, report removed keys where feasible, and document migration for every renamed value. | ✅ Met | Removed values fail with replacement hints, and the upgrade table covers the old and new names, including the values renamed in this change. |
Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: charts/tesk/templates/ingress/ingress-rules.yaml:19, tests/test_chart.py:360
Set ingressClassName for any class that is set, also one that YAML reads as 0 or false, instead of skipping it; check the defaults of the container's security context when values are merged into it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Linked issues
#228 refactor: follow the Helm conventions in the chart · 4 of 6 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Follow Helm conventions for values, including camelCase names, image and resources blocks, and enabled switches. | ✅ Met | The chart values and templates use the conventions, including the renamed keys in this PR. |
| 2 | Use release-derived resource names, standard labels, and helper templates. | ✅ Met | The templates use the fullname and label helpers. |
| 3 | Add values validation, correct the storage documentation, and provide the requested Chart.yaml metadata. | ✅ Met | The schema closes chart-owned maps while leaving Kubernetes-field maps open; the storage documentation and chart metadata are present. |
| 4 | Deprecate old keys for one release where feasible. | 🟡 Partly met | The old keys are identified with replacements, but setting one fails installation immediately rather than allowing a deprecation period. |
| 5 | Cover every renamed value in the upgrade notes. | ✅ Met | The upgrade table includes the original snake_case names and the additional renamed values in this PR. |
| 6 | Ship the breaking value changes in their own release with upgrade notes. | 👀 Check by hand (manual process) | Verify that release preparation ships these breaking changes as the separate release described in the issue. |
Summary
Finishes #228 (its sub-issues #247 and #248 are merged): the remaining parts of the chart that didn't follow Helm's conventions, or the org's other charts (foca-common, cloud-registry).
Breaking (for the 0.3.0 chart release, which is breaking already; the old keys fail the installation with their replacements, and the upgrade notes list them):
Values renamed:
ingress.rulesingress.enabled(as in foca-common andhelm create)ingress.ingressClassNameingress.className(as in foca-common andhelm create)transfer.activetransfer.enabledftp.hostipftp.hostIp(camelCase)auth.env_basegroup(andauth.envBasegroupfrom chore(chart): follow Helm conventions #249, ondevonly)auth.envBaseGrouptesk.securityContext.enabledtesk.podSecurityContextandtesk.securityContext, maps with the same defaults (as inhelm create);nullremoves a field or a context, e.g.podSecurityContext.runAsUser: nullon OpenShiftvalues.schema.jsoncloses the chart's own maps (additionalProperties: false), so typos fail instead of being ignored. Maps with Kubernetes' fields stay open (resources, security contexts, probes, annotations), as doesglobal. The removed keys are declared ($defs/removed), so that the templates can still name their replacements. Theenabledswitches are booleans, as in foca-common.tesk.checkRemovedValuessupports nested maps (fortesk.securityContext.enabled).An empty
ingress.classNamenow leavesingressClassNameout of the Ingress (it rendered as null before).The TLS secret template is
tls-secret.yaml-TEMPLATE(wastls_secret_name.yml-TEMPLATE, whose secret nametls_secretwasn't a valid name).Docs: configuration reference, deployment guide (Ingress, OpenShift with the security context, shared file system, auth), MicroK8s and local FTP guides, and the upgrade notes (table of renamed values, example, schema, TLS template).
Checked against #228 and current
dev: snake_case keys, image/resources blocks, release-derived names,_helpers.tplwith standard labels,Chart.yamlmetadata (description,appVersion,home,sources,maintainers,icon),storagedocs and indentation were done by #249/#263;appVersionand the chart version are left to the release-prep PR.Closes #228
Verification
REQUIRE_HELM=1 pytest tests/test_chart.pywith Helm v3.22.1 (CI's pin): 377 passed. New/changed tests were written first and failed before the change: removed keys (incl. nestedtesk.securityContext.enabled), security context defaults/merge/null, schema rejects unknown keys, schema declares every removed key, chart file names.helm lint charts/tesk --strict: passed;helm template tesk charts/tesk: renders.pre-commit run --all-files: passed.coverage run -m pytest --ignore=tests/test_chart.py: 53 passed, 100% coverage.mkdocs build --strict: passed.Chart installjob (kind cluster). CI: all checks passed (incl. Chart install, Chart, Lint, Test, Docs, CodeQL, Read the Docs;CI passed).Review (adversarial + quality, 2 rounds): fixed the closed root schema rejecting
tesk.enabledfrom parent charts (condition: tesk.enabled; newtest_dependency), the Route also rendering for a missingingress.enabled, numericingress.className, docs on which maps are open, plus small doc/test fixes. Round 2: no findings. After the fixes: 380 chart tests passed; lint, pre-commit and the docs build passed again.Sourcery: fixed an ingress class that YAML reads as
0/falsebeing skipped, and a test that didn't check the merged container defaults (de44c77); answered "no deprecation period" (see Declined). CI passed again after the fixes.Declined review findings
Sourcery: deprecate the old keys for one release instead of failing (medium): declined. feat(chart)!: derive resource names from release #263 already ended the deprecation, as this release must be installed again anyway; failing with the replacement named avoids silently ignored keys (e.g., the authorisation group).
Close the security-context and probe maps too (medium): declined. They take Kubernetes' fields, which foca-common also leaves open; listing every field would lag behind Kubernetes. The schema
$commentand docs say so;tesk.securityContext.enabledis caught by the templates.Drop the dev-only
auth.envBasegrouprow from the upgrade table (medium): declined. Deployments fromdevexist, and an ignored key would silently fall back to the default authorisation group; the test keeps the table and the check in sync.Add
kubeVersion,imagePullSecrets,nodeSelector/tolerations/affinity,podAnnotationsetc. fromhelm create(note): not in refactor: follow the Helm conventions in the chart #228, and new features rather than conventions; separate issues if wanted.Mention the accepted
global/enabledkeys in the configuration docs (low, optional): skipped; they are for parent charts, and the schema describes them.Open questions
None.
🤖 Generated with Claude Code