Skip to content

Incorrect fallback logic#64586

Merged
bugraoz93 merged 2 commits intoapache:mainfrom
rjgoyln:credential_file
Apr 7, 2026
Merged

Incorrect fallback logic#64586
bugraoz93 merged 2 commits intoapache:mainfrom
rjgoyln:credential_file

Conversation

@rjgoyln
Copy link
Copy Markdown
Contributor

@rjgoyln rjgoyln commented Apr 1, 2026

Description

When AIRFLOW_CLI_DEBUG_MODE is set to true, if the primary config file exists but the debug_credentials file is missing, the system incorrectly reports "No credentials file found" instead of the expected debug-specific error.

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for the PR! I have a small nit with a comment in test else looks good. After that amendment, would be happy to approve

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes incorrect error reporting when AIRFLOW_CLI_DEBUG_MODE=true and the main CLI config exists but the debug credentials file is missing, ensuring a debug-specific “missing debug credentials” error is raised instead of the generic “No credentials file found”.

Changes:

  • Catch missing debug credentials file separately during Credentials.load() and raise a debug-specific AirflowCtlCredentialNotFoundException.
  • Add a regression test covering the “config present + debug creds missing” scenario in debug mode.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
airflow-ctl/src/airflowctl/api/client.py Adds targeted FileNotFoundError handling for missing debug credentials to avoid falling into the generic “no credentials file” path.
airflow-ctl/tests/airflow_ctl/api/test_client.py Adds a regression test asserting the correct exception/message when debug creds are missing but the primary config exists.

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Apr 2, 2026
rjgoyln and others added 2 commits April 7, 2026 20:31
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bugraoz93 bugraoz93 merged commit fc315f3 into apache:main Apr 7, 2026
38 checks passed
shivaam pushed a commit to shivaam/airflow that referenced this pull request Apr 8, 2026
* Incorrect fallback logic

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:airflow-ctl ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants