Skip to content

feat(clickhouse): model the new version attribute - #54

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
masterfrom
feat/clickhouse-version
Sep 21, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
masterfrom
feat/clickhouse-version

Conversation

@lexfrei

Copy link
Copy Markdown
Collaborator

Pull Request

Summary

Cozystack API v1.6.3 lets a ClickHouse instance pick its server version. This bumps the API module and adds a version attribute to the cozystack_clickhouse resource and data source.

Changes

  • Bump the API module from v1.6.1 to v1.6.3. The only other schema change in that range is bootstrap.newServerName on PostgreSQL, inside a block the provider already leaves unmanaged.
  • New version attribute on ClickHouse with the values v25.8, v25.3 and v24.9. It sets the image for both the server and Keeper, and a value outside the upstream enum fails at plan time.
  • The attribute has no provider-side default, unlike version on the other kinds. On ClickHouse the server default v24.9 is the oldest release in the enum. An update replaces the whole spec, so a default would plan a downgrade for any upgraded instance whose config drops the line. Left unset, a new instance gets the platform default, and removing the attribute later keeps the running version.
  • The unreleased CHANGELOG section is now v1.6.3, so the provider version matches the API version it tracks. v1.6.2 was never tagged.

Testing

  • Unit tests pass locally (make test)
  • Linters pass locally (make lint)
  • Generated docs are up to date (make docs produces no diff)
  • Acceptance tests pass against a live cluster (make testacc), if applicable

Documentation

  • Examples added or updated under examples/ (if a resource/data source changed)
  • Registry docs regenerated (make docs)
  • CHANGELOG updated (if user-facing)

Checklist

  • Commit messages follow semantic format (type(scope): description)
  • No secrets or credentials in code or state
  • Breaking changes documented (if any)

Additional Notes

An explicit downgrade is still accepted. Upstream calls it unsafe, because an older server cannot read data written by a newer one and Keeper snapshots are not backward compatible. It does not reject one either, so here the attribute description is the only warning. OpenSearch has the same deleted-line exposure and is tracked in #49.

After the first apply that changes an instance, the running version is written into the spec, so an instance without version stops following later changes to the platform default.

Acceptance tests were not run against a live cluster. The unit tests replay the framework's plan order for three cases: create without version, a removed version line after an upgrade, and an explicit older value.

No breaking changes.

The Cozystack API at v1.6.3 adds `version` to the ClickHouse
ConfigSpec, an enum of v25.8, v25.3 and v24.9 that selects the image
for both the server and Keeper. Until it is modelled a ClickHouse
major cannot be pinned from Terraform, and the spec-coverage guard
fails against the bumped module.

It departs from the defaulted shape of the other versioned kinds
because here the server default is the oldest release in the enum.
An update replaces the whole spec, so a default would plan a
downgrade for every upgraded instance whose configuration drops the
line. An unset version now keeps the running one, and a server that
predates the field never receives an empty value.

The description warns that only raising the value is safe: an older
server cannot read data written by a newer one and Keeper snapshots
are not backward compatible.

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 2f26668a-c5d5-448f-876a-225d0021477c


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lexfrei
Aleksei Sviridkin (lexfrei) merged commit 55ba580 into master Sep 21, 2026
7 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the feat/clickhouse-version branch September 21, 2026 16:12
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.

2 participants