Skip to content

Resolve OpenAPI drift: object storage ingestion controls, pg autovacuum config, horizontal autoscaling fields (#287)#288

Merged
sdairs merged 1 commit into
mainfrom
issue-287-openapi-drift
Jul 15, 2026
Merged

Resolve OpenAPI drift: object storage ingestion controls, pg autovacuum config, horizontal autoscaling fields (#287)#288
sdairs merged 1 commit into
mainfrom
issue-287-openapi-drift

Conversation

@sdairs

@sdairs sdairs commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Resolves #287 (library-only, per the drift workflow in CLAUDE.md — CLI flag exposure tracked separately).

What

The daily drift check found 21 spec properties with no matching struct field, so API response data for them was silently dropped. This adds all 21 and refreshes the vendored snapshot:

Struct New fields Modelled as
ClickPipe{,Post,Patch}ObjectStorageSource skipInitialLoad, startAfter Option<bool> / Option<String> (nullable in spec)
ScalingScheduleEntry{,Request} numReplicas, replicaMemoryGb Option<i64> / Option<f64> (optional via required[])
ServicePostRequest minReplicas, maxReplicas, replicaMemoryGb Option<f64> matching the numReplicas sibling
PgConfig 8 autovacuum_* settings Option<serde_json::Value> (string-or-number union like every other pgConfig field)

Optionality exemptions

  • ServicePostRequest.{minReplicas,maxReplicas,replicaMemoryGb}: the description heuristic infers required, but the horizontal-autoscaling trio is mutually exclusive with numReplicas/min/maxReplicaMemoryGb/min/maxTotalMemoryGb, so it must be omittable — same rationale as the existing numReplicas entry.
  • PgConfig.autovacuum_*: covered by the existing partial-update rationale from Cover postgres_instance_config_post + postgres_instance_config_patch #163.

Tests

  • Serde coverage in models_test.rs for all new fields (camelCase wire names, omitted-when-None, string-or-int pgConfig values).
  • The Postgres config integration round-trip now patches/verifies/resets autovacuum_max_workers alongside max_connections.
  • No integration coverage for the scaling fields (numReplicas/replicaMemoryGb/horizontal autoscaling require org-level feature enablement) or skipInitialLoad/startAfter (they change ClickPipe ingestion behaviour); those have serde coverage only.
  • Exhaustive struct literals in commands.rs, support.rs, and integration_test.rs updated with behaviour-preserving defaults.

Verification

  • python3 scripts/check-openapi-drift.py --dry-run"No drift. Library fully covers the live spec."
  • cargo test -p clickhouse-cloud-api / cargo test -p clickhousectl — all green
  • cargo clippy --workspace --all-targets — no warnings
  • cargo check -p clickhouse-cloud-api --features deprecated-fields — both feature configs compile

🤖 Generated with Claude Code

…um, horizontal autoscaling (#287)

Add the 21 struct fields the live spec has grown since the last snapshot
refresh, so API data for them is no longer silently dropped:

- ClickPipe{,Post,Patch}ObjectStorageSource: skipInitialLoad, startAfter
  (nullable -> Option, no exemptions needed)
- ScalingScheduleEntry{,Request}: numReplicas, replicaMemoryGb (optional
  via the schemas' required arrays)
- ServicePostRequest: minReplicas, maxReplicas, replicaMemoryGb — the
  horizontal-autoscaling trio, Option<f64> to match the numReplicas
  sibling, with OPTIONALITY_EXEMPTIONS entries (mutually exclusive with
  the vertical scaling fields, so must be omittable)
- PgConfig: 8 autovacuum_* fields as Option<serde_json::Value> (string-
  or-number union like every other pgConfig setting), with exemption
  entries under the existing #163 partial-update rationale

Refresh the vendored snapshot, update the exhaustive struct literals with
behaviour-preserving defaults (CLI flag exposure is a separate follow-up),
extend serde tests for all new fields, and exercise autovacuum_max_workers
in the Postgres config integration round-trip. The scaling/horizontal
fields are org-feature-gated and skipInitialLoad/startAfter change pipe
ingestion behaviour, so those get serde coverage only.

Closes #287

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@iskakaushik iskakaushik left a comment

Copy link
Copy Markdown
Collaborator

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 9e61644 into main Jul 15, 2026
5 checks passed
@sdairs
sdairs deleted the issue-287-openapi-drift branch July 15, 2026 13:48
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.

OpenAPI drift: 21 gaps between live spec and library

2 participants