Add task instance management commands to airflowctl CLI
Adds task instance management support to the airflowctl CLI, enabling users to get, list, clear, and update task instances directly from the terminal.
Closes: #61547 Related: #66173
Changes
airflow-ctl/src/airflowctl/api/operations.py
- Added
TasksOperationsclass (matching Airflow core CLI naming) withget,list,clear, andupdatemethods - Restored
PluginsOperationsclass that was lost during merge with main (#64935)
airflow-ctl/src/airflowctl/api/client.py
- Added
tasksproperty toClientfor auto-generated CLI command wiring - Restored
pluginsproperty that was lost during merge with main
airflow-ctl/src/airflowctl/ctl/cli_config.py
- Added
"clear"tooutput_command_listfor correct CLI output handling
airflow-ctl/src/airflowctl/ctl/help_texts.yaml
- Added
tasks:section with help text for all four subcommands
scripts/in_container/run_capture_airflowctl_help.py
- Added
"tasks"to the commands list for SVG/help image generation
airflow-ctl/tests/airflow_ctl/api/test_operations.py
- Added
TestTasksOperationswith 7 unit tests covering get, list, clear, and update - Restored
TestPluginsOperationstests lost during merge
airflow-ctl-tests/tests/airflowctl_tests/test_airflowctl_commands.py
- Added end-to-end integration tests for all 4
taskscommands using positional arguments
CLI Commands
airflowctl tasks list <dag_id> <dag_run_id>
airflowctl tasks get <dag_id> <dag_run_id> <task_id>
airflowctl tasks clear <dag_id> [--dry-run] [--only-failed] [--task-ids t1,t2]
airflowctl tasks update <dag_id> <dag_run_id> <task_id> [--new-state <state>] [--note <note>]
Hello @potiuk, Could you please review now and the CI Pipeline can be run?
Also could you help me get this that do i have to do the testing manually on local? This is taking so much time locally!!!
@Suraj-kumar00 A few things need addressing before review — see our Pull Request quality criteria.
- :x: Pre-commit / static checks. See docs.
No rush.
Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.
Hi @potiuk, I'll make the changes tonight!
Hello @henry3260,
I'm looking into this. Thanks for the review!
Hi @henry3260 @potiuk,
I have made the changes as per the feedback, could you please review?
Hi @henry3260 @potiuk,
Let me know the feedback once you get the time to look into this.
Thanks!
Hello @nailo2c, thanks for the review I'll be pushing the changes soon, and will keep you posted on this.
Hi @potiuk, I'll be able to push the changes tomorrow. Thanks
Hi @nailo2c @potiuk,
I have made the changes as per the feedback, could you please review?
Could you address the requested changes from henry3260 and bugraoz93?
Could you address the requested changes from henry3260 and bugraoz93?
All addressed in the latest push: henry3260's bool-defaults issue is fixed by sourcing flag defaults from the datamodels (see thread above), his pool test question was resolved by reverting that file, and the help images/hashes are regenerated. bugraoz93's requests (positional required params, tasks naming to match core CLI) are in. The branch is also squashed onto latest main for a clean diff. One open question remains on the operations class naming, see ashb's thread.