Skip to content

Validate PostgreSQL ClickPipe inputs - #539

Merged
sdairs merged 2 commits into
stack/454-repair-query-keyfrom
stack/449-validate-postgres-clickpipe
Aug 27, 2026
Merged

Validate PostgreSQL ClickPipe inputs#539
sdairs merged 2 commits into
stack/454-repair-query-keyfrom
stack/449-validate-postgres-clickpipe

Conversation

@sdairs

@sdairs sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • validate PostgreSQL ClickPipe ports, required complete table mappings, IAM role authentication, and replication-slot mode before dispatch
  • build PostgreSQL create payloads through a typed request builder with minimal, maximal, and mode-preservation coverage
  • reject ignored --iam-role values under basic auth and document all conditional input rules

Tests

  • cargo test -p clickhousectl
  • cargo fmt --all --check
  • cargo clippy -p clickhousectl --all-targets -- -D warnings

Closes #449

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a3a446. Configure here.

Comment thread crates/clickhousectl/src/cloud/clickpipes.rs Outdated
@sdairs

sdairs commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator Author

Carry-over review from PR #484 (old PR for #449). This PR strictly subsumes #484's fix and is approved on its own merits (uniform exit 2 before any auth lookup/network, per-mapping parse-time validation, explicit contract decision rejecting --iam-role under basic auth, README + after_help docs). No sdairs review comments existed on #484 to carry over. Two small items:

  1. Trim nit (Cursor Bugbot finding on this PR, valid). parse_postgres_table_mapping_parts (crates/clickhousectl/src/cloud/clickpipes.rs:~1857-1869) validates emptiness via trim() but returns the untrimmed components, so " public.events:events " reaches the create payload padded. Either trim on return or reject padded components outright.

  2. Decide/justify the ArgumentConflict error kind for the slot-vs-mode post-parse rule — it is not a true argument conflict, but it matches the established repo pattern (local postgres start uses it too), so this is likely fine as-is; just confirm intentional.

@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch 2 times, most recently from c65250b to eae65ab Compare August 26, 2026 19:01
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch from eae65ab to 735e17a Compare August 26, 2026 19:03
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch 2 times, most recently from 37ad0d5 to e0dcaf8 Compare August 26, 2026 19:10
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch from e0dcaf8 to 737470e Compare August 26, 2026 19:12
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch from 737470e to de70ce8 Compare August 26, 2026 19:20
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch 2 times, most recently from ec6733a to 96bd2a9 Compare August 26, 2026 19:28
@sdairs
sdairs force-pushed the stack/449-validate-postgres-clickpipe branch from 96b4648 to d291261 Compare August 27, 2026 10:51
@sdairs
sdairs merged commit 4211ece into main Aug 27, 2026
13 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.

Validate PostgreSQL ClickPipe inputs before Cloud API dispatch

2 participants