Name cloud integration resources after their PR (or 'nightly')#146
Merged
Conversation
Workflow now exports CLICKHOUSE_CLOUD_TEST_RUN_LABEL per event (pr-NNN / nightly / manual-RUNID). TestContext::from_env folds the label into run_id so existing service names and tags pick it up, making leaked resources attributable to their source PR or run. Closes #138 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`cloud service query` now covers the cloud query path over HTTP without needing a local clickhouse binary or service password, so the `cloud service client` subcommand and its binary-download helper are no longer needed. Closes #147. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
rpassword 7.5.0 referenced `libc::__errno_location` (Linux-only), which broke `cargo build` on macOS. 7.5.2 restores macOS support. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
README still framed `cloud service query` as the successor to `cloud service client` on a deprecation path, and the cloud service CONTEXT FOR AGENTS pointed at `client`. Rewrite both to stand on their own. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Refreshes the OpenAPI snapshot and brings the typed client in sync with the new horizontal-autoscaling / scaling-schedule feature on ClickHouse Cloud. Also fixes a resolver bug exposed by a spec convention transition: the OpenAPI team is starting to add `required[]` arrays to schemas but only listing newly-introduced fields, which the previous required[]-exclusive interpretation mis-classified as flipping every other field to optional. - Adds 7 new model types: `CurrentScaling`, `ScalingSchedule`, `ScalingScheduleBaseConfig`, `ScalingScheduleEntry`, `ScalingScheduleEntryRequest`, `ScalingSchedulePatchRequest`, `ScalingSchedulePostRequest`. - Adds 5 new fields to `Service` and `ServiceScalingPatchResponse` (`currentScaling`, `scalingSchedule`, `minReplicas`, `maxReplicas`, `replicaMemoryGb`) and 3 to `ServiceReplicaScalingPatchRequest`. - Adds 3 new client methods: `scaling_schedule_get`, `scaling_schedule_upsert`, `scaling_schedule_replace`. - Introduces `PARTIAL_REQUIRED_SCHEMAS` (mirrored in Rust and Python resolvers) so schemas whose `required[]` only lists new fields fall back to the description heuristic for older fields. Currently `Service` and `ServiceScalingPatchResponse`. - Python drift checker now parses `NON_OPENAPI_CLIENT_METHODS` and `OPTIONALITY_EXEMPTIONS` from `spec_coverage_test.rs` to stay in sync with the Rust test's intentional divergences. Closes #149. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
Adds `BETA_OPERATIONS` (and `is_beta_operation`) to `clickhouse_cloud_api`, sourced from `x-badges` Beta markers in the OpenAPI spec. Consumers — the CLI in this repo, and any external user of the library — can now derive a "(Beta)" affordance from spec metadata rather than maintaining a parallel list by hand. - New `meta.rs` module with a sorted constant of 36 snake-case operation names plus a `binary_search`-backed helper. - `spec_coverage_test.rs` gains `beta_operations_match_spec` (snapshot) and `_live` variants. Drift produces a clear failure pointing at the regenerator script. - `scripts/regenerate-beta-lists.py` reads the snapshot and prints the array body — run after each `clickhouse_cloud_openapi.json` refresh. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`check-openapi-drift.py` now parses `BETA_OPERATIONS` out of `meta.rs` and diffs it against `x-badges` Beta markers in the live spec. The "Beta Status Changes" issue section calls out newly-Beta operations (that need adding to the constant) and graduations (that need removing), and the count rolls into the summary table. This catches stability transitions that the snapshot-driven Rust test cannot — e.g. an existing operation flipping from GA to Beta or vice versa on the published spec before we refresh the snapshot. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Postgres subcommand's help text already advertised "(beta)" via a hand-written doc comment. Capitalise it to `(Beta)` (matching how the OpenAPI spec's `x-badges` renders it) and add a test that asserts the label is present iff `clickhouse_cloud_api::is_beta_operation` reports the underlying operation as Beta. If Postgres ever graduates, the daily drift check flags it, we delete the suffix, and the test keeps passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts commit e11d3bd. The label-and-test approach was overbuilt for what it solved: the CLI never actually consults `is_beta_operation` at runtime — clap renders help text from compile-time metadata, and nothing in the CLI declares which client method each subcommand wraps. The test held a literal string accountable to spec metadata without the CLI ever consuming that metadata, which is rigour without leverage on a surface that has one beta-backed command today. The library-side `BETA_OPERATIONS` constant and the daily drift checker remain. Those are the genuine consumers: external Rust callers of `clickhouse-cloud-api` get a programmatic stability signal, and the drift check flags upstream Beta/GA transitions. The Postgres help text goes back to a hand-written `(beta)` doc comment — the same it was before this stack. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
iskakaushik
approved these changes
May 14, 2026
…ng-schedule Resolve OpenAPI drift and add scaling-schedule API coverage
Remove deprecated `cloud service client` command
iskakaushik
approved these changes
May 14, 2026
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.
Summary
CLICKHOUSE_CLOUD_TEST_RUN_LABELper event:pr-NNNonpull_request,nightlyonschedule,manual-<run_id>onworkflow_dispatch.TestContext::from_envreads the new var and folds it intorun_id, so existing service names (clickhousectl-it-<run_id>,clickhousectl-it-pg-<run_id>) and therun_idtag value automatically become PR/nightly-prefixed.Closes #138.
Test plan
cargo build -p clickhouse-cloud-api --testscargo test -p clickhouse-cloud-api(all 86 unit tests + 5 spec coverage tests pass)clickhousectl-it-pr-<NNN>-<sha7>resources and arun_id=pr-<NNN>-<sha7>tag (verify in Cloud console once the workflow finishes)nightly-<sha7>🤖 Generated with Claude Code