-
Notifications
You must be signed in to change notification settings - Fork 559
Add the ability to store a default project for a user #3457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
stefannica
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good for the most part
| version: Optional[str] = None | ||
| store: Optional[SerializeAsAny[StoreConfiguration]] = None | ||
| active_stack_id: Optional[uuid.UUID] = None | ||
| active_project_id: Optional[uuid.UUID] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this being used anywhere. Why do you need it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is used below as an argument to validate_active_config. If we were to keep using the name, we would keep a project with the same name when connecting to a different server, and therefore ignore the default project configured for the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you then be okay with replacing active_project_name with active_project_id ? this is in fact how it's done on the client/repo (i.e. zenml init) configuration side of things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was wondering whether we should keep it in there for backwards compatibility somehow, but I'm happy to remove it entirely!
| f"to '{active_project.name}'." | ||
| ) | ||
|
|
||
| if active_project is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefannica After talking with @htahir1, I reworked this a little:
- If the user does not have a default project set, we try to list all projects
- If there is a single project, we set that as active. This should also cover the OSS case where there should only be a single
defaultproject. - If there are no or multiple projects, we don't set any project active. I guess for the multiple ones, I could still check if there is a project called
defaultand use that instead, to have an even better fallback for the OSS case?
Documentation Link Check Results✅ Absolute links check passed |
Describe changes
This PR adds a user setting for a
default_project_id. This default project will be automatically activated when connecting to a server.Pre-requisites
Please ensure you have done the following:
developand the open PR is targetingdevelop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes