diff --git a/.ai-assets/skills/fabric-cli-core/references/reference.md b/.ai-assets/skills/fabric-cli-core/references/reference.md index a575c80a1..91d8cbec6 100644 --- a/.ai-assets/skills/fabric-cli-core/references/reference.md +++ b/.ai-assets/skills/fabric-cli-core/references/reference.md @@ -680,7 +680,7 @@ fab job run-sch "Production.Workspace/Pipeline.DataPipeline" -i '{"enabled": tru #### Syntax ```bash -fab job run-update --id [--type ] [--interval ] [--enable] [--disable] [-i ] +fab job run-update --id [--type ] [--interval ] [--start ] [--end ] [--days ] [--enable] [--disable] [-i ] ``` #### Examples diff --git a/.changes/unreleased/fixed-20260826-192501.yaml b/.changes/unreleased/fixed-20260826-192501.yaml new file mode 100644 index 000000000..6ee72d1d7 --- /dev/null +++ b/.changes/unreleased/fixed-20260826-192501.yaml @@ -0,0 +1,7 @@ +kind: fixed +body: Fixed `job run-update --help` crashing with an `AssertionError` instead of printing + help +time: 2026-08-26T19:25:01.000000000+03:00 +custom: + Author: ayeshurun + AuthorLink: https://github.com/ayeshurun diff --git a/docs/commands/jobs/index.md b/docs/commands/jobs/index.md index c434ca90a..3ecd3c25d 100644 --- a/docs/commands/jobs/index.md +++ b/docs/commands/jobs/index.md @@ -15,12 +15,12 @@ The `job` commands provide tools for starting, running, monitoring, and scheduli |-----------------|---------------------------|-----------------------------------------------------------------------| | `job start` | Start an item (async) | `job start [-P ] [-C ] [-i ]` | | `job run` | Run an item (sync) | `job run [-P ] [-C ] [-i ] [--timeout ]` | -| `job run-cancel`| Cancel an item run | `job run-cancel [--id ] [--wait]` | +| `job run-cancel`| Cancel an item run | `job run-cancel --id [--wait]` | | `job run-list` | List item or scheduled job runs | `job run-list [--schedule]` | -| `job run-status`| Get job run details | `job run-status [--id ] [--schedule]` | -| `job run-sch` | Schedule a job | `job run-sch [-i *] [--type ] [--interval ] [--days ]` | -| `job run-update`| Update a scheduled job | `job run-update [--id ] [-i ] [--type ] [--enable/--disable]` | -| `job run-rm` | Delete a scheduled job | `job run-rm [--id ] [--force]` | +| `job run-status`| Get job run details | `job run-status --id [--schedule]` | +| `job run-sch` | Schedule a job | `job run-sch [-i ] [--type ] [--interval ] [--days ]` | +| `job run-update`| Update a scheduled job | `job run-update --id [-i ] [--type ] [--interval ] [--start ] [--end ] [--days ] [--enable] [--disable]` | +| `job run-rm` | Delete a scheduled job | `job run-rm --id [--force]` | --- @@ -162,6 +162,31 @@ fab job run-cancel --id [--wait] --- +### run-update + +Update an existing scheduled job. + +**Usage:** + +``` +fab job run-update --id [-i ] [--enable] [--disable] [--type ] [--interval ] [--start ] [--end ] [--days ] +``` + +**Parameters:** + +- ``: Path to the resource. +- `--id`: Schedule ID to update. +- `-i, --input`: JSON payload, inline or path. Optional. +- `--enable`: Enable the schedule. Optional. +- `--disable`: Disable the schedule. Optional. +- `--type`: Type of schedule (`cron`, `daily`, `weekly`). Optional. +- `--interval`: Interval in minutes or time list. Optional. +- `--start`: Start date and time in UTC. Optional. +- `--end`: End date and time in UTC. Optional. +- `--days`: Days of the week. Optional. + +--- + ### run-rm Remove a scheduled job. diff --git a/src/fabric_cli/parsers/fab_jobs_parser.py b/src/fabric_cli/parsers/fab_jobs_parser.py index c3c333ba5..f7343497a 100644 --- a/src/fabric_cli/parsers/fab_jobs_parser.py +++ b/src/fabric_cli/parsers/fab_jobs_parser.py @@ -176,7 +176,7 @@ def register_parser(subparsers: _SubParsersAction) -> None: "# set up pipeline schedule to run every 10 minutes and enable it", "$ job run-sch pip1.DataPipeline --type cron --interval 10 --start 2024-11-15T09:00:00 --end 2024-12-15T10:00:00 --enable \n", "# set up pipeline schedule to run every day at 10:00 and 16:00 (disabled by default)", - "$ job run-update pip1.DataPipeline --id --type daily --interval 10:00,16:00 --start 2024-11-15T09:00:00 --end 2024-12-16T10:00:00 \n", + "$ job run-sch pip1.DataPipeline --type daily --interval 10:00,16:00 --start 2024-11-15T09:00:00 --end 2024-12-16T10:00:00 \n", "# set up pipeline schedule to run every Monday and Friday at 10:00 and 16:00, disabled by default", "$ job run-sch pip1.DataPipeline --type weekly --interval 10:00,16:00 --days Monday,Friday --start 2024-11-15T09:00:00 --end 2024-12-16T10:00:00 \n", "# set up pipeline schedule with custom input", @@ -221,7 +221,7 @@ def register_parser(subparsers: _SubParsersAction) -> None: # Subcommand for 'run_update' update_examples = [ "# disable pipeline schedule", - "$ job run-update pip1.DataPipeline --id --disabled \n", + "$ job run-update pip1.DataPipeline --id --disable \n", "# update pipeline schedule to run every 10 minutes and enable it", "$ job run-update pip1.DataPipeline --id --type cron --interval 10 --start 2024-11-15T09:00:00 --end 2024-12-15T10:00:00 --enable \n", "# update pipeline schedule to run every day at 10:00 and 16:00 (maintain the existing enabled state)", @@ -276,6 +276,7 @@ def register_parser(subparsers: _SubParsersAction) -> None: run_update_parser.add_argument( "--days", metavar="", help="Days of the week. Optional" ) + run_update_parser.usage = f"{utils_error_parser.get_usage_prog(run_update_parser)}" run_update_parser.set_defaults(func=lazy_command(_jobs_module_path, 'run_update_command')) # Subcommand for 'run_rm'