Skip to content

Remove storageSize from Postgres create/update requests#236

Merged
sdairs merged 1 commit into
mainfrom
remove-pg-storage-gb
Jun 4, 2026
Merged

Remove storageSize from Postgres create/update requests#236
sdairs merged 1 commit into
mainfrom
remove-pg-storage-gb

Conversation

@sdairs
Copy link
Copy Markdown
Collaborator

@sdairs sdairs commented Jun 3, 2026

What

The ClickHouse Cloud OpenAPI spec no longer includes storageSize on the Postgres request bodies. It remains only on the PostgresService response.

clickhouse-cloud-api/models.rs still carried the field on the request structs — stale relative to the vendored snapshot (clickhouse_cloud_openapi.json), which is already correct. The CLI also exposed a required --storage-gb flag on postgres create, forcing users to pass a value the API no longer accepts.

Changes

  • API lib (models.rs): remove storage_size from PostgresServicePostRequest, PostgresServicePatchRequest, BasePostgresService, and PostgresServiceListItem. Kept on PostgresService (still returned by the API and rendered in postgres get).
  • CLI: drop the --storage-gb flag from postgres create (was required) and postgres update (was optional), plus the option structs, request builders, and main.rs dispatch.
  • Tests: updated clap parse tests, the create write-command test, the wiremock client test, models serialization test, and the Postgres + ClickPipes CDC integration tests.
  • README: updated postgres create/update examples and the options table; create example now uses --size c6gd.xlarge --pg-version 18.

Verified the live spec confirms storageSize is gone from the request schemas (present only on PostgresService). The vendored snapshot already reflected this, so no snapshot refresh was needed.

cargo build, cargo clippy --all-targets, and the unit/snapshot/wiremock tests pass.

Closes #235

🤖 Generated with Claude Code


Note

Medium Risk
Changes required CLI flags and create/update API payloads for managed Postgres; users and automation must stop passing --storage-gb, but read paths and response fields are unchanged.

Overview
Aligns Postgres create/update with the Cloud API by dropping storageSize from request payloads and the CLI’s --storage-gb flag (previously required on create, optional on update).

clickhouse-cloud-api: removes storage_size from PostgresServicePostRequest, PostgresServicePatchRequest, BasePostgresService, and PostgresServiceListItem; it stays on PostgresService responses so postgres get can still show storage.

clickhousectl: wires create/update without storage; README examples and the options table drop storage and refresh sample size/version.

Tests (clap, wiremock, serialization, integration/CDC) no longer send or assert storageSize on writes.

Reviewed by Cursor Bugbot for commit 584d6d4. Bugbot is set up for automated code reviews on this repo. Configure here.

The Cloud OpenAPI spec dropped storageSize from the Postgres request
bodies (PostgresServicePostRequest, PostgresServicePatchRequest,
BasePostgresService, PostgresServiceListItem); it remains only on the
PostgresService response. models.rs was stale relative to the already-
refreshed vendored snapshot.

- Drop storage_size from the four stale request/list model structs,
  keep it on PostgresService (still returned and displayed in `get`).
- Remove the required --storage-gb flag from `postgres create` and the
  optional one from `postgres update`, plus option structs, request
  builders, and dispatch.
- Update unit/wiremock/integration tests and README examples.

Closes #235

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@iskakaushik iskakaushik left a comment

Choose a reason for hiding this comment

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

LGTM!

@sdairs sdairs merged commit 293fb4b into main Jun 4, 2026
13 checks passed
@sdairs sdairs deleted the remove-pg-storage-gb branch June 4, 2026 17:43
sdairs added a commit that referenced this pull request Jun 5, 2026
Bring models.rs in line with the vendored OpenAPI snapshot, clearing the
5 findings surfaced by the new struct_fields_have_no_extras_vs_spec
detector (#237). EXTRA_FIELD_EXEMPTIONS stays empty — these are fixed,
not exempted.

- PostgresServicePatchRequest: drop name/provider/region/postgresVersion;
  the live spec only allows size/haType/tags. The `postgres update` CLI
  surface loses the matching --name/--region/--provider/--pg-version
  flags (same class of stale field as the storageSize cleanup in
  #235/#236).
- ScimEnterpriseManager: drop the code-only $ref attribute absent from
  the ClickHouse spec.

Updates the affected library and CLI tests plus the README update
example. struct_fields_have_no_extras_vs_spec now passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

Remove storageSize from Postgres create/update requests

2 participants