Skip to content

Resolve OpenAPI drift: slow query patterns, Postgres metrics, RPE update (#224)#273

Open
sdairs wants to merge 2 commits into
mainfrom
issue-224-openapi-drift
Open

Resolve OpenAPI drift: slow query patterns, Postgres metrics, RPE update (#224)#273
sdairs wants to merge 2 commits into
mainfrom
issue-224-openapi-drift

Conversation

@sdairs

@sdairs sdairs commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Resolves #224.

Issue #224 was auto-filed by the daily drift check against an older live spec. Since then the spec drifted further (and two of #224's items — the CustomPrivateDnsMapping type and the customPrivateDnsMappings fields — were already fixed in a prior PR). This PR clears the full current drift so the daily check goes green and #224 closes cleanly. Library-only, per CLAUDE.md; the only CLI changes are construction sites that wouldn't otherwise compile.

clickhouse-cloud-api

5 client methods (client.rs)

  • slow_query_patterns_get_list, slow_query_pattern_get — Postgres slow query patterns (Beta)
  • postgres_instance_metrics_get — Postgres metrics (Beta)
  • service_clickhouse_setting_delete — delete a ClickHouse setting (Beta)
  • click_pipe_reverse_private_endpoint_update — PATCH a reverse private endpoint

9 model types (models.rs)

  • PostgresSlowQueryPattern, PostgresQueryExecution, PostgresSlowQueryPatternDetail
  • PostgresMetrics, PostgresMetric, PostgresMetricSeries, PostgresMetricDataPoint
  • License, UpdateReversePrivateEndpoint

12 added struct fieldsexactlyOnce, skipCertVerification, disableTls across ClickPipe source structs; name on PostgresServicePatchRequest. Optionality resolved per spec (required array + Optional-description heuristic).

2 removed fieldsseekSnapshot dropped upstream from ClickPipePostPubSubSource / ClickPipePubSubSource.

1 optionality fixClickPipeMutateDestination.rolesOption<Vec<String>>.

Metadata/tests — 4 newly-Beta ops added to BETA_OPERATIONS; 3 now-stale OPTIONALITY_EXEMPTIONS removed (spec now agrees with the model); vendored OpenAPI snapshot refreshed.

clickhousectl

Request builders updated for the changed struct fields with behaviour-preserving defaults. Exposing the new endpoints/fields as CLI commands/flags is intentionally a separate follow-up.

Verification

  • cargo build (workspace), cargo build -p clickhouse-cloud-api --features deprecated-fields
  • cargo test — full suite passes, including all 8 live-spec coverage tests (--ignored)
  • cargo clippy --all-targets and --all-features — clean
  • python3 scripts/check-openapi-drift.py --dry-run0 across every category

🤖 Generated with Claude Code

…ate (#224)

Issue #224 was filed against an older live spec; since then the spec
drifted further and two of its items were already fixed. This clears the
full current drift so the daily check goes green.

clickhouse-cloud-api:
- Add 5 client methods: slow_query_patterns_get_list, slow_query_pattern_get,
  postgres_instance_metrics_get, service_clickhouse_setting_delete,
  click_pipe_reverse_private_endpoint_update.
- Add 9 model types: PostgresSlowQueryPattern, PostgresQueryExecution,
  PostgresSlowQueryPatternDetail, PostgresMetrics, PostgresMetric,
  PostgresMetricSeries, PostgresMetricDataPoint, License,
  UpdateReversePrivateEndpoint.
- Add 12 newly-spec'd struct fields (exactlyOnce, skipCertVerification,
  disableTls across ClickPipe source structs; name on
  PostgresServicePatchRequest).
- Remove 2 fields dropped upstream (seekSnapshot on PubSub sources).
- Flip ClickPipeMutateDestination.roles to Option<Vec<String>> to match spec.
- Add the 4 newly-Beta operations to BETA_OPERATIONS.
- Drop 3 now-stale OPTIONALITY_EXEMPTIONS (spec now agrees with the model).
- Refresh the vendored OpenAPI snapshot.

clickhousectl:
- Update request builders for the changed struct fields (behaviour-preserving
  defaults; CLI flag exposure of the new fields is a separate follow-up).

check-openapi-drift.py --dry-run now reports zero across every category.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sdairs sdairs requested a review from iskakaushik as a code owner June 25, 2026 21:45
@sdairs sdairs temporarily deployed to cloud-integration June 25, 2026 21:45 — with GitHub Actions Inactive

@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 default 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 0bdbb2f. Configure here.

Comment thread crates/clickhouse-cloud-api/src/models.rs
The spec dropped `seekSnapshot` and removed `snapshot` from the PubSub
seekType enum (now latest/earliest/timestamp). The field removal landed
in this PR but the Snapshot variant was left on
ClickPipePostPubSubSourceSeektype / ClickPipePubSubSourceSeektype, where
it serialized to "snapshot" — a value the API now rejects.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sdairs sdairs had a problem deploying to cloud-integration June 26, 2026 12:57 — with GitHub Actions Failure
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: 16 gaps between live spec and library

1 participant