-
Notifications
You must be signed in to change notification settings - Fork 234
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
CLI support for setting Delta Sharing recipient properties #584
Conversation
@wchau do you know who else should I send for review or is it enough to get reviewed within our team? |
@@ -394,16 +394,22 @@ def delete_share_cli(api_client, name): | |||
help=( | |||
'IP address in CIDR notation that is allowed to use delta sharing. ' | |||
'(can be specified multiple times).')) | |||
@click.option('--property', default=None, type=JsonClickType(), required=False, multiple=True, |
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.
Maybe --property key value
or --property key=value
would be easier for users than specifying a JSON each time.
https://stackoverflow.com/questions/51164033/python-click-multiple-key-value-pair-arguments
Though the benefit of the JSON is supporting multiple future properties, but are we planning on other properties to the JSON?
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.
Good idea. I changed it to be separated by the equal sign key=value
with a caveat that it won't support setting =
as part of the key or value which I think is probably fine.
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.
LGTM
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.
Couple remarks:
- Please name this
properties
to match what it's called at the API level. Why custom? - Please add a test for passing
x=y=z
to this argument to make it works. - Nit: please trim trailing whitespace. It adds diffs to future commits.
Codecov ReportBase: 75.76% // Head: 75.80% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #584 +/- ##
==========================================
+ Coverage 75.76% 75.80% +0.04%
==========================================
Files 55 55
Lines 4901 4922 +21
==========================================
+ Hits 3713 3731 +18
- Misses 1188 1191 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@pietern See some questions below.
Initially I named it
Added a test.
Dumb question: how do you identify all lines with trailing whitespaces? I can tell by either look at the github diff or the local code. |
Thanks! Yeah singular is better. Can you elaborate on the keyword redefine issue? |
@pietern If I use the name |
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 understand the issue with the keyword, but that doesn't mean we have to use "custom" in the name of the argument and the help texts. We should stick to the naming we use in the documentation. The variable can be named whatever works that isn't property
.
Otherwise a user may have questions such as:
- why can't I set properties, and only custom properties?
- what is the difference between properties and custom properties?
@pietern With the constraints of 1) can not override |
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.
Argument help was lagging the argument name. Replaced in suggestions.
Add
--property
param to both recipient create and update command following the pattern ofallowed_ip_address