Implementation:MaterializeInc Materialize Helm Chart Version Bump
| Knowledge Sources | misc/python/materialize/cli/helm_chart_version_bump.py (lines 20-108) |
|---|---|
| Domains | Release Engineering, Helm, Kubernetes, YAML Processing, Python |
| Last Updated | 2026-02-08 |
Overview
Concrete Helm chart and Kubernetes manifest version bumping tool provided by the helm_chart_version_bump module in Materialize's CLI tooling.
Description
The main() function in helm_chart_version_bump.py updates version references across Materialize's Helm chart ecosystem using ruamel.yaml's round-trip YAML editing. This preserves comments, formatting, and quoting in YAML files while making precise, targeted value changes.
The tool modifies up to five files depending on the flags provided:
misc/helm-charts/operator/Chart.yaml: UpdatesversionandappVersionto the targetenvironmentd_version. If--helm-chart-versionis also specified, theversionfield is overridden to that value.misc/helm-charts/testing/materialize.yaml: Updatesspec.environmentdImageReftomaterialize/environmentd:{version}.misc/helm-charts/operator/values.yaml: (When--bump-orchestratord-version) Updatesoperator.image.tagto the orchestratord version.misc/helm-charts/operator/tests/deployment_test.yaml: (When--bump-orchestratord-version) Updates the expected orchestratord image reference in test assertions.
The orchestratord version logic has two cases:
- Dev versions (containing "dev"): Use the latest released version from
get_all_mz_versions()[0]. - Release versions: Use the version being released.
Usage
Use this implementation when you need to bump Helm chart versions independently of the full release process, or when debugging Helm chart version inconsistencies. This tool can be invoked standalone via the CLI.
Code Reference
Source Location
misc/python/materialize/cli/helm_chart_version_bump.py, lines 20-108.
Signature
def main() -> int:
parser = argparse.ArgumentParser(
prog="helm-chart-version-bump",
description="Bump environmentd (appVersion), orchestratord and helm-chart versions in helm chart.",
)
parser.add_argument(
"--helm-chart-version",
type=str,
help="Helm-chart version to bump to, no change if not set.",
)
parser.add_argument(
"--bump-orchestratord-version",
action="store_true",
help="Bump the orchestratord version to the last released version",
)
parser.add_argument(
"environmentd_version", type=str, help="environmentd version to bump to."
)
args = parser.parse_args()
...
return 0
Import
from materialize.cli.helm_chart_version_bump import main
I/O Contract
Inputs
| Parameter | Type | Required | Description |
|---|---|---|---|
environmentd_version |
str (positional) |
Yes | The environmentd version to bump to (e.g., v0.79.0)
|
--helm-chart-version |
str |
No | Helm chart version to set; if omitted, the chart version defaults to the environmentd version |
--bump-orchestratord-version |
Flag | No | If set, also bumps the orchestratord image tag in values.yaml and test assertions
|
Outputs
| Output | Type | Description |
|---|---|---|
Modified Chart.yaml |
File (YAML) | Updated version and appVersion fields
|
Modified materialize.yaml |
File (YAML) | Updated environmentdImageRef in the Materialize spec
|
Modified values.yaml |
File (YAML) | Updated operator.image.tag (only if --bump-orchestratord-version)
|
Modified deployment_test.yaml |
File (YAML) | Updated orchestratord image assertion (only if --bump-orchestratord-version)
|
| Return code | int |
Always returns 0 on success
|
Usage Examples
Basic environmentd version bump:
python -m materialize.cli.helm_chart_version_bump v0.79.0
Bump with orchestratord version:
python -m materialize.cli.helm_chart_version_bump \
--bump-orchestratord-version \
v0.79.0
Bump with custom Helm chart version:
python -m materialize.cli.helm_chart_version_bump \
--helm-chart-version 1.2.3 \
--bump-orchestratord-version \
v0.79.0
Programmatic invocation:
import sys
sys.argv = [
"helm-chart-version-bump",
"--bump-orchestratord-version",
"v0.79.0",
]
from materialize.cli.helm_chart_version_bump import main
result = main()
assert result == 0
Round-trip YAML editing pattern used internally:
from ruamel.yaml import YAML
yaml = YAML()
yaml.preserve_quotes = True
yaml.width = 4096 # Prevent unwanted line breaks
with open("Chart.yaml") as f:
docs = list(yaml.load_all(f))
docs[0].update({"version": "v0.79.0", "appVersion": "v0.79.0"})
with open("Chart.yaml", "w") as f:
yaml.dump_all(docs, f)