Skip to content

Remediate current ClickHouse Cloud OpenAPI drift - #415

Open
sdairs wants to merge 1 commit into
issue-406-affected-cloud-integrationfrom
issue-372-openapi-drift
Open

Remediate current ClickHouse Cloud OpenAPI drift#415
sdairs wants to merge 1 commit into
issue-406-affected-cloud-integrationfrom
issue-372-openapi-drift

Conversation

@sdairs

@sdairs sdairs commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #372

Summary

  • refresh the vendored snapshot to the current live ClickHouse Cloud OpenAPI document
  • add active balance, Prometheus discovery, and Postgres log endpoints and models
  • cover current Activity, ClickPipes, UDF, and organization quota drift
  • update AGENTS.md for the modularized API/CLI structure and affected-suite CI planner
  • exercise PR 413 across the current cross-domain diff; all four integration suites are expected

Verification

  • cargo test -p clickhouse-cloud-api -p clickhouse-openapi-analyzer
  • cargo test -p clickhousectl
  • cargo clippy -p clickhouse-cloud-api -p clickhouse-openapi-analyzer --all-targets -- -D warnings
  • cargo clippy -p clickhousectl --all-targets -- -D warnings
  • cargo fmt --all --check
  • python3 -m unittest discover -s scripts/tests -p "test_*.py"
  • python3 scripts/check-openapi-drift.py --dry-run
  • affected-suite classifier: service,postgres,organization,clickpipes; failed_closed=false

@sdairs sdairs added the run-cloud-integration Run live Cloud integration tests for this PR head label Aug 13, 2026
@sdairs
sdairs temporarily deployed to cloud-integration August 13, 2026 20:37 — with GitHub Actions Inactive
clickhouse_max_insert_threads: clickhouse_max_insert_threads.map(i64::from),
object_storage_use_cluster_function,
clickhouse_parallel_view_processing,
kafka_read_committed: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 High cloud/clickpipes.rs:1654

Updating any unrelated ClickPipe setting unconditionally disables kafka_read_committed on pipes where it was enabled. Because this command has no argument for that setting but always serializes kafka_read_committed: false, preserve the existing value (for example by fetching it) or expose it as an intentional input instead of hard-coding false.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @crates/clickhousectl/src/cloud/clickpipes.rs around line 1654:

Updating any unrelated ClickPipe setting unconditionally disables `kafka_read_committed` on pipes where it was enabled. Because this command has no argument for that setting but always serializes `kafka_read_committed: false`, preserve the existing value (for example by fetching it) or expose it as an intentional input instead of hard-coding `false`.

@sdairs sdairs linked an issue Aug 13, 2026 that may be closed by this pull request
@sdairs
sdairs requested a lite review from Copilot August 13, 2026 21:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the vendored ClickHouse Cloud OpenAPI snapshot and brings the Rust API library (and one CLI integration point) back in sync with the current live spec, including new billing, Prometheus discovery, and Postgres log surfaces.

Changes:

  • Refreshed the vendored OpenAPI snapshot and updated beta-operation metadata.
  • Added new client methods + models for active balances, Prometheus discovery, Postgres logs, plus drift fixes for Activity/UDF/quotas/ClickPipes.
  • Updated tests to cover new models/endpoints and updated AGENTS.md guidance for the modularized workspace.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/clickhousectl/src/cloud/clickpipes.rs Adapts ClickPipes schema discovery/settings update to new API models (includes a settings update behavior change).
crates/clickhouse-cloud-api/tests/models_test.rs Extends model serialization/deserialization coverage for new/changed schemas and request shapes.
crates/clickhouse-cloud-api/tests/model_facade_test.rs Ensures newly extracted models remain available through both root and models::* paths.
crates/clickhouse-cloud-api/tests/client_test.rs Adds wiremock-backed client tests for new endpoints and updated request/response handling.
crates/clickhouse-cloud-api/src/models/udfs.rs Adds the memoryLimitMib field to the UDF model.
crates/clickhouse-cloud-api/src/models/quotas.rs Adds missing quota code enum variant for API keys per organization.
crates/clickhouse-cloud-api/src/models/postgres.rs Introduces Postgres logs models and a typed sort-order enum.
crates/clickhouse-cloud-api/src/models/organizations.rs Adds ActiveBalance/ActiveBalances and Prometheus discovery response models.
crates/clickhouse-cloud-api/src/models/clickpipes.rs Adds new schema-discovery sources and the Kafka kafka_read_committed setting with request/response strictness.
crates/clickhouse-cloud-api/src/models/activity.rs Updates ActivityType and Activity fields to match current spec drift.
crates/clickhouse-cloud-api/src/models.rs Re-exports newly added models through the facade.
crates/clickhouse-cloud-api/src/meta.rs Updates BETA_OPERATIONS to include new beta endpoints.
crates/clickhouse-cloud-api/src/client/postgres.rs Adds postgres_logs_get_list client method.
crates/clickhouse-cloud-api/src/client/organizations.rs Adds active_balances_get and organization_prometheus_discovery_get client methods.
crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json Refreshes the vendored OpenAPI document snapshot to current live spec.
AGENTS.md Updates contributor guidance to reflect the modularized API/CLI/analyzer workspace and CI suite planning.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 1651 to 1655
clickhouse_max_insert_threads: clickhouse_max_insert_threads.map(i64::from),
object_storage_use_cluster_function,
clickhouse_parallel_view_processing,
kafka_read_committed: false,
clickhouse_max_download_threads: None,

@rndD rndD 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.

cool files separation

@sdairs
sdairs force-pushed the issue-372-openapi-drift branch from 156f13c to e27cea6 Compare August 14, 2026 12:27

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e27cea6. Configure here.

clickhouse_max_insert_threads: clickhouse_max_insert_threads.map(i64::from),
object_storage_use_cluster_function,
clickhouse_parallel_view_processing,
kafka_read_committed: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Settings update forces Kafka flag

High Severity

clickpipe_settings_update always puts kafka_read_committed: false on ClickPipeSettingsPutRequest, and that field is a non-optional bool that is always serialized. Any settings update therefore overwrites an existing true value even when the user only changes other flags. The OpenAPI settings PUT is described as sending key-value pairs for the fields being updated.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e27cea6. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-cloud-integration Run live Cloud integration tests for this PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI drift: 12 gaps between live spec and library

3 participants