Resolve OpenAPI drift: slow query patterns, Postgres metrics, RPE update (#224)#273
Merged
Conversation
…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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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.
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
had a problem deploying
to
cloud-integration
June 26, 2026 12:57 — with
GitHub Actions
Failure
The Read Replica phase of cloud_postgres_crud_lifecycle raced the primary's first backup: replica create was rejected with a "no backups, yet" 400, or the replica never reached running within the steady-state timeout. The test only needs to prove the API surface works, not that provisioning completes. - Wrap replica create in retry_api_call, retrying the specific "no backups" / "not ready for read replicas" 400 until the primary's first backup lands. - Drop the wait-for-replica-running poll and the hard asserts on hostname/connection_string that rode on it. - Assert create response shape (isPrimary=false, name, non-empty state) instead, and keep the list/get visibility checks which work in any state. - Add retry_api_call helper to test infra for transient-error retries.
This was referenced Jul 7, 2026
sdairs
added a commit
that referenced
this pull request
Jul 15, 2026
Neither check-openapi-drift.py nor spec_coverage_test.rs compared the values of spec enum arrays against Rust enum variants, so a value added to or removed from a spec enum was invisible to both (the #273 PubSub seekType/"snapshot" incident). Add enum value coverage to both, kept in lockstep like the field checks: - spec -> code (enum_values_cover_every_spec_enum): every spec enum value has a matching Rust variant; also flags spec enum locations whose Rust type is not a value enum. - code -> spec (enum_values_have_no_extras_vs_spec): every Rust variant serializes a value the spec enum lists. The spec-to-Rust mapping is structural, not comment-based: inline property enums resolve through the struct field's declared type (the actual serialization path) and named enum schemas via pascalize_identifier. Wire values come from #[serde(rename)] (falling back to the variant identifier); the untagged catch-all is excluded by attribute, never by name; oneOf union enums are excluded by shape. EXTRA_ENUM_VALUE_EXEMPTIONS (empty, stale-checked) mirrors EXTRA_FIELD_EXEMPTIONS and is parsed by the drift script. Reconcile the drift the new checks surfaced in models.rs: - add europe-west2 to 8 region enums, GCP_PSC_SERVICE_ATTACHMENT to both reverse-private-endpoint type enums, 6 new threshold types to the 3 ClickStack alert enums, and duration to ClickStackNumberFormatOutput (with Display arms) - regenerate PgSize from the spec: 66 stale instance sizes removed, default moved from removed c6gd.medium to c6gd.large (breaking) Closes #275 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
CustomPrivateDnsMappingtype and thecustomPrivateDnsMappingsfields — 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 endpoint9 model types (
models.rs)PostgresSlowQueryPattern,PostgresQueryExecution,PostgresSlowQueryPatternDetailPostgresMetrics,PostgresMetric,PostgresMetricSeries,PostgresMetricDataPointLicense,UpdateReversePrivateEndpoint12 added struct fields —
exactlyOnce,skipCertVerification,disableTlsacross ClickPipe source structs;nameonPostgresServicePatchRequest. Optionality resolved per spec (requiredarray +Optional-description heuristic).2 removed fields —
seekSnapshotdropped upstream fromClickPipePostPubSubSource/ClickPipePubSubSource.1 optionality fix —
ClickPipeMutateDestination.roles→Option<Vec<String>>.Metadata/tests — 4 newly-Beta ops added to
BETA_OPERATIONS; 3 now-staleOPTIONALITY_EXEMPTIONSremoved (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-fieldscargo test— full suite passes, including all 8 live-spec coverage tests (--ignored)cargo clippy --all-targetsand--all-features— cleanpython3 scripts/check-openapi-drift.py --dry-run— 0 across every category🤖 Generated with Claude Code