Skip to content

chore(chart): follow Helm conventions - #249

Merged
uniqueg merged 7 commits into
devfrom
chore/helm-conventions
Nov 7, 2026
Merged

uniqueg merged 7 commits into
devfrom
chore/helm-conventions

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

The chart follows Helm's conventions as far as it can without breaking existing installs (the non-breaking half of #228; the breaking half, release-derived names and selector labels, is #248, on hold):

  • camelCase values (hostName, tesk.tesApiBasePath, auth.serviceInfoPublic, ingress.tlsSecretName, …), image blocks (repository, tag, pullPolicy) for the API, taskmaster and filer, and a resources block for the API.
  • The old keys still work and take precedence (they can only be set by users, and helm upgrade --reuse-values keeps the old defaults, with old keys only). All templates read the renamed values through one resolver, tesk.resolveValues, driven by the list tesk.renamedValues in _helpers.tpl. NOTES.txt lists the deprecated keys in use, with their new names, and mentions --reuse-values.
  • Standard labels (app.kubernetes.io/*, helm.sh/chart) on every object's metadata; the API's pods get name and instance. Selectors are unchanged (app: tesk-api).
  • Chart.yaml metadata: description (typo fixed), appVersion: "1.1.0" (the tesk-api version, the default image tag), home, icon, sources, keywords, maintainers (as in foca-common).
  • A permissive values.schema.json: it checks maps vs scalars and the pull policy, and accepts scalars of any type, unknown keys and the old keys.
  • Indentation and comment fixes in values.yaml and the templates (e.g., storage: none documented correctly, CRLF in aws-secret.yaml).
  • Docs: the configuration reference and the deployment guide use the new keys; the upgrade notes have the old-to-new mapping, an example and the caveats (precedence, --reuse-values, labels, schema); docs/development.md describes the new chart tests.

Closes #247

Same objects as before

Every values file that worked with the chart on dev renders the same objects, apart from the added labels. The chart tests check this against a verbatim copy of the chart before this change (tests/data/legacy-chart/, from 27a6945) for the defaults, the old defaults, every old key, and empty, null and string values (test_legacy_chart), and with the old defaults as chart defaults, as helm upgrade --reuse-values uses them (test_reuse_values). The one difference: with --reuse-values and an old resource key set to null, the old chart rendered cpu: null, and this one leaves cpu out, which Kubernetes reads the same way.

helm template diffs (objects parsed, sorted by kind and name, dumped with sorted keys; old chart = tests/data/legacy-chart):

Default values: only labels added
--- old
+++ new
@@ -7,11 +7,23 @@
     createdAt: 2021-04-06\nenvironment: dev\nversion: 1.0\nstorage:\n- ftp://ftp-private.ebi.ac.uk\n"
 kind: ConfigMap
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: service-info-config
 ---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: tesk-api
 spec:
   replicas: 1
@@ -22,6 +34,8 @@
     metadata:
       labels:
         app: tesk-api
+        app.kubernetes.io/instance: tesk
+        app.kubernetes.io/name: tesk
     spec:
       containers:
       - env:
@@ -112,6 +126,12 @@
   annotations:
     cert-manager.io/cluster-issuer: letsencrypt-production
     kubernetes.io/tls-acme: 'true'
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: ingress-rules
 spec:
   ingressClassName: null
@@ -130,6 +150,12 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: Role
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: taskmaster
 rules:
 - apiGroups:
@@ -170,6 +196,12 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: RoleBinding
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: taskmaster-role-binding
 roleRef:
   apiGroup: rbac.authorization.k8s.io
@@ -182,6 +214,12 @@
 apiVersion: v1
 kind: Secret
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: ftp-secret
 stringData:
   password: null
@@ -193,6 +231,11 @@
 metadata:
   labels:
     app: tesk-api
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: tesk-api
 spec:
   ports:
@@ -204,4 +247,10 @@
 apiVersion: v1
 kind: ServiceAccount
 metadata:
-  name: taskmaster
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
+  name: taskmaster
A values file with the old keys: only labels added

Values:

host_name: tes.example.org
storageClass: fast
tesk:
  image: docker.io/elixircloud/tesk-api:1.2.0
  tes_api_base_path: /ga4gh/tes/v1
  taskmaster_image_version: v0.10.7
  executor_retries: 4
  limitsCpu: 2
  requestsMemory: 1Gi
  swaggerUi:
    enabled: true
transfer:
  active: true
  wes_base_path: /data
  pvc_name: shared-pvc
auth:
  mode: auth
  env_subgroup: EBI
  service_info_public: false
  client_id: my-client
  client_secret: not-a-real-secret
service:
  type: NodePort
  node_port: 31567
ftp:
  classic_ftp_secret: ""
  netrc_secret: netrc-secret
  hostip: 192.168.99.1
ingress:
  ingressClassName: nginx
  tls_secret_name: tesk-tls

Diff:

--- old
+++ new
@@ -7,11 +7,23 @@
     createdAt: 2021-04-06\nenvironment: dev\nversion: 1.0\nstorage:\n- ftp://ftp-private.ebi.ac.uk\n"
 kind: ConfigMap
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: service-info-config
 ---
 apiVersion: apps/v1
 kind: Deployment
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: tesk-api
 spec:
   replicas: 1
@@ -22,6 +34,8 @@
     metadata:
       labels:
         app: tesk-api
+        app.kubernetes.io/instance: tesk
+        app.kubernetes.io/name: tesk
     spec:
       containers:
       - env:
@@ -117,6 +131,12 @@
 apiVersion: v1
 kind: Endpoints
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: ftp
 subsets:
 - addresses:
@@ -130,6 +150,12 @@
   annotations:
     cert-manager.io/cluster-issuer: letsencrypt-production
     kubernetes.io/tls-acme: 'true'
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: ingress-rules
 spec:
   ingressClassName: nginx
@@ -152,6 +178,12 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: Role
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: taskmaster
 rules:
 - apiGroups:
@@ -192,6 +224,12 @@
 apiVersion: rbac.authorization.k8s.io/v1
 kind: RoleBinding
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: taskmaster-role-binding
 roleRef:
   apiGroup: rbac.authorization.k8s.io
@@ -204,6 +242,12 @@
 apiVersion: v1
 kind: Secret
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: netrc-secret
 stringData:
   .netrc: ''
@@ -212,6 +256,12 @@
 apiVersion: v1
 kind: Secret
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: oauth-client-secret
 stringData:
   id: my-client
@@ -221,6 +271,12 @@
 apiVersion: v1
 kind: Service
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: ftp
 spec:
   ports:
@@ -233,6 +289,11 @@
 metadata:
   labels:
     app: tesk-api
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: tesk-api
 spec:
   ports:
@@ -245,4 +306,10 @@
 apiVersion: v1
 kind: ServiceAccount
 metadata:
+  labels:
+    app.kubernetes.io/instance: tesk
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: tesk
+    app.kubernetes.io/version: 1.1.0
+    helm.sh/chart: tesk-0.1.1
   name: taskmaster

For both, the objects without the standard labels are equal to the old chart's.

Verification

  • helm lint charts/tesk --strict (Helm 3.22.1): passes.
  • REQUIRE_HELM=1 pytest: 234 passed (181 chart tests, 53 others).
  • coverage run -m pytest --ignore=tests/test_chart.py: 100% coverage.
  • ruff check, ruff format --check, mypy: pass. mkdocs build --strict: passes.
  • pre-commit couldn't fetch its hook repos in the sandbox; CI's Lint job runs them.
  • CI: all checks pass (PR title, Lint, Test, Chart, Chart install on kind, Docs, CodeQL, Codecov, Read the Docs preview).

Review

Full review (Helm chart): adversarial-reviewer and quality-reviewer, 2 rounds.

  • Round 1 fixes:

    • Empty old resource values rendered cpu: '', which Kubernetes rejects: old resource values are parsed as YAML now, as the old templates did.
    • --reuse-values --set tesk.image.tag=… failed: the repository has a default now.
    • The schema rejected values that worked before (numbers for text keys, ingress.annotations: ""): widened.
    • The notes now mention --reuse-values.
    • The tests now compare with a copy of the old chart for many value sets.
    • The duplicated fallbacks were replaced by one resolver.
    • The precedence tests now cover every renamed key.
    • The pull policy is documented.
    • The pre-commit excludes for the old chart's copy were narrowed to that copy.
  • Round 2 fixes:

    • A null block in a nested path (e.g., --reuse-values with tesk.limitsCpu=null, or tesk.resources=null) failed the rendering ("nil is not a command"): fixed, with regression tests.
    • Invalid YAML in old resource values fails again, as before.
    • Values parsed as YAML are now marked in the list instead of matched by prefix.
    • Added a consistency check of the test lists, and maintenance notes in docs/development.md.
  • Sourcery (4 threads): fixed a tag of 0 being replaced by appVersion, and quoted the release name in app.kubernetes.io/instance (numeric release names), with tests; replied to the third (a null tesk.resources block with an old key), which doesn't occur, as Helm deletes null keys while coalescing (covered by test_resources_null).

Declined review findings

  • Sourcery: the schema restricts tesk.image.pullPolicy to its valid values. Kept: it is a new key, so the check can't break values that worked before, and Kubernetes rejects other policies anyway.
  • icon points to the dev branch: same as foca's chart (foca-common); the logo isn't expected to move.
  • test_notes_reuse_values placement at the end of the test file: cosmetic.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 6 commits November 7, 2026 06:36
Test the camelCase values, image and resources blocks, labels, notes,
schema and Chart.yaml metadata of #247, and that the deprecated keys
and the earlier defaults (tests/data) still render the objects of the
chart before the renaming, also as with helm upgrade --reuse-values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rename the values to camelCase, with image blocks for the API,
taskmaster and filer and a resources block for the API. The old keys
still work, take precedence (they are only set by users, and
helm upgrade --reuse-values keeps the old defaults) and are listed as
deprecated in NOTES.txt. Add the standard labels to the objects'
metadata (not to selectors), a permissive values.schema.json and the
metadata of Chart.yaml (appVersion: the default tag of tesk-api), and
fix the indentation and comments of values and templates. Existing
values files render the same objects, apart from the labels.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Update the configuration reference and the deployment guide to the
camelCase values, and add upgrade notes with the old and new keys.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Address the review: read the renamed values with one resolver driven by
tesk.renamedValues; parse old resource values as YAML as the earlier
templates did (an empty limit is dropped, not rendered as ''); default
the API's repository for a partial image map with --reuse-values;
widen the schema to accept any scalar and a string for maps; mention
--reuse-values in the notes. Compare with a copy of the earlier chart
(tests/data/legacy-chart) for many values instead of one snapshot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Document that old keys win even when empty, what the schema checks,
the pull policy values, the --reuse-values exceptions, and that
appVersion is the tesk-api version, not the release version.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A null old key with --reuse-values, or a null block of new keys, made
the resolver assign nil as a command, which failed the rendering. Walk
missing maps to null instead, fail on old resource values that aren't
valid YAML (as the earlier templates did), and mark those values in
tesk.renamedValues instead of matching their prefix. Check that the
test lists of renamed keys agree, and document how to remove the
deprecated names' tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Define the new chart values interface and validate its structure while preserving support for deprecated keys.

  • charts/tesk/values.schema.json L1-362
  • charts/tesk/values.yaml L5-135

Implementation

Centralize legacy-value resolution and deprecation reporting, then apply the new values and standard labels when rendering chart resources.

  • charts/tesk/templates/NOTES.txt L1
  • charts/tesk/templates/_helpers.tpl L1-135
  • charts/tesk/templates/common/oauth-client-secret.yaml L1-3, L5 (removed lines), L8-14
  • charts/tesk/templates/common/service-info-cm.yaml L5-6
  • charts/tesk/templates/common/taskmaster-rbac.yaml L6-7, L13-14, L55-56
  • charts/tesk/templates/common/tesk-deployment.yaml L1-32, L53-100, L118-129 (+4 small edits)
  • charts/tesk/templates/common/tesk-svc.yaml L1-2, L9-19
  • charts/tesk/templates/ftp/ftp-endpoint.yaml L1-14
  • charts/tesk/templates/ftp/ftp-secret.yaml L1-9, L14
  • charts/tesk/templates/ftp/ftp-service.yaml L1-15
  • charts/tesk/templates/ftp/netrc-secret.yaml L1-9, L14
  • charts/tesk/templates/ingress/ingress-rules.yaml L1-27, L37
  • charts/tesk/templates/openshift/oc-route.yaml L1-4, L9-12, L23-27
  • charts/tesk/templates/storage/aws-secret.yaml L1-11
  • charts/tesk/templates/storage/openstack.yaml L1-7, L10 (removed lines), L13

Configuration

Update chart release metadata and pre-commit exclusions for the retained legacy-chart test fixture.

  • .pre-commit-config.yaml L14-23
  • charts/tesk/Chart.yaml L3-28

Documentation

Update user and developer documentation for the renamed values, migration behavior, chart metadata, and regression-test maintenance.

  • docs/api.md L6, L24
  • docs/configuration.md L8-20, L36-48, L66-70 (+6 small edits)
  • docs/deployment.md L60-64, L224-228, L261-275 (+9 small edits)
  • docs/development.md L44-60, L189-191
  • docs/upgrading.md L12-100 (+3 small edits)

Tests

Add rendered-chart tests for the new interface, compatibility and precedence, labels, schema, notes, metadata, and reuse-values upgrades, using a preserved copy of the earlier chart as the comparison baseline.

  • tests/data/legacy-chart/Chart.yaml L1-17
  • tests/data/legacy-chart/templates/common/oauth-client-secret.yaml L1-10
  • tests/data/legacy-chart/templates/common/service-info-cm.yaml L1-6
  • tests/data/legacy-chart/templates/common/taskmaster-rbac.yaml L1-57
  • tests/data/legacy-chart/templates/common/tesk-deployment.yaml L1-140
  • tests/data/legacy-chart/templates/common/tesk-svc.yaml L1-13
  • tests/data/legacy-chart/templates/ftp/ftp-endpoint.yaml L1-11
  • tests/data/legacy-chart/templates/ftp/ftp-secret.yaml L1-10
  • tests/data/legacy-chart/templates/ftp/ftp-service.yaml L1-11
  • tests/data/legacy-chart/templates/ftp/netrc-secret.yaml L1-10
  • tests/data/legacy-chart/templates/ingress/ingress-rules.yaml L1-29
  • tests/data/legacy-chart/templates/openshift/oc-route.yaml L1-22
  • tests/data/legacy-chart/templates/storage/aws-secret.yaml L1-9
  • tests/data/legacy-chart/templates/storage/openstack.yaml L1-11
  • tests/data/legacy-chart/values.yaml L1-106
  • tests/helm.py L17-23, L28-41, L62-128 (+3 small edits)
  • tests/test_chart.py L25-174, L289-354, L615-919 (+15 small edits)

Other changes

Files not grouped.

  • tests/data/legacy-chart/service-info/service-info.yaml L1-17

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (27a6945) to head (ca8def0).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #249   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          229       229           
=========================================
  Hits           229       229           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review November 7, 2026 06:13

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="charts/tesk/templates/common/tesk-deployment.yaml" line_range="22" />
<code_context>
+{{- $resources := deepCopy (dig "resources" dict $tesk) -}}
+{{- range $old, $path := dict "limitsCpu" (list "limits" "cpu") "limitsMemory" (list "limits" "memory") "requestsCpu" (list "requests" "cpu") "requestsMemory" (list "requests" "memory") -}}
+{{- if hasKey $tesk $old -}}
+{{- if not (kindIs "map" (index $resources (index $path 0))) -}}
+{{- $_ := set $resources (index $path 0) dict -}}
+{{- end -}}
</code_context>
<issue_to_address>
**Null resources block rendering**

When `tesk.resources` is null and a deprecated resource key is set, including an old default retained by `--reuse-values`, `deepCopy` preserves null in `$resources`, so the `index` call at `av` fails before the deprecated key can override it, and Helm cannot render or upgrade the release.

Initialize `$resources` to an empty map when it is null before indexing it.

Also at `charts/tesk/templates/common/tesk-deployment.yaml:23-24`.
</issue_to_address>

### Comment 2
<location path="charts/tesk/templates/common/tesk-deployment.yaml" line_range="15" />
<code_context>
+{{- $pullPolicy := "" -}}
+{{- if kindIs "map" $tesk.image -}}
+{{- $repository := $tesk.image.repository | default "docker.io/elixircloud/tesk-api" -}}
+{{- $image = printf "%s:%s" $repository (toString ($tesk.image.tag | default .Chart.AppVersion)) -}}
+{{- $pullPolicy = $tesk.image.pullPolicy -}}
+{{- end -}}
</code_context>
<issue_to_address>
**Configured image tag zero is ignored**

When `tesk.image.tag` is set to numeric `0`, sprig’s `default` treats `0` as empty, so the image expression uses `.Chart.AppVersion` instead of the configured tag and deploys a different API image.

Select the configured tag based on whether it is present, rather than using `default` to test its value.
</issue_to_address>

### Comment 3
<location path="charts/tesk/templates/_helpers.tpl" line_range="19" />
<code_context>
+*/}}
+{{- define "tesk.podLabels" -}}
+app.kubernetes.io/name: {{ .Chart.Name }}
+app.kubernetes.io/instance: {{ .Release.Name }}
+{{- end -}}
+
</code_context>
<issue_to_address>
**Numeric release names fail installation**

When the release name looks like a YAML scalar, such as `123`, the `app.kubernetes.io/instance` value is emitted without quotes, so a release name such as `123` is parsed as a number rather than a string. Kubernetes rejects objects whose label values are not strings, so installation fails.

Quote the interpolated release name in the label value.
</issue_to_address>

Linked issues

#247 chore(chart): follow Helm conventions without breaking installs · 10 of 10 met

# Requirement Status Notes
1 Rename values to camelCase and keep deprecated names working, with NOTES.txt listing deprecated keys in use ✅ Met The resolver handles the renamed keys, and deprecatedValues also detects the legacy string form of tesk.image; tests cover deprecated-name rendering and notes.
2 Use image blocks for the API, taskmaster and filer, and a resources block for the API, with fallbacks to old keys ✅ Met The API image and resource handling account for legacy values, while the resolver maps the renamed taskmaster and filer settings; tests cover these paths.
3 Add Chart.yaml metadata: description, home, sources, maintainers, icon, keywords and appVersion ✅ Met Chart.yaml includes the requested metadata and sets appVersion to the default API image tag.
4 Add standard labels to object metadata, never to selectors ✅ Met The templates add standard labels to rendered objects and pod labels; tests verify the Deployment and Service selectors remain unchanged.
5 Add a permissive values.schema.json that checks types and allows old keys ✅ Met The schema checks map/scalar structure and pull policy, permits legacy keys and unknown properties, and accepts scalars of any type.
6 Fix indentation and comments in values.yaml and the templates ✅ Met The values and templates include the described formatting and comment changes.
7 Update the configuration reference, deployment guide and upgrade notes with the new names and old-to-new mapping ✅ Met The docs use the new names and the upgrade notes include the mapping, an example and the requested caveats.
8 Existing values files render the same objects as before, apart from added labels ✅ Met Tests compare renderings against the legacy chart for defaults, legacy defaults and numerous legacy-value cases; the PR description also provides rendered diffs.
9 Cover the new keys and fallbacks in chart tests ✅ Met Tests exercise renamed values, legacy compatibility and precedence, image and resource blocks, labels, notes and schema behavior.
10 Map every old key to its new key in the upgrade notes ✅ Met The upgrade table covers the renamed keys, including the old string form of tesk.image.

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: charts/tesk/templates/common/tesk-deployment.yaml:22, charts/tesk/templates/common/tesk-deployment.yaml:15, charts/tesk/templates/_helpers.tpl:19


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread charts/tesk/templates/_helpers.tpl Resolved
Use a tesk.image.tag of 0 instead of replacing it with appVersion
(default treats 0 as empty), and quote the release name in the
app.kubernetes.io/instance label, so that a numeric release name is a
string (from the Sourcery review).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Linked issues

#247 chore(chart): follow Helm conventions without breaking installs · 7 of 8 met

# Requirement Status Notes
1 Use camelCase values, image blocks, and a resources block ✅ Met The chart values, templates, configuration reference, and deployment guide use the new names and structures.
2 Keep the old keys working and warn about deprecated keys in use ✅ Met The shared resolver supports the old names with precedence over the new names, and the notes list deprecated keys and their replacements.
3 Add the requested Chart.yaml metadata ✅ Met Chart.yaml adds the description, home, sources, maintainers, icon, keywords, and appVersion.
4 Add standard labels to object metadata, not selectors ✅ Met The templates add standard labels to their objects and add name and instance labels to API pods while retaining the existing selectors.
5 Add a permissive schema that checks types and allows old keys 🟡 Partly met The schema allows deprecated keys and is broadly permissive, but it also restricts pullPolicy to an enum rather than checking types only.
6 Fix indentation and comments in values.yaml and templates ✅ Met The changed values and templates include the requested formatting and comment updates.
7 Document the configuration, deployment, and old-to-new value mapping ✅ Met The configuration and deployment docs use the new names, and the upgrade notes include the mapping, example, and migration caveats.
8 Preserve rendered objects apart from labels and test the new keys and fallbacks ✅ Met Chart tests compare representative legacy values and defaults against the copied earlier chart, and test renamed values, precedence, and reuse-values behavior.

Comment thread tests/test_chart.py Resolved
@uniqueg
uniqueg merged commit e459f50 into dev Nov 7, 2026
35 checks passed
@uniqueg
uniqueg deleted the chore/helm-conventions branch November 7, 2026 06:27
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.

chore(chart): follow Helm conventions without breaking installs

1 participant