Skip to content

Make CLI login resilient to workspace id key rename in device metadata#5112

Open
qubeena07 wants to merge 1 commit into
zenml-io:developfrom
qubeena07:fix/login-workspace-id-metadata-key
Open

Make CLI login resilient to workspace id key rename in device metadata#5112
qubeena07 wants to merge 1 commit into
zenml-io:developfrom
qubeena07:fix/login-workspace-id-metadata-key

Conversation

@qubeena07

Copy link
Copy Markdown
Contributor

Summary

zenml login for Pro servers reads the selected workspace id out of the device metadata dict returned by the auth server. The code only ever looked at the tenant_id key 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 as workspace, 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

  • Try workspace_id first, then fall back to the legacy tenant_id key
  • Log a debug message when neither key is present so the miss is at least traceable instead of fully silent

Note

device_metadata is 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.py passes
  • Manual login against a Pro server to confirm workspace selection still resolves correctly

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
@qubeena07

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant