feat(api): group automations (setGroup, CLI --group, MCP group)
Merged
KI
1d ago+186+186+012345678901234567890123456789-6-6-0123456789
Stack (merge in order)
- #9208: migration
- this PR: API, CLI, MCP
- Desktop UI (next PR, based on this branch)
Summary
- New
automation.setGroup({ id, group }): owner-only and cheap. It writes only the group column, unlikeupdate, which re-resolves the target and resyncs schedules. - Optional
grouponautomation.createandautomation.update.listandgetnow returngroup. @superset/shared/automation-groupnormalizes names: trims, collapses spaces, keeps case, max 64 characters, and treats blank as ungrouped.- CLI:
automations create/update --group <name>,update --clear-group,list --group <name>(case-insensitive), plus a GROUP column inlist. - MCP:
groupon the automations create and update tools.
tRPC compatibility (packages/trpc/AGENTS.md)
- Additive only: a new procedure, new optional input fields, and a new output field (
group, typedstring | null). - No existing input is tightened, and no behavior or error code changes.
- Older clients ignore the new field; older CLI builds simply don't send
--group. - Ship the API before the desktop PR: it calls
setGroupand readsgroup.
Testing
bun test packages/shared/src/automation-group.test.ts: normalizing, blank means ungrouped, length limit, matching an existing group without regard to casebun test packages/trpc/src/router/automation,packages/cli,packages/mcp: all passbunx tsc --noEmitin trpc, cli, mcp, shared- Real CLI run against the dev API on this branch:
list --group growthfilters to that group.update --group " Launch watch "stores "Launch watch".--groupwith--clear-groupis refused.--clear-groupsets the group to null.- The table view shows the GROUP column.
createwithgroupthrough the API. Two automations created this way were then bulk-deleted from the desktop UI.
Docs
apps/docs/content/docs/cli/cli-reference.mdx: new flags and the GROUP column.
Summary by cubic
Adds automation groups across the API, CLI, and MCP, and fixes automation.update so edits that leave the schedule alone no longer drop schedules.
- New
automation.setGroupwrites only the group column and is owner-only, much cheaper thanupdatefor single-field changes. groupis now an optional input on create and update (null ungroups) and an output of list and get.- New
@superset/shared/automation-grouphelper trims and collapses whitespace, keeps case, caps names at 64 characters, treats blank input as ungrouped, and resolves a name to the organization's existing spelling when it matches a group case-insensitively. - CLI gained
--groupon create/update/list,--clear-groupon update, and a GROUP column inlist. - The MCP create and update tools accept
group.
Bug Fixes
automation.updateonly re-syncs the schedule when rrule, dtstart, or timezone change, so updates like rename or--groupkeep every schedule.list --groupnormalizes the filter like create and update do.
Compatibility
- All tRPC changes are additive — a new procedure, new optional inputs, and one new output field — so older clients are unaffected.