Skip to content

Exit non-zero when airflowctl connections test fails - #76281

Merged
shahar1 merged 1 commit into
apache:mainfrom
Andrushika:fix-airflowctl-connections-test-exit-code
Nov 2, 2026
Merged

shahar1 merged 1 commit into
apache:mainfrom
Andrushika:fix-airflowctl-connections-test-exit-code

Conversation

@Andrushika

Copy link
Copy Markdown
Contributor

Why

airflowctl connections test sends the connection to POST /api/v2/connections/test. If the test fails, the API server still answers with HTTP 200. The response body shows the failure with "status": false. airflowctl exits 1 only on HTTP errors. Because of this, a failed test exits 0, and a script that checks the exit code cannot see the failure. airflow connections test exits 1 in the same case.

What

After airflowctl prints the result, it now exits 1 if status is false. The printed output does not change.


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

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

@Andrushika
Andrushika requested a review from henry3260 as a code owner November 2, 2026 07:08
@github-actions github-actions Bot added the fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. label Nov 2, 2026
@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Fork CI: green. CI for the latest commit passed in your fork. The pull request is ready for maintainer review.

Pull requests from contributors run their CI in the contributor's own fork. GitHub Actions is free and has no minute limit on public forks, while the CI capacity of the Apache Software Foundation is shared by every ASF project and is finite.

Latest run: https://github.com/Andrushika/airflow/actions/runs/41408227568

How this works: fork CI for external contributors.


This comment was posted automatically by the fork CI monitor from templates drafted with an AI-assisted tool, so it may contain mistakes. An Apache Airflow maintainer, a real person, will review the pull request once its fork CI is green. Why the first pass is automated.

@github-actions
github-actions Bot marked this pull request as draft November 2, 2026 07:24
The API server reports a failed connection test with HTTP 200 and
"status": false in the response body. airflowctl exits 1 only on HTTP
errors, so a failed test exited 0 and a script could not detect it.
`airflow connections test` already exits 1 in this case.
@Andrushika
Andrushika force-pushed the fix-airflowctl-connections-test-exit-code branch from e69bf5f to 338a9cb Compare November 2, 2026 07:44
@github-actions github-actions Bot added the ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green. label Nov 2, 2026
@github-actions
github-actions Bot marked this pull request as ready for review November 2, 2026 08:36
@shahar1
shahar1 merged commit 3318b88 into apache:main Nov 2, 2026
82 checks passed
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: airflow-ctl/v0-1-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ airflow-ctl/v0-1-test PR Link

shahar1 pushed a commit that referenced this pull request Nov 3, 2026
…t fails (#76281) (#76319)

The API server reports a failed connection test with HTTP 200 and
"status": false in the response body. airflowctl exits 1 only on HTTP
errors, so a failed test exited 0 and a script could not detect it.
`airflow connections test` already exits 1 in this case.
(cherry picked from commit 3318b88)

Co-authored-by: Andrew Chang <[email protected]>
shahar1 pushed a commit to shahar1/airflow that referenced this pull request Nov 4, 2026
…t fails (apache#76281) (apache#76319)

The API server reports a failed connection test with HTTP 200 and
"status": false in the response body. airflowctl exits 1 only on HTTP
errors, so a failed test exited 0 and a script could not detect it.
`airflow connections test` already exits 1 in this case.
(cherry picked from commit 3318b88)

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

Labels

area:airflow-ctl backport-to-airflow-ctl/v0-1-test fork ci required Gated by AIP-120: CI must pass in the contributor's fork. Managed by the fork CI reconciler. ready for maintainer review Set by triage when all criteria pass, or by the fork CI reconciler when fork CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants