Repository navigation
[airflow-ctl/v0-1-test] Fix airflowctl commands crashing instead of printing their result (#72675) - #73988
Merged
henry3260 merged 1 commit intoOct 1, 2026
Conversation
…ache#72675) airflowctl generates its commands from the operations layer, and every generated command finishes by printing through ``args.output``. That flag was only declared for commands whose method name happened to start with one of ten CRUD verbs, so the ones that did not — ``assets materialize``, ``backfill pause|unpause|cancel`` and ``connections test`` — reached the printer with the attribute undefined and died with a raw traceback, after their request had already been sent and applied server-side. ``-e/--env`` deliberately keeps its existing whitelist. Nothing reads ``args.env`` for generated commands, so widening it would only let more commands silently accept an environment they then ignore and run against production credentials instead; that is tracked separately in apache#70519. Co-authored-by: Eason09053360 <[email protected]> (cherry picked from commit f31b572) The pick is not clean, because this branch does not carry the commit that introduced ``_call_generated_command`` and the ``test_primitive_param_*`` tests. Git offered those alongside this change in the conflict; they are left out, since they belong to that commit rather than this one, as do the ``ClearTaskInstancesBody`` and ``DagRunOperations`` imports they need. ``from unittest import mock`` is plain context on main and is added here for the same reason: the test this commit adds needs it, and the commit that would have brought it is not on this branch.
henry3260
requested review from
bugraoz93,
dheerajturaga and
potiuk
as code owners
September 30, 2026 20:58
shahar1
pushed a commit
that referenced
this pull request
Nov 19, 2026
…2675) (#73988) airflowctl generates its commands from the operations layer, and every generated command finishes by printing through ``args.output``. That flag was only declared for commands whose method name happened to start with one of ten CRUD verbs, so the ones that did not — ``assets materialize``, ``backfill pause|unpause|cancel`` and ``connections test`` — reached the printer with the attribute undefined and died with a raw traceback, after their request had already been sent and applied server-side. ``-e/--env`` deliberately keeps its existing whitelist. Nothing reads ``args.env`` for generated commands, so widening it would only let more commands silently accept an environment they then ignore and run against production credentials instead; that is tracked separately in #70519. Co-authored-by: Eason09053360 <[email protected]> (cherry picked from commit f31b572) The pick is not clean, because this branch does not carry the commit that introduced ``_call_generated_command`` and the ``test_primitive_param_*`` tests. Git offered those alongside this change in the conflict; they are left out, since they belong to that commit rather than this one, as do the ``ClearTaskInstancesBody`` and ``DagRunOperations`` imports they need. ``from unittest import mock`` is plain context on main and is added here for the same reason: the test this commit adds needs it, and the commit that would have brought it is not on this branch. Co-authored-by: Y-C <[email protected]>
28 of 67 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #72675 to
airflow-ctl/v0-1-test.Why
airflowctl generates its commands from the operations layer, and every generated
command finishes by printing through
args.output. That flag was only declared forcommands whose method name happened to start with one of ten CRUD verbs, so the ones
that did not —
assets materialize,backfill pause|unpause|cancelandconnections test— reached the printer with the attribute undefined and died with araw traceback, after their request had already been sent and applied server-side.
-e/--envdeliberately keeps its existing whitelist. Nothing readsargs.envforgenerated commands, so widening it would only let more commands silently accept an
environment they then ignore and run against production credentials instead; that is
tracked separately in #70519.
The bug is present on this branch. With the fix reverted, both tests this commit adds
fail here:
Was generative AI tooling used to co-author this PR?