fix(cli): allow remote version check without local config file#65099
fix(cli): allow remote version check without local config file#65099rjgoyln wants to merge 3 commits intoapache:mainfrom
Conversation
bugraoz93
left a comment
There was a problem hiding this comment.
A command to how we should handle this case what we have already in there, enabling future cases and creating this as separate flow rather changing conditions.
To be honest any condition there break things and api token shouldn't be none any case, the behaviour should skip entire flow there as in ClientKind.NO_AUTH.
| if self.client_kind != ClientKind.AUTH: | ||
| # This is expected during the auth login command. | ||
| # Also allow token-only usage without local config (for commands like `version --remote`). | ||
| if self.client_kind != ClientKind.AUTH and self.api_token is None: |
There was a problem hiding this comment.
I think this can be None in some cases.
How about we do something like this and eliminate auth kind for version fully as well as --remote which version should already respond without auth
Here I have added NO_AUTH
https://github.com/apache/airflow/pull/61822/changes#diff-6c1e70e5894d838261bf4f502f2f117eed5e35dfcaa211f4e2b1070d632fda02R94
Then setting correct path and cascade to credentials in the same file. That would also enable similar cases in the future. You can find all corrolated changes there. There are some more with schema management but you can ignore all. In version command when call with not auth we can skip auth for all rather changing the behavior when we actually auth.
That could break things. What do you think?
There was a problem hiding this comment.
Thanks for the feedback, @bugraoz93! I agree that adding ClientKind.NO_AUTH is a cleaner and more robust approach than extra conditional checks.
I’ve made the changes—let me know if anything needs adjustment.
Also, I couldn’t find your NO_AUTHimplementation in #61882, sorry!
There was a problem hiding this comment.
This is so strange is the ids are duplicates 😕
#61822. This PR is showing me different my PR while when I click your link it shows Jareks 🤔
There was a problem hiding this comment.
Screencast from 2026-04-13 19-39-50.webm
This is what I see :D
There was a problem hiding this comment.
I use Linux, it saved webm, if it won't be visible here is mp4 :D The PR is called Decouple airflowctl tests from branch dependency and add schema evolution with strict versioning
Summary
This PR fixes a bug where
version --remote(and other CLI commands) fails if a local configuration file is missing, even when a valid token is provided. By relaxing the strict dependency on the physical config file, the CLI now supports token-only authentication in stateless environments.Changes
load()method inclient.pyto check for an existingapi_tokenwhen aFileNotFoundErroroccurs.AirflowCtlCredentialNotFoundExceptionfrom being raised if a token is already present, allowing the client to initialize using the provided credentials.credentialsfile.Was generative AI tooling used to co-author this PR?
GPT 5.3 codex
{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.