feat(clickhouse): add configurable version parameter - #3476
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
🚧 Files skipped from review as they are similar to previous changes (12)
Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughClickHouse version selection is added across the API, chart values and schema, version-generation tooling, Helm image templates, tests, and the ClickHouse application definition. Supported versions map to common server and Keeper image tags. ChangesClickHouse version selection
Estimated code review effort: 4 (Complex) | ~45 minutes Merge Risk: ⚪ Minimal · up to The change adds selectable ClickHouse versions while preserving the existing v24.9 default, so current installations remain unchanged; no actionable merge-blocking risk remains beyond normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant ChartValues
participant ClickHouseVersionMap
participant ServerAndKeeper
ChartValues->>ClickHouseVersionMap: pass selected version
ClickHouseVersionMap->>ServerAndKeeper: resolve mapped patch tag
ServerAndKeeper-->>ChartValues: render server and Keeper images
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/apps/clickhouse/hack/update-versions.sh`:
- Around line 54-99: Make the supported-version resolution loop fail immediately
when any configured entry in SUPPORTED_MAJORS has no matching tag, instead of
warning and continuing. Ensure the failure occurs before writing VERSIONS_FILE
or updating the generated values.yaml section, preserving all configured
versions and the existing default such as v24.9.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: aff950a2-1602-46e2-9c5e-38ba89191a64
📒 Files selected for processing (12)
api/apps/v1alpha1/clickhouse/types.gopackages/apps/clickhouse/Makefilepackages/apps/clickhouse/README.mdpackages/apps/clickhouse/files/versions.yamlpackages/apps/clickhouse/hack/update-versions.shpackages/apps/clickhouse/templates/_versions.tplpackages/apps/clickhouse/templates/chkeeper.yamlpackages/apps/clickhouse/templates/clickhouse.yamlpackages/apps/clickhouse/tests/version_test.yamlpackages/apps/clickhouse/values.schema.jsonpackages/apps/clickhouse/values.yamlpackages/system/clickhouse-rd/cozyrds/clickhouse.yaml
IvanHunters
left a comment
There was a problem hiding this comment.
Review: request changes
The runtime chart change is sound: the version enum feeds only the image tag, the default v24.9 renders 24.9.2.42 byte-identical to the previous hardcoded tags (so existing installs need no migration), it is not a mutable-identity field (no metadata.name/selector/content-hash derives from it), and helm unittest passes 17/17. The pattern correctly mirrors the sibling DB charts.
The blocking items are all in the hack/update-versions.sh generator and the reproducibility of the committed files/versions.yaml, not in the rendered chart.
Blocking
1. comm is fed version-sorted input and silently drops common tags.
fetch_tags ends with sort -Vu, and that version-sorted output is passed to comm -12. comm requires inputs sorted in the collation order it walks (lexicographic), so it mis-compares at every X.9 -> X.10 boundary where version order and lexicographic order diverge.
Reproduction:
server (sort -V): 24.9.2.42, 24.10.1.1, 25.3.14.14
keeper (sort -V): 24.10.1.1, 25.3.14.14
comm -12 (version-sorted, as the script does) => 25.3.14.14 # 24.10.1.1 lost, exit 0, no warning
comm -12 (lexicographically sorted, correct) => 24.10.1.1, 25.3.14.14
Consequence: on the next make update, a whole major line can drop out of COMMON_TAGS, the script prints only Warning: no tag found for X.Y, skipping, and that major disappears from the enum. Existing tenant CRs pinned to the dropped version then fail schema validation. Fix is one line: feed comm a plain sort -u (lexicographic) intersection, and keep sort -V only for the per-major tail -n1 pick, which already does it.
2. The committed files/versions.yaml is not reproducible by its own generator.
The file pins v24.9 -> 24.9.2.42, but the latest patch common to both clickhouse/clickhouse-server and clickhouse/clickhouse-keeper on the 24.9 line is 24.9.3.128 (verified against Docker Hub, present in both repos). The generator selects the latest patch per major (sort -V | tail -n1), so the first real make update would write v24.9 -> 24.9.3.128, changing the image for every default-version install and turning tests/version_test.yaml red (it hardcodes 24.9.2.42).
The PR body only promises to preserve the major, which is honoured, but the "renders byte-for-byte identically" guarantee and the test assertion both rest on a hand-pinned patch the generator will not reproduce. Please either add a patch-pin mechanism for the default line, or have version_test.yaml derive the expected tag from files/versions.yaml instead of hardcoding it, so the generator and the committed artifacts cannot drift apart.
Should fix (robustness)
3. Non-atomic regeneration. update-versions.sh writes versions.yaml before it edits values.yaml, and make generate is a separate step. A failure in between (see item 4) leaves versions.yaml updated while the enum/schema/README/types.go are stale. Collect all outputs into temp files and apply them at the end.
4. Does not run on stock macOS. declare -A requires bash 4+ (macOS ships 3.2), and BSD awk rejects -v new_section=... with embedded newlines (awk: newline in string). Combined with item 3 this corrupts the tree mid-run. If make update requires GNU awk + bash 4, state it; otherwise make the script portable.
Non-blocking notes
- Downgrade hazard.
versionis editable with no ordering guard, sov25.8->v24.9is reachable and schema-valid. ClickHouse cannot read data written by a newer server, and Keeper snapshots are not backward compatible, so a downgrade lands the pods in CrashLoopBackOff with no legible "downgrade unsafe" signal. This matches existing precedent (postgres et al. have the same gap), so a CEL immutability guard is not required, but please add a warning to the parameter description. - Default
v24.9is an EOL non-LTS line (LTS are 25.3 and 25.8). Preserving it for existing installs is correct, but fresh installs get an EOL default by omission. templates/_versions.tplfailbranch is effectively dead code behind schema-enum validation (harmless defense-in-depth).tests/version_test.yamlasserts on the Helm-4 jsonschema error string, which is brittle across helm versions in CI.- The server/Keeper image references are neither digest-pinned nor routed through
cozy-lib.image, so mirrored/air-gapped installs cannot rewrite the registry. Pre-existing, but the new version-map indirection is a natural place to add mirror routing.
|
Follow-up: I re-ran the generator end-to-end against the live Docker Hub catalogs (server 540 tags, keeper 401) to pin down the exact current impact of the two blocking items. Refined severity: Item 2 (versions.yaml not reproducible) is the immediate one. The generator's per-major pick resolves Item 1 (comm on version-sorted input) is real but currently latent. The buggy Verdict unchanged; both still warrant a fix to the generator. |
|
Thanks for the thorough review, IvanHunters — all four blocking items and the robustness notes are addressed in 25f408d. TDD: the generator's behaviour is now pinned by Blocking 1 — Blocking 2 — committed Blocking 3 — non-atomic regeneration. Both Blocking 4 — does not run on stock macOS. Dropped the bash-4 associative array (parallel indexed arrays + a Non-blocking. Downgrade hazard: added an explicit "downgrading is unsafe — only increase this value" sentence to the |
IvanHunters
left a comment
There was a problem hiding this comment.
LGTM with non-blocking notes.
Clean, well-tested feature that faithfully mirrors the established managed-DB
version-selection pattern (postgres/mariadb/redis/mongodb/opensearch/rabbitmq).
Verified by hand, not just by reading:
Verified
- Upgrade of existing installations is byte-for-byte safe: a CR with no
spec.versionrenders24.9.2.42via the chart default, and an explicit
empty value is fail-closed by the schema enum. - All generated artifacts are consistent and up to date:
values.yaml,
values.schema.json,types.go, theclickhouse-rdopenAPISchema and
README.mdall carry the samev25.8/v25.3/v24.9enum with defaultv24.9;
re-runningcozyvalues-genproduces an empty diff. - Tests pass: helm-unittest 5/5 and the bats generator suite 7/7 (including the
byte-collation invariant across the X.9 -> X.10 boundary and the pinned-default
reproduction).
Non-blocking notes (all scoped to the maintainer-run hack/update-versions.sh,
whose output is always reviewed via git diff; none affect what this PR ships):
update-versions.sh(default fallback): if the current default's major is
removed fromCH_SUPPORTED_MAJORS,DEFAULT_VERSION="${MAJORS[0]}"silently
promotes the newest major as the new default. Losing the current default would
be safer as a hard error than a silent fallback.pin_foris keyed to a hardcodedv24.9rather than to "whichever major is
the default", so if the default ever moves it becomes unpinned and subsequent
regenerations can patch-bump its image.- The values.yaml splice loop only clears
in_sectionon aversion:line, so
a malformed input (enum header present,version:line absent) would swallow
everything to EOF. Cannot happen with the well-formed committed file; worth a
bounded terminator for robustness.
Not raised as a blocker: there is no CEL transition guard preventing a version
downgrade (the field doc says "only increase"), but this matches every sibling
DB chart, so it belongs to a family-wide change rather than this PR.
The note about terraform-provider-cozystack needing a matching version
attribute is correct and reasonably left as a maintainer decision.
|
Thanks IvanHunters — the three
The unrelated E2E failure on the previous run was a control-plane flake (cluster-wide leader-election timeouts, "Wait for Cluster-API provider deployments"; ClickHouse itself reconciled) — I re-ran it. If the current state looks good, a formal Approve would clear the earlier change-request and unblock the merge. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
hack/clickhouse-update-versions_test.bats (1)
136-147: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExercise the unresolved-major failure path.
Line 144 omits the current default
v24.9. The generator exits during default validation before it resolves26.99. Keep24.9inCH_SUPPORTED_MAJORSso this test verifies that unresolved-version failure preserves both committed files.Proposed test fix
- if CH_SUPPORTED_MAJORS="26.99" bash "$GEN" >/dev/null 2>&1; then echo "expected non-zero exit" >&2; exit 1; fi + if CH_SUPPORTED_MAJORS="26.99 24.9" bash "$GEN" >/dev/null 2>&1; then echo "expected non-zero exit" >&2; exit 1; fi🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@hack/clickhouse-update-versions_test.bats` around lines 136 - 147, Update the atomic failure test around the generator invocation so CH_SUPPORTED_MAJORS retains the current default major 24.9 while also including unresolved major 26.99. Preserve the existing assertions that both versions.yaml and values.yaml remain unchanged after the generator exits non-zero.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@hack/clickhouse-update-versions_test.bats`:
- Around line 136-147: Update the atomic failure test around the generator
invocation so CH_SUPPORTED_MAJORS retains the current default major 24.9 while
also including unresolved major 26.99. Preserve the existing assertions that
both versions.yaml and values.yaml remain unchanged after the generator exits
non-zero.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7d4ef2ad-f665-4403-8eae-b8b82732df3b
📒 Files selected for processing (2)
hack/clickhouse-update-versions_test.batspackages/apps/clickhouse/hack/update-versions.sh
Add a `version` value (v25.8, v25.3, v24.9; default v24.9) to the ClickHouse chart, backed by files/versions.yaml and resolved by templates/_versions.tpl for both the ClickHouse server and Keeper images, so the Cozystack API returns the engine version (spec.version) like the other managed-DB charts. Default v24.9 -> 24.9.2.42 keeps existing installations byte-for-byte identical. The maintainer-run hack/update-versions.sh generator intersects the server/keeper Docker Hub tags byte-collated (LC_ALL=C) so comm keeps tags across the X.9 -> X.10 boundary; freezes the default major to the tag it already ships (read from versions.yaml, so the freeze follows the default); errors on a dropped default or an unresolvable major; writes atomically; and runs on stock macOS bash 3.2 / BSD. Covered by hack/clickhouse-update-versions_test.bats (10 cases) and the tests/version_test.yaml helm-unittest suite. Refs: #1246 Signed-off-by: Alexey Artamonov <[email protected]>
274ae9f to
3c78c0b
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
IvanHunters
left a comment
There was a problem hiding this comment.
This closes the ClickHouse half of the #1246 gap: a selectable version (v25.8 / v25.3 / v24.9, default v24.9) exposed through the API like the other managed databases. Scope is tight, the version generator is atomic and correct on collation, the upgrade path is byte-identical, and the tests are thorough and pass.
Verified without a cluster:
- No regression: the default
v24.9 → 24.9.2.42matches the previous hardcoded tag byte-for-byte, so existing instances do not silently upgrade. No hardcoded ClickHouse tags remain; both server and keeper images resolve throughversionMap. - Tests run and are green: 10/10 bats for the version generator (
hack/clickhouse-update-versions_test.bats, auto-picked up viawildcard hack/*.bats) and 5/5 helm-unittest, including schema rejection ofv1.0. - The implementation mirrors the established sibling pattern (mariadb), with higher coverage since it is the only DB chart with a generator bats test.
Non-blocking notes for the maintainer:
- [MINOR] The
versiondefault is the oldest enum member (v24.9), whereas every other managed-DB chart defaults to its own newest major (mariadb v11.8, mongodb v8, redis v8, postgres v18, opensearch v2). Fresh instances come up on a ~year-old release unless the user picks v25.8. If this is a deliberate upgrade-safety choice, worth confirming for fresh installs specifically. - [MINOR] No downgrade guard on
version, even though the field docstring says downgrading is unsafe. This matches every sibling DB chart (none guard version), so it is a pre-existing platform stance rather than a regression here. - [NIT] The downstream terraform-provider-cozystack is not updated; the PR already flags this.
myasnikovdaniil
left a comment
There was a problem hiding this comment.
Two blockers, both in hack/update-versions.sh, inline.
Generator cannot see the tags it needs, and when it half sees them it silently moves the default image. Fix for both is small: fetch with skopeo list-tags like the postgres, redis, mongodb, opensearch and kubernetes generators already do (skopeo is already required in root build-deps), and make a missing frozen tag a hard error instead of a fallback.
Chart part itself is fine and I checked it: default render is byte identical to main, v25.3 and v25.8 move both server and keeper images together, schema rejects an unknown value, bats suite passes under hack/cozytest.sh, helm-unittest is 23/23 and it does catch a broken map (mutated _versions.tpl to confirm).
Not blocking:
.helmignorehas no/hack, soupdate-versions.shships inside the chart tarball. postgres, mariadb and redis all exclude it.- default line freezes its patch and not only its major, so default installs never get patch fixes for their own line, every other chart maps major to latest patch. v24.9 is not lts either, its last patch is 2024-11-19 and the map pins it two patches back.
- successful run leaves
files/versions.yamlandvalues.yamlat mode 600, mktemp mode survives the mv. - nothing boots 25.3 or 25.8. helm-unittest checks rendered tags only and the chainsaw fixture has no
version. No other database chart does this either so not asking for it here. - unrelated to this PR:
templates/clickhouse.yaml:99shadows$clusterDomainwith.Values.clusterDomainwhich the chart does not define, so keeper hosts render aschk-...-0.<ns>.svc.with an empty domain. Separate issue.
Address review of the version generator (hack/update-versions.sh): - Fetch tags with `skopeo list-tags` (registry v2 /tags/list) instead of the Docker Hub v2 API, whose anonymous pagination caps at 1000 entries and then returns an error page with no `.results`, silently truncating the list so the frozen 24.9.2.42 fell outside the window and the run failed. skopeo is already in build-deps and is how the sibling generators (postgres, redis, mongodb, opensearch, kubernetes) fetch. - Make a frozen default tag missing from the registry a hard error instead of silently falling back to a newer patch, which would move the default image for existing installs. - Restore 0644 on the regenerated files (mktemp's 0600 survived the mv). - Exclude /hack from the chart tarball via .helmignore. - Refresh files/versions.yaml: v25.8 -> 25.8.32.4, the true latest 25.8 patch now visible with the complete tag list. - bats: add a missing-frozen-tag hard-error case and make the atomicity test reach the resolution phase after a valid default rather than failing at the default-in-set check. Signed-off-by: Alexey Artamonov <[email protected]>
|
Thanks myasnikovdaniil — both blockers are fixed in e707475 and the three threads are resolved. I installed skopeo 1.24.0 and verified end-to-end: the generator now reads the complete tag list, freezes v24.9 to 24.9.2.42, and On the non-blocking notes:
Re-requesting your review. |
myasnikovdaniil
left a comment
There was a problem hiding this comment.
Both blockers fixed, verified on e707475.
Ran the generator live against the registry: v25.8 to 25.8.32.4, v25.3 to 25.3.14.14, v24.9 to 24.9.2.42, exit 0, and regeneration leaves zero diff against the committed tree, so the map is exactly what the generator produces now. That was not checkable before because the generator could not complete at all. Missing frozen tag is a hard error with nothing written (checked with committed map at 24.9.2.42 and a tag list holding only 24.9.3.128). Modes stay 644, hack/ is out of the chart tarball, bats 11/11 under hack/cozytest.sh, helm-unittest 23/23, default render still byte identical to main, v25.3 and v25.8 both move server and keeper together.
On the freeze question, keep it. The danger was never the freeze itself, it was that the freeze could move the default silently, and that is gone now. Sibling charts move the default major to newest on every regeneration with no signal at all, which is worse than what you have here. The real problem is a different one: v24.9 is not lts and its last patch is 2024-11-19, so the default ships an abandoned line. That is a question about which version cozystack ships, and it wants its own PR with an upgrade note rather than a change to the generator.
Two things I am not asking for here:
files/versions.yamlis invisible tohack/lib/image-refs.sh,image_ref_fileswalks onlypackages/*/*/values.yamlandimages/*.tag. Same for all seven charts that carry a version map, so it is one glob elsewhere and not yours.- nothing boots 25.3 or 25.8 anywhere, helm-unittest checks rendered tags only. No database chart in the tree does this, so it is separate work.
Unit and e2e checks are still running on this head. I ran locally what the unit job runs and both suites pass, and this commit does not touch anything e2e exercises.
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-3476-to-release-1.6
git worktree add --checkout .worktree/backport-3476-to-release-1.6 backport-3476-to-release-1.6
cd .worktree/backport-3476-to-release-1.6
git reset --hard HEAD^
git cherry-pick -x 3c78c0be569cd4e5a4d53f74c6d64f96494349b8 e707475f960831d47883c354d8386fa0db835bbb
git push --force-with-lease |
## What this PR does The ClickHouse server and Keeper images were hardcoded to `24.9.2.42` in the chart templates, so the chart exposed no top-level `version` values key. The Cozystack API returns a managed database's engine version by passing the HelmRelease's `spec.values.version` straight through into the Application object, so ClickHouse instances carried no `spec.version` in the API — unlike postgres, mariadb, mongodb, opensearch, rabbitmq and redis, which all ship a `version` parameter. This closes the ClickHouse half of the gap tracked in #1246. This adds the same version-selection scaffolding the other managed-database charts already use: - `files/versions.yaml` maps a `major.minor` key to the full image tag, shared by the ClickHouse server and Keeper images (both are pinned to one version). - `templates/_versions.tpl` (`clickhouse.versionMap`) resolves the tag and fails the render on an unsupported version. - `values.yaml` gains a `version` enum (`v25.8`, `v25.3`, `v24.9`), consumed by `templates/clickhouse.yaml` and `templates/chkeeper.yaml`. - `hack/update-versions.sh` + `make update` refresh the map from Docker Hub, keeping only tags published for *both* the server and Keeper images and preserving the current default so a regeneration never bumps the major of existing deployments. The default stays `v24.9` → `24.9.2.42`, so existing installations render byte-for-byte identically and are never upgraded to a new major implicitly. The generated `values.schema.json`, `README.md`, the Go API type and the `clickhouse-rd` `openAPISchema` are regenerated with `cozyvalues-gen` v1.6.0. A new `tests/version_test.yaml` helm-unittest suite covers the server/Keeper mapping for each version and the schema-level rejection of an unsupported value. ### Downstream repositories The diff changes `packages/apps/clickhouse/values.schema.json` by adding a new `version` field with an `enum`. Per the trigger map, this reaches `terraform-provider-cozystack`, whose ClickHouse resource is hand-written and would need a matching `version` attribute with a `stringvalidator.OneOf` list and its expand/flatten pair. There is no existing PR or issue there for it yet. This is left for a maintainer decision rather than a speculative cross-repo PR, so the box below is intentionally left unticked and flagged here. No other downstream repository is reached (the website reference page is regenerated from `README.md` by the release docs bot; ClickHouse is already in its app list). - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: needs a `version` attribute on the ClickHouse resource (maintainer decision — see note above) - [ ] [cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack) - follow-up: - [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up: - [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up: - [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) - follow-up: - [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) - follow-up: - [ ] [cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server) - follow-up: - [ ] [cozystack/external-apps-example](https://github.com/cozystack/external-apps-example) - follow-up: - [ ] [cozystack/examples](https://github.com/cozystack/examples) - follow-up: ### Release note ```release-note feat(clickhouse): add a configurable `version` parameter (v25.8, v25.3, v24.9; default v24.9) so the deployed ClickHouse version is selectable and returned through the API. Existing installations are unchanged. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a configurable ClickHouse version setting for both server and Keeper images, defaulting to `v24.9`. * Supported versions are `v25.8`, `v25.3`, and `v24.9`, with compatible image patches selected automatically. * **Documentation** * Documented the version setting, default, and supported values. * **Validation** * Unsupported versions are rejected with an error listing allowed options. * **Tests** * Added coverage for version mapping, defaults, invalid values, and update behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
What this PR does
The ClickHouse server and Keeper images were hardcoded to
24.9.2.42in the chart templates, so the chart exposed no top-levelversionvalues key. The Cozystack API returns a managed database's engine version by passing the HelmRelease'sspec.values.versionstraight through into the Application object, so ClickHouse instances carried nospec.versionin the API — unlike postgres, mariadb, mongodb, opensearch, rabbitmq and redis, which all ship aversionparameter. This closes the ClickHouse half of the gap tracked in #1246.This adds the same version-selection scaffolding the other managed-database charts already use:
files/versions.yamlmaps amajor.minorkey to the full image tag, shared by the ClickHouse server and Keeper images (both are pinned to one version).templates/_versions.tpl(clickhouse.versionMap) resolves the tag and fails the render on an unsupported version.values.yamlgains aversionenum (v25.8,v25.3,v24.9), consumed bytemplates/clickhouse.yamlandtemplates/chkeeper.yaml.hack/update-versions.sh+make updaterefresh the map from Docker Hub, keeping only tags published for both the server and Keeper images and preserving the current default so a regeneration never bumps the major of existing deployments.The default stays
v24.9→24.9.2.42, so existing installations render byte-for-byte identically and are never upgraded to a new major implicitly. The generatedvalues.schema.json,README.md, the Go API type and theclickhouse-rdopenAPISchemaare regenerated withcozyvalues-genv1.6.0. A newtests/version_test.yamlhelm-unittest suite covers the server/Keeper mapping for each version and the schema-level rejection of an unsupported value.Downstream repositories
The diff changes
packages/apps/clickhouse/values.schema.jsonby adding a newversionfield with anenum. Per the trigger map, this reachesterraform-provider-cozystack, whose ClickHouse resource is hand-written and would need a matchingversionattribute with astringvalidator.OneOflist and its expand/flatten pair. There is no existing PR or issue there for it yet. This is left for a maintainer decision rather than a speculative cross-repo PR, so the box below is intentionally left unticked and flagged here. No other downstream repository is reached (the website reference page is regenerated fromREADME.mdby the release docs bot; ClickHouse is already in its app list).versionattribute on the ClickHouse resource (maintainer decision — see note above)Release note
Summary by CodeRabbit
v24.9.v25.8,v25.3, andv24.9, with compatible image patches selected automatically.