Skip to content

fix(api): refresh OpenAPI snapshot; add MongoDB ClickPipe table mongoConfig (#1144) - #1149

Open
sdairs wants to merge 1 commit into
mainfrom
claude/drift-1144-api-clickpipes
Open

sdairs wants to merge 1 commit into
mainfrom
claude/drift-1144-api-clickpipes

Conversation

@sdairs

@sdairs sdairs commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Part 1 of 4 in the #1144 drift stack. It refreshes the vendored OpenAPI snapshot and adds the MongoDB ClickPipe per-collection mongoConfig. See #1144.

  • Snapshot: replaced with the live spec. The diff is exactly the drift: the new ClickPipeMongoDBTableConfig schema, mongoConfig on ClickPipeMongoDBPipeTableMapping, and two ClickStack log-source expressions (part 3 adds those).
  • New ClickPipeMongoDBTableConfig (request) and ClickPipeMongoDBTableConfigResponse (all-Option), carried as optional mongo_config on ClickPipeMongoDBPipeTableMapping and its response variant.
  • persistDeletedDocuments is bool in the request type. The schema has no required[] and its description doesn't start with "Optional", so the analyzer resolves it as required. I left out an optionality exemption because I haven't verified that the API accepts {}. The spec's default: false applies when mongoConfig itself is omitted, which the mapping still allows.
  • No CLI change: mappings are built with ..Default::default(), and the MongoDB --table-mapping-json allowlist doesn't include mongoConfig yet (part 2). The existing exact-body MongoDB request-shape tests pass unchanged. The two ClickPipes integration struct literals set mongo_config: None.
  • Tests: request round trip, strictness, omission when unset, and a missing or null value decoding as None on the response. Library README updated.

spec_coverage_test and the analyzer entrypoint_test still fail on this PR alone. They list only the four ClickStack findings that part 3 fixes. The other library tests, both clickhousectl clippy configurations, cargo check --workspace --all-features and cargo test -p clickhousectl pass.

The MongoDB E2E suite is manual (it needs a third-party service and changeStreamPreAndPostImages), so there's no live step for this field.

🤖 Generated with Claude Code


Note

Low Risk
Typed client and OpenAPI sync only; the new mapping field is optional and covered by unit tests, with no runtime or security behavior changes in this repo.

Overview
Refreshes the vendored ClickHouse Cloud OpenAPI snapshot and wires up MongoDB ClickPipe per-collection settings in the Rust client.

ClickPipeMongoDBPipeTableMapping now accepts optional mongo_config (ClickPipeMongoDBTableConfig), with a response-side ClickPipeMongoDBTableConfigResponse. The config exposes persist_deleted_documents: when set, deletes replicate the full pre-delete document (not just _id), which requires changeStreamPreAndPostImages on the MongoDB collection. Omitting mongo_config keeps the API default; unset configs are omitted on the wire.

Callers building table mappings with struct literals must add mongo_config: None or use ..Default::default(). Integration tests and serde round-trip tests cover strict request encoding, omission when unset, and tolerant response parsing. The crate README documents the new surface. The snapshot diff also includes ClickStack log-source expression fields; Rust models for those are handled in a follow-up PR in the same stack.

Reviewed by Cursor Bugbot for commit c410e16. Bugbot is set up for automated code reviews on this repo. Configure here.

…Config (#1144)

Refresh the vendored spec and add `ClickPipeMongoDBTableConfig` (request) and
`ClickPipeMongoDBTableConfigResponse` (all-`Option`), carried as optional
`mongo_config` on `ClickPipeMongoDBPipeTableMapping` and its response variant.
`persistDeletedDocuments` resolves as required in request position (no
`required[]`, no "Optional" description), so the request field is `bool`.

The CLI builds its mappings with `..Default::default()` and the MongoDB
`--table-mapping-json` allowlist does not yet include `mongoConfig`, so the
request shape is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch was successfully deployed

1 active deployment
cloud-integration — c410e161 Deployed Oct 30, 2026 by sdairs via Cloud integration tests #1445
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-cloud-integration Run live Cloud integration tests for this PR head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant