shahar1 opened a new pull request, #76121: URL: https://github.com/apache/airflow/pull/76121
Backport of #76120 to `airflow-ctl/v0-1-test`. On this branch the datamodels are generated from the 3.2.1 spec, so any Airflow 3.3+ or 3.4 server that sends a value the client does not know (a new task-instance state, a new Dag warning type, a new plugin destination) currently ends in a raw pydantic traceback. With this change the command prints one line and exits 1, with a message that distinguishes a non-JSON body (wrong API URL), an invalid request body, and a response that does not match the model (server newer than the client, upgrade hint). Server text goes through `rich.markup.escape`. Differences from the `main` commit: the list path on this branch still has the older `safe_validate` helper, so it is changed to re-raise the original `ValidationError` for a non-JSON body instead of a `JSONDecodeError`; `main` already behaves that way through `validate_response`. Tested: - `breeze testing airflow-ctl-tests`: 566 passed with the new tests (`test_cli_config.py`: three messages; `test_operations.py`: non-JSON list body), all failing without the change. - Live against `apache/airflow:3.4.0rc1-python3.12` before the companion enum fix: `dags list-warning` on a duplicate Dag id prints `Response did not match the airflowctl model DAGWarningCollectionResponse (invalid 'dag_warnings.3.warning_type': ...)` and exits 1 instead of a traceback; unchanged behaviour on 3.2.2 and 3.3.2. - `breeze testing airflow-ctl-integration-tests` against 3.2.2, 3.3.2 and 3.4.0rc1 with the three 0.1.6 fixes combined: identical results to the unpatched branch. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Fable 5.1) Generated-by: Claude Code (Fable 5.1) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
