-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add workspace subcommands #148
Conversation
silverback/_cli.py
Outdated
update_name: str, | ||
update_slug: str, |
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.
update_name: str, | |
update_slug: str, | |
update_name: str | None, | |
update_slug: str | 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.
If the user doesn't have an update name or slug, it seems like it won't keep the previous name/slug. At least that was the case when I tried it using the /docs/
page, or was that a bug?
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.
so if both are empty, it should raise UsageError
because you haven't tried to update anything
are you saying if one is empty and the other is intended to be changed, they both update?
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.
Originally it was if one is empty and the other is intended then they both updated. The new push I made should have fixed that issue though I think.
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.
the service itself should allow None
values and basically make it "no change required", so you shouldn't have to set the values if they are not set and it should work appropiately
my point above is that if both are None
that is a no-op (won't make any change when you send the PATCH request to the service) so it should raise click.UsageError
that it's a no-op
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've tried to update just one value of both name
and slug
but if a value is left as None
then the value will be patched in the workspace as ''
.
silverback cluster workspaces info -p staging testing3
Name: # should be testing2 since value was left as None
Slug: 'testing3'
Date Created: '2024-10-23 15:25:48.249070+00:00'
Added the click.UsageError
if both values are 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.
Some small nits, lfg
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.
Test all the commands one last time and then we can release this
All the commands work. The only thing of concern is that when updating only one value of either the name or slug, the value that isn't updated is patched as an empty string. This is the same behavior when done directly through the fastapi
|
What I did
Add workspaces subcommands to cli
fixes: #141
How I did it
How to verify it
Checklist