feat(clickstack): expose dashboard management and validation - #718
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ 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)?; |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit b43b162. Configure here.
There was a problem hiding this comment.
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.


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
Unknownvariants 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 --allcargo clippy -p clickhousectl -- -D warningscargo test -p clickhousectlcargo check -p clickhousectl --no-default-featurescargo clippy -p clickhousectl --all-targets --no-default-features -- -D warningsFocused 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.