-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Add Deprecation support #6472
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
Add Deprecation support #6472
Conversation
|
Please take a look at the CI. |
|
Many versions in setup.py will need to be updated once the 2.0.34 is released to the PyPI. |
Codecov Report
@@ Coverage Diff @@
## dev #6472 +/- ##
===================================
Coverage 0% 0%
===================================
Files 11 11
Lines 145 145
Branches 11 11
===================================
Misses 145 145Continue to review full report at Codecov.
|
|
@williexu @troydai @yugangw-msft please take a look. |
|
@tjprescott I'm assuming interactive won't break when encountering deprecated items, at least. Out of curiosity, what is the behavior for deprecated commands/args/etc. |
|
Yes, I made sure interactive didn't crash. They run just like normal. |
tools/automation/cli_linter/util.py
Outdated
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.
Can you also delete the groups from the loader's command_group_table here?
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.
Done
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.
This return will be reached, probably intended to return the list if there are options in 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 was dead code. Removed.
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.
Why the switch from using get_parameter_options?
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.
No idea. Reverted.
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.
Can you add the command_table and command_group_table as hidden fields, or let them be accessed from the loader? They should not be exposed easily. These properties should just have the command/group names, which can be referenced from the table keys.
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 changed them to just return the keys. Now I use the get_metadata methods.
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.
Are these get-metadata methods used anywhere?
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.
No, though it seems they do what you were asking for above. Now that the commands and command_groups properties just return keys, I use this.
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.
Are we no longer limiting the kwargs being merged?
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.
Instead of raising an error (some unsupported kwargs may be in a kwarg bundle), on the next line we simply gather up the supported args.
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.
travis, can you explain this? was this moved from somewhere else?
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.
This was copied from the base knack implementation and essentially cuts out where the old-style deprecation messages were displayed in knack. In the future I could remove that code (potentially) from knack and then just rely on the base implementation.
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.
We didn't use this method?
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.
show_help reverted to the knack implementation. print_detailed_help was changed at the knack and az level to be a regular method, not a class method.
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.
Can you explain what the bug was that caused this to be needed?
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 think this is just ensuring that all help will end in a proper "stopping" punctuation mark.
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 shouldn't be necessary and works just fine without this on Python 3. But for whatever reason, stupid Python 2.7 ends up looking into the SDK docstring, finds some non-ASCII character, and crashes. Not wanting to invest a lot of time into the philosophical question of why Python 2.7 is such crap, I just went with this.
doc/sphinx/azhelpgen/azhelpgen.py
Outdated
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.
These probably should be removed.
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.
Removed. Debugging remnants.
|
@williexu comments addressed. Please take another look. |
tools/automation/cli_linter/util.py
Outdated
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 I'm seeing this wrong but are you deleting all the groups in the table...?
It should only be the ones from the selected modules/extensions.
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, you're right. Fixed. However, this will not exclude orphan help file entries (botservice has some).
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.
logging.warning will call str on the argument for you
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.
is it certain that args will have at least one element?
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.
Yes. It is the same in knack.
tools/automation/cli_linter/util.py
Outdated
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.
This is inside a for loop over all the commands in the command_table.
Please move this outside the for loop
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 catch. Thought I had done that!
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.
Done
Closes #5954. Closes #5968. Closes #6059.
Deprecates (hides) the
monitor autoscale-settingscommands as well as the previously deprecated commands inredis:import-method,update-settings,list-all, and thepatch-schedule patch-schedulegroup.To be done:
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).
I adhere to the Command Guidelines.