Skip to content

feat(template): Check that Helm defined templates carry the chart name - #647

Merged
lfrancke merged 9 commits into
mainfrom
push-uxpqnklnznyt
Sep 8, 2026
Merged

feat(template): Check that Helm defined templates carry the chart name#647
lfrancke merged 9 commits into
mainfrom
push-uxpqnklnznyt

Conversation

@lfrancke

@lfrancke lfrancke commented Sep 3, 2026

Copy link
Copy Markdown
Member

Adds a script called by prek which walks our charts and checks whether all defines/calls use a namespaced name

I tested it locally:

❯ python3 scripts/check_namespaced_defines.py deploy/helm/trino-operator/templates/*
  deploy/helm/trino-operator/templates/_helpers.tpl: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.appname
    operator.chart
    operator.fullname
    operator.image
    operator.labels
    operator.name
    operator.selectorLabels
    operator.serviceAccountName
    operator.testLabels
  deploy/helm/trino-operator/templates/_maintenance.tpl: defined templates and the calls to them must be prefixed with 'trino-operator.'
    maintenance.envVars
  deploy/helm/trino-operator/templates/_telemetry.tpl: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.appname
    telemetry.envVars
  deploy/helm/trino-operator/templates/clusterrole-operator.yaml: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.fullname
    operator.labels
    operator.name
  deploy/helm/trino-operator/templates/clusterrole-product.yaml: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.labels
    operator.name
  deploy/helm/trino-operator/templates/deployment.yaml: defined templates and the calls to them must be prefixed with 'trino-operator.'
    maintenance.envVars
    operator.appname
    operator.fullname
    operator.image
    operator.labels
    operator.selectorLabels
    operator.serviceAccountName
    telemetry.envVars
  deploy/helm/trino-operator/templates/service.yaml: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.fullname
    operator.labels
    operator.selectorLabels
  deploy/helm/trino-operator/templates/serviceaccount.yaml: defined templates and the calls to them must be prefixed with 'trino-operator.'
    operator.fullname
    operator.labels
    operator.serviceAccountName

This was a checkout before the rollout of #645
It succeeds on main now.

stackabletech/issues#882

Adds a script called by prek which walks our charts and checks whether
all defines/calls use a namespaced name

stackabletech/issues#882
@lfrancke lfrancke self-assigned this Sep 3, 2026
@lfrancke
lfrancke marked this pull request as ready for review September 3, 2026 10:08
@lfrancke lfrancke moved this to Development: Waiting for Review in Stackable Engineering Sep 3, 2026
@Maleware
Maleware self-requested a review September 4, 2026 07:13
@Maleware Maleware moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Sep 4, 2026
@Techassi
Techassi self-requested a review September 4, 2026 07:30
Comment thread template/.pre-commit-config.yaml.j2
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py
* Rename vairable
* Fix the locale so it doesn't depend on the machine
* Switch to a named capture group
The unittest cases in scripts/ had no runner, so they only ran when someone
remembered to. The hook also picks up the cases in
ensure_one_trailing_newline.py.

@Techassi Techassi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, just a two more variable rename suggestion.

Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
Comment thread template/scripts/check_namespaced_defines.py Outdated
lfrancke and others added 6 commits September 8, 2026 11:14
Co-authored-by: Techassi <git@techassi.dev>
Co-authored-by: Techassi <git@techassi.dev>
Co-authored-by: Techassi <git@techassi.dev>
Co-authored-by: Techassi <git@techassi.dev>
Co-authored-by: Techassi <git@techassi.dev>
The suggestion that renamed chart to chart_name overlapped this one, so
applying them in order kept the old parameter name.
@lfrancke
lfrancke requested a review from Techassi September 8, 2026 09:26
@lfrancke
lfrancke added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit ca104d6 Sep 8, 2026
2 checks passed
@lfrancke
lfrancke deleted the push-uxpqnklnznyt branch September 8, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

3 participants