Skip to content

feat(clickstack): expose dashboard management and validation - #718

Merged
sdairs merged 1 commit into
stack/570-cdc-destination-dbfrom
stack/693-clickstack-dashboards
Sep 7, 2026
Merged

feat(clickstack): expose dashboard management and validation#718
sdairs merged 1 commit into
stack/570-cdc-destination-dbfrom
stack/693-clickstack-dashboards

Conversation

@sdairs

@sdairs sdairs commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

ClickStack dashboards had typed Cloud API methods but no CLI surface. This adds cloud clickstack dashboard list|get|create|update|delete|validate, with JSON file/stdin input for create, update, and validation and sparse-safe human/JSON output.

Dashboard input is deserialized into the published request models and validated strictly across every nested chart, raw-SQL/builder, on-click, color-rule, and saved-filter union. Unknown fields and discriminators fail locally, and closed enum values are rejected through their typed library Unknown variants before organization lookup or an API request. Equality color rules accept only the specified finite-number-or-string value shape. Update is documented as a full PUT replacement. Validation is intentionally classified as API-key-only under the CLI's write-command policy because the Cloud API exposes it as POST, even though validation does not persist data.

The README includes a validate-then-create flow, a nested line-chart/filter-variable example, and the full-replacement update contract.

Closes #693

Validation

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

Focused real-binary wiremock coverage exercises all six service/organization paths, Basic auth, file and stdin request bodies, nullable-field omission, valid/invalid/sparse validation responses, sparse dashboard lists, API errors, and OAuth fail-fast behavior.

@sdairs
sdairs requested a review from iskakaushik as a code owner September 5, 2026 11:41
@sdairs sdairs added this to the v0.5.0 milestone Sep 5, 2026
@sdairs
sdairs requested a review from rndD as a code owner September 5, 2026 11:41

@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 b43b162. Configure here.

config_file,
org_id,
} => {
let request = build_create_dashboard_request(&config_file)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Validate rejects update dashboard bodies

Medium Severity

dashboard validate always deserializes through build_create_dashboard_request into ClickStackCreateDashboardRequest, whose filters use ClickStackFilterInput and have no id. An update body that includes the required filters[].id therefore fails local unknown-field checks, even though dashboard update accepts that same payload. The README tells users to validate the same file before update, and dashboard get returns filter IDs, so the natural get-edit-validate-update flow breaks for any dashboard with filters.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit b43b162. Configure here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Corrected the guidance in stacked follow-up #741. The live OpenAPI validation operation and typed method accept the create schema only; update bodies correctly use the separate schema with required filter IDs. README and command help now describe that distinction and provide an update filter example while retaining the full-replacement warning.

@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 e4a5c8b into main Sep 7, 2026
10 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.

ClickStack: expose dashboard CRUD and validation with full configuration support Support ClickStack in cloud commands

2 participants