Skip to content

Split Cloud API client operations and conversions by domain - #391

Merged
sdairs merged 1 commit into
issue-380-analyzer-module-treefrom
issue-375-split-api-client-convert
Aug 13, 2026
Merged

Split Cloud API client operations and conversions by domain#391
sdairs merged 1 commit into
issue-380-analyzer-module-treefrom
issue-375-split-api-client-convert

Conversation

@sdairs

@sdairs sdairs commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #375

Summary

  • Keep the Cloud API client facade focused on construction, authentication, shared HTTP helpers, and Query API helpers.
  • Move all 144 OpenAPI operations into private product-domain modules without changing method signatures or behavior.
  • Keep the conversion facade and move all 23 write-back conversions into private ClickStack, Postgres, service, and shared modules.
  • Preserve crate-root exports, analyzer inventory, conversion errors, and wire behavior.

Tests

  • cargo fmt --all
  • cargo check --workspace --all-features
  • cargo test -p clickhouse-cloud-api -p clickhouse-openapi-analyzer
  • cargo clippy -p clickhouse-cloud-api -p clickhouse-openapi-analyzer --all-targets -- -D warnings

@sdairs
sdairs requested review from iskakaushik and rndD as code owners August 7, 2026 15:57
@sdairs
sdairs temporarily deployed to cloud-integration August 7, 2026 15:57 — with GitHub Actions Inactive
@sdairs sdairs changed the title Split Cloud API client and conversions by domain Split Cloud API client operations and conversions by domain Aug 7, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 7, 2026

Copy link
Copy Markdown

Macroscope skipped reviewing this pull request. Per-review cost limit exceeded (workspace setting).

This review would cost an estimated $10.83, which exceeds your per-review limit of $10.00.

The top 3 files driving up this estimate:

File Diff Size Estimate
crates/clickhouse-cloud-api/src/convert.rs 38.62KB $1.93
crates/clickhouse-cloud-api/src/client/clickstack.rs 30.68KB $1.53
crates/clickhouse-cloud-api/src/convert/clickstack.rs 29.07KB $1.45

Tip

To get this pull request reviewed, you can:

  1. Comment @macroscope-app on this PR to request a manual review (monthly spend limits still apply).
  2. Exclude the file(s) above from review by adding a pattern to your .macroscope/ignore.md — note that creating this file replaces Macroscope's built-in default ignores rather than extending them.
  3. Raise your cost limit in your workspace billing settings.

Turn off this reminder going forward

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

Refactors the clickhouse-cloud-api crate to split Cloud API operations and write-back conversions into private, product-domain modules while preserving the existing public API surface (Client methods, crate-root exports, and conversion behavior).

Changes:

  • Moved Client OpenAPI operation implementations into domain modules under src/client/ (e.g., organizations, services, Postgres, ClickPipes, ClickStack, UDFs).
  • Split write-back conversion implementations out of convert.rs into domain modules under src/convert/, keeping MissingRequiredFields and the conversion facade intact.
  • Updated convert.rs module docs/structure to reference the new internal module layout without changing external paths.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/clickhouse-cloud-api/src/convert.rs Keeps the conversion facade (MissingRequiredFields) and pulls conversion impls in via internal submodules.
crates/clickhouse-cloud-api/src/convert/shared.rs Hosts shared write-back conversions (e.g., ResourceTagsV1ResponseResourceTagsV1).
crates/clickhouse-cloud-api/src/convert/service.rs Hosts service-related write-back conversions (scaling schedule entries, upgrade window).
crates/clickhouse-cloud-api/src/convert/postgres.rs Hosts Postgres-related write-back conversions (PgConfig, PostgresInstanceConfig).
crates/clickhouse-cloud-api/src/convert/clickstack.rs Hosts ClickStack write-back conversions, including nested object conversions and union round-tripping.
crates/clickhouse-cloud-api/src/client/activity.rs Domain module containing activity-related Client operations.
crates/clickhouse-cloud-api/src/client/api_keys.rs Domain module containing API key Client operations.
crates/clickhouse-cloud-api/src/client/backups.rs Domain module containing backup-related Client operations.
crates/clickhouse-cloud-api/src/client/clickpipes.rs Domain module containing ClickPipes-related Client operations.
crates/clickhouse-cloud-api/src/client/clickstack.rs Domain module containing ClickStack-related Client operations.
crates/clickhouse-cloud-api/src/client/organizations.rs Domain module containing organization-related Client operations.
crates/clickhouse-cloud-api/src/client/postgres.rs Domain module containing Postgres-related Client operations.
crates/clickhouse-cloud-api/src/client/services.rs Domain module containing service-related Client operations (CRUD, scaling, endpoints, settings).
crates/clickhouse-cloud-api/src/client/udfs.rs Domain module containing UDF-related Client operations.

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

@sdairs
sdairs force-pushed the issue-375-split-api-client-convert branch from 0934b34 to 26c5ea7 Compare August 13, 2026 18:29

@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 faf940a into main Aug 13, 2026
4 checks passed
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.

Split Cloud API client operations and conversions by domain

3 participants