Skip to content

feat(cli): pgConfig GUCs, MongoDB structured ingestion mappings, saved-query GA (#1093) - #1094

Merged
sdairs merged 1 commit into
claude/drift-api-b-1088from
claude/drift-cli-1088
Oct 21, 2026
Merged

sdairs merged 1 commit into
claude/drift-api-b-1088from
claude/drift-cli-1088

Conversation

@sdairs

@sdairs sdairs commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1093. CLI exposure for the #1088 drift; stacked on #1092.

  • cloud postgres: config writes accept autovacuum_analyze_threshold, autovacuum_freeze_max_age, autovacuum_vacuum_insert_threshold, autovacuum_vacuum_threshold, checkpoint_timeout, shared_memory_percent and wal_buffers.
  • cloud clickpipe create mongodb --table-mapping-json accepts structuredIngestion. Nested unknown fields are already rejected by the strict parser. Column, excluded-column, sorting-key and partition entries are trimmed and must be nonempty, and excludedColumns/sortingKeys must be unique (the spec's uniqueItems).
  • cloud saved-query: the (Beta) label is gone, since the operations graduated.
  • Docs: docs/reference/clickpipe-configuration.md (structured ingestion example) and docs/reference/query-api.md.

Not exposed: SERVICE_ACCOUNT_WORKLOAD_IDENTITY for Postgres/MySQL ClickPipes. The credential shape isn't specified and can't be verified here; reasoning in #1093.

Tests: pgConfig unit test; Mongo structured-ingestion parsing (minimal, maximal and invalid cases); a wiremock request-shape test for the create body. Both clippy configurations are clean. cargo test -p clickhousectl passes except the Docker-dependent local_postgres_readiness_test (Docker was not running locally).

🤖 Generated with Claude Code

…d-query GA (#1093)

- Accept the seven new pgConfig GUCs in Postgres config writes.
- `clickpipe create mongodb --table-mapping-json` accepts
  `structuredIngestion`; name entries are trimmed and must be
  nonempty, and `excludedColumns`/`sortingKeys` must be unique.
- Drop the `(Beta)` label from `cloud saved-query`.
- Reference docs for ClickPipe mappings and saved queries.

Workload identity auth for database ClickPipes is deliberately not
exposed yet; see #1093.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdairs
sdairs requested a review from iskakaushik as a code owner October 15, 2026 12:27
@sdairs
sdairs added this pull request to stack #1095 October 15, 2026 12:39
@sdairs
sdairs merged commit 8856e36 into main Oct 21, 2026
11 checks passed
sdairs added a commit that referenced this pull request Oct 21, 2026
Query API endpoint lists return an array in `result`, with cursor
metadata on the response envelope. The client decoded a nested
`items`/`pagination` object instead, causing the scheduled Cloud
Integration lifecycle and CLI list/name lookups to fail with `invalid
type: map, expected a sequence`. A nonempty array is interpreted as
positional struct fields; `{"result":[{}]}` reproduces the exact CI
error at line 1, column 11.

Return `ApiResponse<Vec<PublicQueryApiEndpointListItem>>` from the
library and consume its envelope pagination in the lifecycle test. The
CLI adapts the response to its existing `items`/`pagination` output.
Existing command flags, requests, authentication and name-selection
safety checks are preserved. The legacy nested container remains
exported for callers that use it independently; the library README
documents the return-type migration.

The corrected client/model and subprocess fixtures cover nonempty and
empty arrays, sparse/null responses, envelope metadata, opaque cursors,
OAuth, multiple pages and unsafe name-selection failures.

Stacked directly above #1094 (`claude/drift-cli-1088`). Related release
acceptance: #757; this PR does not close that tracker.

This is separate from #1088: neither its current gap list nor the normal
dry-run at #1094 identifies the endpoint-list mismatch. The dry-run
still reports the same 27 remaining findings after this change; no
snapshot or analyzer policy is changed.

Validation:

- The corrected client regression failed with the old decoder and passes
with this fix.
- Passed formatting, both CLI Clippy configurations, telemetry-disabled
compilation, API/analyzer all-target Clippy and tests, and 96
Python/classifier tests.
- Full CLI tests: all targets passed except
`failed_fresh_start_preserves_postgres_identity_without_polluting_clickhouse_selection`,
which reports `docker_unavailable` because the local Docker socket is
absent. Endpoint subprocess and pagination/name-selection tests passed.
- Read-only live smoke: the installed client reproduced the original
decoding failure; the patched binary read two cursor pages and resolved
an endpoint by name. No SQL ran and no Cloud resources changed.
- The full provisioning lifecycle was not rerun.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Breaking return type for Rust callers of `query_api_endpoint_list`,
but behavior matches the live API and fixes list/name-resolution
failures; CLI output shape is preserved via an adapter layer.
> 
> **Overview**
> Fixes Query API endpoint **list** decoding so the Cloud API client
matches the real wire shape: `result` is an endpoint array and
pagination lives on the envelope (`next_cursor`, `limit`,
`total_count`), not a nested `items`/`pagination` object. That mismatch
caused JSON decode failures (e.g. `expected a sequence`) for nonempty
lists in integration and CLI name lookups.
> 
> **`query_api_endpoint_list`** now returns
`ApiResponse<Vec<PublicQueryApiEndpointListItem>>`;
`QueryApiEndpointListResponse` stays exported as a legacy helper type.
**clickhousectl** rebuilds `items`/`pagination` from the envelope so
human/JSON list output and `--cursor` behavior stay the same;
missing/null `result` now fails the command instead of printing an empty
list.
> 
> Docs note envelope vs CLI pagination fields; client, model,
integration, and CLI subprocess tests use the corrected list envelopes
and multi-page cursors.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b84d7b9. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

CLI: expose #1088 drift additions (pgConfig GUCs, MongoDB structured ingestion, saved-query GA)

2 participants