This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new 64ac0919840 [v3-2-test] connections import now returns non-zero exit
code on failure (#64416) (#64449)
64ac0919840 is described below
commit 64ac0919840381ce708c5ce4bddd96f9b20ef4aa
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Apr 7 20:54:37 2026 +0300
[v3-2-test] connections import now returns non-zero exit code on failure
(#64416) (#64449)
(cherry picked from commit 6e5a6db5c8a378026a4f907767a5888f648a0204)
Co-authored-by: Henry Chen <[email protected]>
---
airflow-ctl/src/airflowctl/ctl/commands/connection_command.py | 4 ++--
.../tests/airflow_ctl/ctl/commands/test_connections_command.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/airflow-ctl/src/airflowctl/ctl/commands/connection_command.py
b/airflow-ctl/src/airflowctl/ctl/commands/connection_command.py
index b1a8a820998..5dcb63ce232 100644
--- a/airflow-ctl/src/airflowctl/ctl/commands/connection_command.py
+++ b/airflow-ctl/src/airflowctl/ctl/commands/connection_command.py
@@ -67,8 +67,8 @@ def import_(args, api_client=NEW_API_CLIENT) -> None:
response =
api_client.connections.bulk(BulkBodyConnectionBody(actions=[connection_create_action]))
if response.create.errors:
rich.print(f"[red]Failed to import connections:
{response.create.errors}[/red]")
- raise SystemExit
+ raise SystemExit(1)
rich.print(f"[green]Successfully imported {response.create.success}
connection(s)[/green]")
except Exception as e:
rich.print(f"[red]Failed to import connections: {e}[/red]")
- raise SystemExit
+ raise SystemExit(1)
diff --git
a/airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py
b/airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py
index f944e66ab1f..bdfb759d0a9 100644
--- a/airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py
+++ b/airflow-ctl/tests/airflow_ctl/ctl/commands/test_connections_command.py
@@ -124,11 +124,12 @@ class TestCliConnectionCommands:
}
expected_json_path.write_text(json.dumps(connection_file))
- with pytest.raises(SystemExit):
+ with pytest.raises(SystemExit) as exc_info:
connection_command.import_(
self.parser.parse_args(["connections", "import",
expected_json_path.as_posix()]),
api_client=api_client,
)
+ assert exc_info.value.code == 1
def test_import_without_extra_field(self, api_client_maker, tmp_path,
monkeypatch):
"""Import succeeds when JSON omits the ``extra`` field (#62653).