Skip to content

Teach the OpenAPI analyzer to inventory Rust module trees #380

Description

@sdairs

Parent: #317

Stack position: 1 of 7. This is the enabling change for every subsequent module move.

Problem

The analyzer currently parses client.rs, models.rs, and meta.rs as flat syn::File values and inventories top-level items only. Moving declarations behind private out-of-line modules such as mod services; pub use services::*; would make operations and models invisible to drift and response-policy checks.

Scope

  • Make the analyzer follow inline and out-of-line Rust modules, including private modules containing public declarations.
  • Inventory Client methods, structs, enums, aliases, VALUES constants, manual Default implementations, Serde defaults, and integer fields across the complete module tree.
  • Update the analyzer executable and library APIs to accept the required source tree without duplicating Rust parsing in Python or tests.
  • Update spec_coverage_test.rs, analyzer entrypoint coverage, and drift-script tests for the new input shape.
  • Replace the raw models.rs SCIM substring count with analyzer-backed model inventory.
  • Add a focused fixture using private nested modules and facade re-exports.

Acceptance

  • The fixture proves nested models and impl Client methods are inventoried identically to flat equivalents.
  • All analyzer policy inventories remain effective across modules.
  • Running against the current flat source produces the same drift report and response tree as before.
  • cargo test -p clickhouse-cloud-api -p clickhouse-openapi-analyzer passes.
  • cargo clippy -p clickhouse-cloud-api -p clickhouse-openapi-analyzer --all-targets -- -D warnings passes.
  • Python drift-script tests pass.

Out of scope

  • Moving Cloud API models, methods, or conversions.
  • Changing report semantics, the public API model policy, or drift exemptions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustPull requests that update rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions