Document the dashboard definition schema in the cloud CLI docs - #2466
Conversation
Local agents read commands/cloud.md via the docs MCP and had command syntax but no definition schema, so they reverse-engineered the state and guessed a top-level 'tabs:' block (tabs are actually a per-row 'tab:' field). Add a definition schema section — top-level keys, row/widget shape, tabs semantics, and a worked example — and note the connection must be one the bound agent has. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| | `name` | yes | dashboard name | | ||
| | `connection` | for SQL widgets | a connection **the bound agent has** (see `bruin cloud connections list`). The canvas runs every widget's SQL against this connection; a name the agent doesn't have makes the queries fail | | ||
| | `description` | no | free text | | ||
| | `filters` | no | list of filter controls (see below) | |
There was a problem hiding this comment.
Unresolved filters cross-reference
The filters entry says “see below,” but the section proceeds through rows, widgets, and the example without defining the filter-control shape, leaving readers and agents to infer that part of the dashboard schema.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/commands/cloud.md
Line: 655
Comment:
**Unresolved filters cross-reference**
The `filters` entry says “see below,” but the section proceeds through rows, widgets, and the example without defining the filter-control shape, leaving readers and agents to infer that part of the dashboard schema.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix All With AI### Issue 1
docs/commands/cloud.md:655
**Unresolved filters cross-reference**
The `filters` entry says “see below,” but the section proceeds through rows, widgets, and the example without defining the filter-control shape, leaving readers and agents to infer that part of the dashboard schema.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Document the dashboard definition schema..." | Re-trigger Greptile |
The 'filters' row said 'see below' but no filter shape was documented.
Add a Filters section: fields (name/type/default/multiple/options), the
{{ filters.X }} SQL placeholder, and an example.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviews (2): Last reviewed commit: "Define the filter-control shape in the d..." | Re-trigger Greptile |
Reconciled with dac/pkg/dashboard (the authoritative model + validator): add the date-range type, its preset default, and the options connection and presets fields that the earlier subset omitted. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviews (3): Last reviewed commit: "Correct the filter schema against the da..." | Re-trigger Greptile |
| |-------|-------------| | ||
| | `name` | referenced in SQL as `{{ filters.<name> }}` | | ||
| | `type` | `date`, `date-range`, `number`, `select`, or `text` | | ||
| | `default` | initial value. `date`: `TODAY`, `TODAY+/-N`, or `YYYY-MM-DD`; `date-range`: a preset string like `last_30_days` (resolves to a start/end pair); `select` with `multiple: true`: a list (`[]` = no filtering) | |
There was a problem hiding this comment.
Date-range endpoints remain undocumented
When an agent follows the documented {{ filters.<name> }} pattern for a date-range filter, it references the range as one SQL value instead of using its .start and .end values, causing invalid date comparisons or failed dashboard queries.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/commands/cloud.md
Line: 706
Comment:
**Date-range endpoints remain undocumented**
When an agent follows the documented `{{ filters.<name> }}` pattern for a `date-range` filter, it references the range as one SQL value instead of using its `.start` and `.end` values, causing invalid date comparisons or failed dashboard queries.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Prompt To Fix All With AI### Issue 1
docs/commands/cloud.md:706
**Date-range endpoints remain undocumented**
When an agent follows the documented `{{ filters.<name> }}` pattern for a `date-range` filter, it references the range as one SQL value instead of using its `.start` and `.end` values, causing invalid date comparisons or failed dashboard queries.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (4): Last reviewed commit: "Merge branch 'main' into docs-dashboard-..." | Re-trigger Greptile |
VitePress applies v-pre to fenced code but not inline code, so the inline
{{ filters.<name> }} was parsed as a Vue interpolation and failed the docs
build. Keep literal placeholders inside a fenced sql block. Also document
how SQL references each filter kind: single value, date-range .start/.end
(Greptile P1), and a guarded multi-select IN-list.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviews (5): Last reviewed commit: "Fix docs build and document date-range/m..." | Re-trigger Greptile |
Local agents read
commands/cloud.md(via the docs MCP) and get command syntax but no dashboard definition schema — so they reverse-engineer the state. One recent run invented a top-leveltabs:block; tabs are actually a per-rowtab:field, so that dashboard came out malformed.Adds a "Dashboard definition" section to the dashboards docs:
name,connection,filters,rows)colgrid,x/y/valueencodings)tab:— no top-leveltabs:key (the exact mistake seen)connectionmust be one the bound agent hasDocs only.