feat(template): Generate NOTES.txt for every operator chart - #646
Draft
lfrancke wants to merge 1 commit into
Draft
feat(template): Generate NOTES.txt for every operator chart#646lfrancke wants to merge 1 commit into
lfrancke wants to merge 1 commit into
Conversation
helm install currently prints nothing. This adds the NOTES.txt that
hive-operator#753 and kafka-operator#1013 landed per repo, generated instead so
the remaining twelve do not need hand-written copies.
The template needs no new configuration. The three fields it varies on already
exist and are already used the same way by README.md.j2:
operator.pretty_string the product name
operator.product_string the documentation slug
operator.hub_component_slug | default(product_string) the Hub slug, which
only spark-k8s overrides
operator.config.has_product | default(true) the gate below
commons, listener and secret have has_product false, so they get different prose
and no Hub link, because they own no product custom resource and have no Hub
component page. Their pretty_string already ends in "Operator", so the sentence
uses chart_title for them and would otherwise read "the Stackable operator for
Stackable Secret Operator".
Output is byte-identical to the NOTES.txt already merged in hive-operator and
kafka-operator, and to the files in the open trino-operator and zookeeper-operator
pull requests, so the next rollout adds the file to twelve charts and shows no
diff for those four.
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.
Draft, for discussion. This shows what generating
NOTES.txtfrom the template looks like, as an alternative to the per-repo copies now landing in each operator.The plumbing is one file and no new configuration
README.md.j2already varies on exactly the three thingsNOTES.txtneeds, so this reuses its idioms verbatim:operator.pretty_stringoperator.product_stringoperator.hub_component_slug | default(operator.product_string)spark-k8s, which issparkoperator.config.has_product | default(true)commons,listener,secretNo change to
config/repositories.yaml.The special case
commons,listenerandsecrethavehas_product: false. They own no product custom resource and have no Hub component page, so they get different prose and no Hub link.They also need
chart_titlerather thanpretty_string, because theirpretty_stringalready ends in "Operator". Without that the sentence reads "the Stackable operator for Stackable Secret Operator" — the same doubling thatchart_titlewas introduced to fix for the chart headings.Rendered:
Verified
Rendered all 16 and checked each product-name line and both links. The docs slug equals
product_stringfor every operator, including the three whose docs module is<name>-operator, so no per-operator mapping is needed.Output is byte-identical to the
NOTES.txtalready merged in stackabletech/hive-operator#753 and stackabletech/kafka-operator#1013, and to the files in the open stackabletech/trino-operator#935 and stackabletech/zookeeper-operator#1080. So the next rollout adds the file to twelve charts and shows no diff for those four.A generated
NOTES.txtalso renders correctly throughhelm install --dry-runfor ahas_product: falsechart, which is the path the per-repo copies have never exercised.One caveat on the verification:
ansible-playbookis currently broken on this machine (Local RPC server did not start, Python 3.14 against this build), so the render used Jinja2 configured with the settingsansible.builtin.templateapplies —trim_blockson,lstrip_blocksoff,keep_trailing_newlineon, and the delimitersplaybook/update_repo.yamlpasses. Worth re-running through the real playbook before this is merged, since mismatched Jinja settings are what caused #620.Trade-off worth deciding
Generating it means the wording is one edit for all 16 instead of 16 edits. It also means an operator cannot tailor its own notes without an
ignored_filesentry. The threehas_product: falsecharts already show that the prose does not generalise perfectly; if more operators end up wanting their own wording, the conditional grows and the per-repo file becomes the simpler option.