Skip to content

Fix airflowctl required-option test broken by concurrent merges - #76092

Merged
shahar1 merged 3 commits into
apache:mainfrom
shahar1:fix-airflowctl-required-option-test
Oct 31, 2026
Merged

shahar1 merged 3 commits into
apache:mainfrom
shahar1:fix-airflowctl-required-option-test

Conversation

@shahar1

@shahar1 shahar1 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

test_create_command_without_required_option_exits_with_friendly_message fails on main:

argparse.ArgumentError: the following arguments are required: --conn-type

#69317 and #75177 merged 14 minutes apart and each was green on its own:

Together, argparse rejects the command while parsing, so the test fails before it reaches its assertion.

The product behaviour is fine: airflowctl connections create --connection-id x exits with code 2 and command error: the following arguments are required: --conn-type, see help above., with no traceback and no request sent. So only the test changes: it now asserts that the parser rejects the command, with exit code 2 and the message on stderr. If --conn-type stops being required in argparse, the test fails. _validate_datamodel keeps its direct unit tests from #75177, and its invalid-value path is still reachable from the CLI.

Its "missing required" branch can no longer be reached from any generated command, because argparse rejects those first. It stays as a fallback; this PR leaves it alone.

Not for airflow-ctl/v0-1-test: that branch has #75177 (via #76089) but not #69317, so the old test passes there and this one would fail.

Testing: pytest airflow-ctl/tests: 700 passed. prek run mypy-airflow-ctl --all-files and the commit's prek hooks passed.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 5.5, Sonnet 5.5)

Generated-by: Claude Code (Opus 5.5, Sonnet 5.5) following the guidelines

🤖 Generated with Claude Code

apache#69317 made required request-body fields required in argparse, and
apache#75177 added a test expecting the post-parse validation to report a
missing --conn-type. Each passed on its own, but together argparse
rejects the command during parsing, so the test failed on main. The
argparse error is the intended behaviour; the test now checks it.

@SameerMesiah97 SameerMesiah97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending green CI

@shahar1
shahar1 merged commit 9c164b5 into apache:main Oct 31, 2026
90 checks passed
@shahar1
shahar1 deleted the fix-airflowctl-required-option-test branch October 31, 2026 07:18
shahar1 added a commit to shahar1/airflow that referenced this pull request Oct 31, 2026
…he#76092)

apache#69317 made required request-body fields required in argparse, and
apache#75177 added a test expecting the post-parse validation to report a
missing --conn-type. Each passed on its own, but together argparse
rejects the command during parsing, so the test failed on main. The
argparse error is the intended behaviour; the test now checks it.

(cherry picked from commit 9c164b5)
shahar1 added a commit that referenced this pull request Oct 31, 2026
…dation error (#69317) (#76116)

* [airflow-ctl/v0-1-test] Fix airflowctl operations create command validation error (#69317)

The only conflict was context: _find_subgroup_suffix from the operation subgroups change is not on this branch and stays out. The fix itself applies unchanged.

(cherry picked from commit 1c3b3de)

Co-authored-by: Pratiksha Badheka <[email protected]>

* Fix airflowctl required-option test broken by concurrent merges (#76092)

#69317 made required request-body fields required in argparse, and
#75177 added a test expecting the post-parse validation to report a
missing --conn-type. Each passed on its own, but together argparse
rejects the command during parsing, so the test failed on main. The
argparse error is the intended behaviour; the test now checks it.

(cherry picked from commit 9c164b5)

---------

Co-authored-by: Pratiksha Badheka <[email protected]>
shahar1 added a commit that referenced this pull request Nov 19, 2026
…dation error (#69317) (#76116)

* [airflow-ctl/v0-1-test] Fix airflowctl operations create command validation error (#69317)

The only conflict was context: _find_subgroup_suffix from the operation subgroups change is not on this branch and stays out. The fix itself applies unchanged.

(cherry picked from commit 1c3b3de)

Co-authored-by: Pratiksha Badheka <[email protected]>

* Fix airflowctl required-option test broken by concurrent merges (#76092)

#69317 made required request-body fields required in argparse, and
#75177 added a test expecting the post-parse validation to report a
missing --conn-type. Each passed on its own, but together argparse
rejects the command during parsing, so the test failed on main. The
argparse error is the intended behaviour; the test now checks it.

(cherry picked from commit 9c164b5)

---------

Co-authored-by: Pratiksha Badheka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants