Skip to content

Align workflow commands with nested queries and nullable intervals - #79

Merged
rmorehig merged 6 commits into
mainfrom
jordiori/raw-538-cli-rtree-workflow-list-fails-with-missing-field-database
Oct 8, 2026
Merged

rmorehig merged 6 commits into
mainfrom
jordiori/raw-538-cli-rtree-workflow-list-fails-with-missing-field-database

Conversation

@jordiori

@jordiori jordiori commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes RAW-538.

The Platform API now groups workflow SQL and database under query. This fixes rtree workflow list/get response parsing and create/update payloads, while preserving partial query updates.

  • Creating without --interval-seconds explicitly sends interval_seconds: null: manual-only execution, with no hidden default interval. --interval-seconds null also removes an existing schedule; omitting it on update preserves the schedule. There is no --manual flag.
  • Human output consistently uses three statuses: active for enabled scheduled workflows, paused for disabled scheduled workflows, and manual whenever there is no schedule. Scheduled durations remain visible; manual intervals display —.
  • List and detail output include next-run times and HTTP sink URLs. Header values remain write-only. JSON output preserves the API response.
  • Create help now says “Create a workflow that runs SQL on demand or on a schedule.”
  • Expand contract coverage and add four workflow tests to the existing CLI Docker Compose E2E suite. Bump the CLI to 0.6.14.

Commands and output

Examples assume an organization and cluster are selected. IDs and timestamps below are illustrative; the output format was checked with the built CLI against local fixture responses.

Create a manual workflow (explicit --interval-seconds null has the same effect):

rtree workflow create --name alerts --database analytics --sql "SELECT 1"
Workflow 'alerts' created:
  id:       wf-1
  name:     alerts
  database: analytics
  status:   manual
  interval: —
  next run: —
  revision: 1
  created:  2026-10-08T10:00:00Z
  updated:  2026-10-08T10:00:00Z
  sinks:    none
  sql:
    SELECT 1

Inspect the workflow:

rtree workflow get wf-1

This prints the same details under Workflow 'alerts':.

Change scheduling:

rtree workflow update wf-1 --interval-seconds 60
rtree workflow update wf-1 --disable
rtree workflow update wf-1 --enable
rtree workflow update wf-1 --interval-seconds null

Each update prints Workflow 'alerts' updated: followed by the full details. The relevant fields after each command are:

Update Status Interval
--interval-seconds 60 on the newly created workflow active 1m
--disable paused 1m
--enable active 1m
--interval-seconds null manual —

Changing SQL or database preserves the other query field and the schedule:

rtree workflow update wf-1 --sql "SELECT 2"
rtree workflow update wf-1 --database analytics_v2

List workflows:

rtree workflow list

Selected columns from an illustrative list (the actual table also includes sinks, updated time, and ID):

name database status interval next run
alerts analytics active 1m 2026-10-08T10:01:00Z
paused-alerts analytics paused 1m —
on-demand analytics manual — —

Validation

  • Latest head a0c0eb9: cargo test --locked passed all 200 unit/contract tests, including status and interval assertions for list/get/create/update. Formatting and diff checks passed.
  • Thermo-nuclear quality review via autoreview --mode local --max-priority P3 --no-web-search completed with no actionable findings.
  • All six CLI E2E tests previously passed against a fresh Platform Docker Compose stack at e08beaa8e: four workflow tests plus existing logout and data-flow tests. Workflow coverage includes query/schedule lifecycle, manual delivery and idempotency, logs and metrics, scheduled execution and pause/resume, and cancellation. Compose was not rerun after the final status-label/help-only change.

Note

Medium Risk
Workflow create/update/list behavior and API payload shape changed; incorrect interval or query patching could affect production automation, though coverage is extensive.

Overview
Aligns rtree workflow with the Platform API’s nested query object and nullable interval_seconds, fixing broken create/update payloads and list/get rendering after the API change.

Scheduling: --interval-seconds accepts SECONDS (1–86400) or null. Omitting it on create sends interval_seconds: null (manual-only, no server default). On update, omitting the flag leaves the schedule unchanged; null clears it. Partial PATCH sends only the query fields you pass (--database / --sql).

Output: Human tables and detail views show active / paused / manual, nullable intervals, next run, and HTTP sink URLs (headers stay write-only).

Docs, mock contract tests, and four ignored live Compose workflow E2E tests cover scheduling, partial updates, and lifecycle behavior. Version 0.6.14.

Reviewed by Cursor Bugbot for commit a0c0eb9. Bugbot is set up for automated code reviews on this repo. Configure here.

The platform API now nests database and sql in a query object
(rawtreedb/rawtree-platform#1368), which broke workflow list, get,
create and update. Also accept a null interval for manual-only workflows.
Sends a null interval so the workflow has no schedule and only runs via
rtree workflow run.
@jordiori
jordiori requested a review from rmorehig October 8, 2026 12:03
@rmorehig rmorehig changed the title Fix workflow commands for the nested query shape and add --manual Align workflow commands with nested queries and nullable intervals Oct 8, 2026
@rmorehig
rmorehig merged commit 396565c into main Oct 8, 2026
8 checks passed
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