Skip to content

Add data actions support to CLI - #66

Merged
ranquild merged 1 commit into
release-65-integration-branchfrom
query-actions
Oct 2, 2026
Merged

ranquild merged 1 commit into
release-65-integration-branchfrom
query-actions

Conversation

@ranquild

@ranquild ranquild commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

What

mb data-action list | get | create | update | archive | delete | execute over /api/action, plus a data-action skill. The CLI calls Metabase actions data actions; the server API keeps the action name.

A data action is a parameterized native SQL write (INSERT, UPDATE or DELETE) filed in a collection and run with parameter values.

  • Query-type data actions only. create accepts type: "query" with database_id and an MBQL 5 native dataset_query, pre-flight-validated like card queries. The body is closed, so model_id and type: "implicit" are refused client-side. Model-bound and implicit data actions are legacy: they still list, get, run and archive, but the CLI never authors them.
  • collection_id is read on servers that file data actions in collections (dataActionCollections, 65). On older servers it reads as null.
  • create is gated on dataActionsWithoutModel (65), the first version that accepts a data action without a model (metabase#83435). On older servers it fails before any request.
  • execute posts parameter values keyed by parameter id and reports rows-affected.
  • The data-action skill (requires: [dataActionsWithoutModel]) covers the body, one raw-variable parameter per template tag, running, and the lifecycle. It states that data actions are off by default and need an admin to enable them on the database. native-sql points writes to it.

Testing

bun run check passes.

Wire-level unit tests in packages/client/src/resources/data-action.test.ts cover every method, the 64-vs-65 collection read, and the client-side create refusal on 64.

tests/e2e/data-action.e2e.test.ts runs on servers with dataActionsWithoutModel, which today means the head lanes. Each test turns actions on for the warehouse database through the API. The suite checks that create is refused while actions are off, then covers a model-less create filed in a collection, list and get, an execute that reports rows-affected, a refused execute missing its required parameter, and update, archive and delete. On 58–64 lanes it checks that create is refused with a capability error before any request. The skills suite expects data-action under unavailable on a v58 profile. All e2e lanes, 58 through head on both editions, pass.

🤖 Generated with Claude Code

@ranquild ranquild changed the title Add query actions support Add data actions support Oct 2, 2026
@ranquild ranquild self-assigned this Oct 2, 2026
@ranquild
ranquild marked this pull request as ready for review October 2, 2026 17:22
@ranquild
ranquild requested a review from alxnddr October 2, 2026 21:35

@alxnddr alxnddr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great! Let's merge only when we're about to release x.65 same way as #59

@ranquild ranquild changed the title Add data actions support [DO NOT MERGE until v65 is released] Add data actions support Oct 2, 2026
@alxnddr

alxnddr commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

@ranquild actually let's do release-65-integration-branch because we probably want to have all pending v65 features for testing. We'll publish an alpha version from there

@ranquild
ranquild changed the base branch from main to fix/transform-test-ee-path October 2, 2026 21:45
mb data-action list|get|create|update|archive|delete|execute over /api/action,
query-type data actions only, a data-action skill, and e2e coverage on servers
that accept data actions without a model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ranquild
ranquild changed the base branch from fix/transform-test-ee-path to release-65-integration-branch October 2, 2026 21:46
@ranquild ranquild mentioned this pull request Oct 2, 2026
@ranquild
ranquild merged commit 31ca6bb into release-65-integration-branch Oct 2, 2026
30 checks passed
@ranquild ranquild changed the title [DO NOT MERGE until v65 is released] Add data actions support Add data actions support to CLI Oct 2, 2026
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.

2 participants