Make CLI login resilient to workspace id key rename in device metadata#5112
Open
qubeena07 wants to merge 1 commit into
Open
Make CLI login resilient to workspace id key rename in device metadata#5112qubeena07 wants to merge 1 commit into
qubeena07 wants to merge 1 commit into
Conversation
The device metadata returned by the Pro auth server is an untyped dict, and the code only ever read the legacy tenant_id key with a TODO asking whether that was still correct. Nothing else in the login flow uses the word tenant anymore, so a server side rename to workspace_id would have silently dropped the workspace selection with no error, just the generic fallback message asking the user to pick a server manually. Try workspace_id first, fall back to tenant_id, and log a debug message when neither key is present so the miss is at least traceable. Fixes zenml-io#5111
Contributor
Author
|
I do not have permission to add labels here. Could a maintainer add the no release notes label please, this is an internal bug fix with no user facing changes. Also flagging that the linting and pr labeler check failures are pre existing and unrelated to this change, the same mypy failures in hashicorp_secrets_store.py show up on other recent PRs into develop such as #5105. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zenml loginfor Pro servers reads the selected workspace id out of the device metadata dict returned by the auth server. The code only ever looked at thetenant_idkey and had a TODO questioning whether that was still correct. Nothing else in the login flow uses the word tenant anymore, the web login request itself sends the hint asworkspace, so a server side rename would have silently dropped the workspace selection with no error, just the generic fallback message asking the user to pick a server manually.Changes
workspace_idfirst, then fall back to the legacytenant_idkeyNote
device_metadatais an untyped dict sourced entirely from the Pro auth server, which lives outside this repo, so I could not directly confirm the current key name from here. This change is a safe fallback rather than a guess at a single replacement key.Fixes #5111
Test plan
ruff check src/zenml/cli/login.pypasses