Repository navigation
feat: support Platform API 1.150 features (cron actions) - #688
cristianrcv wants to merge 3 commits into
Conversation
Platform API 1.150 added the cron action source: an action that launches its pipeline on a recurring schedule, set by a 5-field cron expression and an IANA timezone (UTC when omitted). tw could only create GitHub, Seqera Platform and bucket actions. - 'actions add cron --cron-expression <expr> [--timezone <tz>]' sends CreateActionRequest.cron. - 'actions update --cron-expression/--timezone' sends a partial UpdateActionRequest.cron; omitted fields keep their stored value. The API answers 400 for a cron block on another source, which tw would hide behind its generic update error, so tw refuses it up front. - 'actions view' shows the expression, timezone and next execution. - 'actions list' already accepts a null endpoint, which cron actions always have; its test now covers a cron row. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Extend the 'Other additions' bullet for new action sources with cron. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Entry for 'actions add cron', copied from the catch-up branch where a full test run under the GraalVM tracing agent captured it. The cron model classes were already registered. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
educalleja
left a comment
There was a problem hiding this comment.
Usage of the new commands
This PR adds one new command, tw actions add cron, and two new options for tw actions update. Together they let you create and edit pipeline actions that run on a recurring schedule.
1. tw actions add cron (new)
Adds a pipeline action that runs on a recurring schedule.
| Option | Description |
|---|---|
--cron-expression |
The schedule, as a standard 5-field cron expression, such as '0 2 * * *' (required) |
--timezone |
IANA timezone the schedule runs in, such as Europe/London. Default: UTC |
It also takes the options every tw actions add source shares:
| Option | Description |
|---|---|
-n, --name |
Action name (required) |
--pipeline |
Pipeline to launch (required) |
-w, --workspace |
Workspace |
--overwrite |
Overwrite the action if it already exists |
| Labels and launch options | The same as for the other tw actions add sources |
Example:
tw actions add cron -n nightly --pipeline https://github.com/nextflow-io/hello \
--cron-expression '0 2 * * *' --timezone Europe/London2. tw actions update: new cron options
| Option | Description |
|---|---|
--cron-expression |
New schedule for a cron action, as a standard 5-field cron expression |
--timezone |
New IANA timezone for a cron action's schedule |
- These options only work on cron actions. Using them on another kind of action fails with: "Options --cron-expression and --timezone apply only to cron actions, but action '<name>' is a <source> action".
Changes to existing output
tw actions viewshows Cron expression, Timezone and Next execution for cron actions.tw actions listhandles cron actions, which have no endpoint.
USAGE.md
The PR changes the bullet tw actions add bucket to tw actions add cron|bucket in the list of commands added for newer API versions. It adds no new example.
🤖 Generated with Claude Code
|
Superseded by #703 (actions). This PR only added cron actions, which are now grouped with the other action sources, so there's no separate 1.150 PR. The stack is now: #685 (1.101) → #686 (1.113) → #697 (1.145) → #698 (1.167) → #699 (1.190) → #700 (1.200) → #701 (1.230) → #702 (agents) → #703 (actions). The code at the top of the stack is identical to the old one; only the grouping changed. Agents and actions changes are grouped into one PR each instead of being spread across API versions. New branches were used instead of force-pushing. |
Summary
Exposes the scheduled (cron) action source introduced in Platform API 1.150.0.
This is one PR in a stack that catches tw up with Platform API 1.230.0, one PR per API version that introduced the features. Each PR adds the items whose API elements all exist in that version.
tower-java-sdk1.200.0, which already contains every API element used here. The last PR in the stack bumps it to 1.230.0.Changes
Verification
./gradlew test: 869 tests, 0 failures. Every new command and option has MockServer tests that assert the request (method, path, query, body) and the output.tower-sdk-gencodehistory) to confirm where it first appears.🤖 Generated with Claude Code