Skip to content
This repository was archived by the owner on Aug 5, 2026. It is now read-only.

feat: add board (dashboard) CRUD commands - #2

Merged
beengud merged 5 commits into
mainfrom
feat/board-commands
Jun 2, 2026
Merged

feat: add board (dashboard) CRUD commands#2
beengud merged 5 commits into
mainfrom
feat/board-commands

Conversation

@beengud

@beengud beengud commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a full suite of board/dashboard management commands:

  • observe list board — list all dashboards in a workspace
  • observe get board <id> — fetch a single dashboard by ID
  • observe board create <file.json> — create a new dashboard from JSON
  • observe board update <id> <file.json> — update an existing dashboard
  • observe board scaffold <dsid> — generate a starter dashboard template for a dataset
  • observe delete board <id> — delete a dashboard
  • observe board set-default <dsid> <bid> — set the default board for a dataset
  • observe board clear-default <dsid> — clear the default board for a dataset

Bug fixes included

  • Board list: workspaceId must use array type [ObjectId!]! in the GraphQL query
  • Board save: strip read-only updatedDate field before saveDashboard mutation (API rejects it)
  • Board save: normalize missing stages[n].input to [] (required by schema)

Test plan

  • observe list board returns a table of boards
  • observe get board <id> returns JSON
  • observe board scaffold <dsid> generates a valid JSON template
  • observe board create <scaffold.json> creates a new board
  • observe board update <id> <file.json> updates without 400 error
  • observe board set-default <dsid> <bid> / observe board clear-default <dsid>

…eDashboard mutation

The Observe API returns updatedDate in board responses but does not accept
it in the DashboardInput type. Sending it causes GRAPHQL_VALIDATION_FAILED.
…hQL type

The saveDashboard mutation requires stages[n].input to be defined.
Pure pipeline stages (no dataset input) omit the field entirely, causing
GRAPHQL_VALIDATION_FAILED. Default missing input to empty array.
…lt commands

Adds --name and --folder flags to `observe list board` to trigger dashboardSearch
with filter terms instead of the plain workspace list. The global --workspace flag
(cfg.WorkspaceIdOrName) is used as the workspace filter when search is active.

Adds `observe board set-default <dataset-id> <board-id>` and
`observe board clear-default <dataset-id>` subcommands using
setDefaultDashboard / clearDefaultDashboard mutations.

Includes unit tests in cmd_board_search_test.go covering:
- Plain list (no flags) uses dashboards field
- Name filter triggers dashboardSearch results field
- Workspace-via-config passes through to search terms
- Folder filter triggers dashboardSearch
- Empty results produces header-only output
- unpackBoardItems helper tested directly

Closes #10
Closes #12
@beengud
beengud merged commit 4b6c259 into main Jun 2, 2026
@beengud
beengud deleted the feat/board-commands branch June 2, 2026 02:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants