Skip to content

[AIP-94] Add airflowctl Tasks List Command - #70472

Closed
ColtenOuO wants to merge 1 commit into
apache:mainfrom
ColtenOuO:airflowctl-tasks-list
Closed

ColtenOuO wants to merge 1 commit into
apache:mainfrom
ColtenOuO:airflowctl-tasks-list

Conversation

@ColtenOuO

@ColtenOuO ColtenOuO commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Adds airflowctl tasks list <dag_id> [--order-by], backed by the existing GET /dags/{dag_id}/tasks Public API endpoint, and marks the core airflow tasks list command with @deprecated_for_airflowctl.

related: #68402 [AIP-94] airflowctl command migration

related: #66173

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5) for writing Tests.

@potiuk

potiuk commented Jul 30, 2026

Copy link
Copy Markdown
Member

Heads-up: I merged #69274 earlier today and it has just put this PR into conflict — apologies, the overlap wasn't visible until I went looking.

#69274 marked the tasks CLI commands as migrated, which included adding exactly the two lines this PR also adds:

  • @deprecated_for_airflowctl("airflowctl tasks list") on task_list in airflow-core/src/airflow/cli/commands/task_command.py (now on main)
  • (task_command.task_list, "airflowctl tasks list") in test_command_deprecations.py

This branch is ~133 commits behind main, so both will collide on rebase. The fix is simply to drop them from this PR — they're already on main — and keep the airflowctl side, which is the actual substance here.

Same situation applies to #69397 (tasks failed-deps), which I've flagged there too. Worth knowing the pattern: the AIP-94 marker PRs and the airflowctl command PRs touch the same two core files, so whichever lands first obliges the other to rebase.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

@ColtenOuO
ColtenOuO force-pushed the airflowctl-tasks-list branch from 10429af to d81c6f7 Compare July 30, 2026 14:27
@ColtenOuO

Copy link
Copy Markdown
Contributor Author

Thanks for the heads-up! Rebased onto latest main and dropped both duplicated lines

@ColtenOuO
ColtenOuO force-pushed the airflowctl-tasks-list branch from d81c6f7 to 5424ba7 Compare July 30, 2026 14:41
@ColtenOuO

Copy link
Copy Markdown
Contributor Author

I think the failing Airflow CTL tests check doesn't come from this PR (?

The tasks list tests had passed

@sgoel2be24-cyber

Copy link
Copy Markdown
Contributor

I tested this PR against current main (386132ef, 2026-09-16). The diff still applies cleanly, with no rebase conflicts.

Tests (run locally, Python 3.10 uv env from airflow-ctl/):

  • TestTasksOperations::test_list[no-order-by|with-order-by] and TestCliConfigMethods::test_tasks_list_args pass. They fail without the operations.py change (AttributeError: 'TasksOperations' object has no attribute 'list' / StopIteration), so they cover the change.
  • Full airflow-ctl unit suite: 397 passed.
  • prek run --files <changed files>: ruff, ruff-format, mypy for airflow-ctl, check-airflowctl-command-coverage, check-airflowctl-help-texts and the other hooks pass. I couldn't run generate-airflowctl-help-images locally because it needs breeze, so CI needs to confirm the tasks hash and SVG.

About the red Airflow CTL tests / airflow-ctl:P3.10 tests job: it failed only in tests/airflow_ctl/ctl/commands/test_task_command.py::TestFailedDeps (ValidationError: 19 validation errors for TaskInstanceResponse). This PR doesn't touch that file, and all of TestFailedDeps passes on current main with this diff applied. It looks like a breakage that was on main when the job ran (2026-07-30), so a rebase or CI re-run should turn it green.

Code: the implementation looks right to me.

  • GET /dags/{dag_id}/tasks isn't paginated (it returns every task plus total_entries), so calling client.get directly instead of execute_list fits.
  • _build_query_params leaves order_by out when it's unset, so the server's default (task_id) applies.

One small suggestion: #66173 lists TasksOperations.list as the only operation from its original checklist that isn't on main yet. get, get_dependencies and list on TaskInstancesOperations, and TasksOperations.clear, have all been merged. Adding related: #66173 to the description would link that issue to this PR.


Drafted-by: Claude Code (Opus 5); reviewed by @sgoel2be24-cyber before posting

Listing a Dag's tasks currently requires the local `airflow tasks list`
command, which parses Dag files on the caller's machine and needs direct
metadata database access. Exposing it through airflowctl lets operators
list tasks against the Public API under RBAC instead, per AIP-94.

related: apache#68402
@ColtenOuO
ColtenOuO force-pushed the airflowctl-tasks-list branch from 5424ba7 to e26b381 Compare September 24, 2026 03:54
@ColtenOuO

Copy link
Copy Markdown
Contributor Author

Rebased to the lastest main branch and re-run the CI.

@potiuk potiuk added the closed because of open PR limit Closed as a one-time step of introducing the open pull request limit label Sep 25, 2026
@potiuk

potiuk commented Sep 25, 2026

Copy link
Copy Markdown
Member

Hello @ColtenOuO - thank you for your contributions to Apache Airflow!

The Airflow community has introduced a limit of 5 open pull requests at a time for contributors without write access to the repository. You currently have 19 open pull requests, so - as a one-time step of introducing the limit - we closed the ones where maintainers have not engaged yet:

These pull requests stay open because maintainers are already engaged in them - they count towards your limit:

This is not a judgement of you or of your changes. We never told contributors before that opening many pull requests at once was a problem, so there is nothing to feel bad about - and nothing is lost: your branches, commits and the review history stay where they are.

What we ask you to do is to make your first prioritization decision: choose which of the pull requests above matter most to you, and reopen them (up to 5 open at a time, including the ones still open) with the "Reopen pull request" button or gh pr reopen <PR_NUMBER> --repo apache/airflow. Reopen the ones you are ready to follow through - keep them rebased, respond to review comments and fix failing checks.

While your pull requests are waiting for review, the most valuable thing you can do is help in other ways - reviewing other contributors' pull requests, helping with issues, and taking part in the discussions on the devlist and Slack.

Why we introduced the limit, what it means for you and how to reopen or restore a pull request is explained in https://github.com/apache/airflow/blob/main/contributing-docs/32_open_pull_request_limit.rst.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl area:CLI backport-to-airflow-ctl/v0-1-test closed because of open PR limit Closed as a one-time step of introducing the open pull request limit kind:documentation ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants