Skip to content
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 "Did You Mean This" Extension #1536

Closed
wants to merge 0 commits into from
Closed

Add "Did You Mean This" Extension #1536

wants to merge 0 commits into from

Conversation

christopher-o-toole
Copy link
Contributor

@christopher-o-toole christopher-o-toole commented Apr 14, 2020

New extension (in preview) which uses the Aladdin service to generate and show failure recovery recommendations on command failure. This extension makes use of the hook added to parser.py in CLI version 2.4.0. For more information, see this CLI PR.


This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

@christopher-o-toole christopher-o-toole changed the title ai-did-you-mean-this CLI Extension [WIP] ai-did-you-mean-this CLI Extension Apr 14, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Apr 14, 2020

ai

@yonzhan yonzhan added this to the S170 milestone Apr 29, 2020
@christopher-o-toole christopher-o-toole marked this pull request as ready for review May 8, 2020 03:30
@christopher-o-toole christopher-o-toole changed the title [WIP] ai-did-you-mean-this CLI Extension Add "Did You Mean This" Extension May 8, 2020
@yonzhan yonzhan requested review from jiasli and haroldrandom May 8, 2020 05:44
Comment on lines 11 to 15
with self.command_group('ai-did-you-mean-this') as g:
g.custom_command('version', 'show_extension_version')

with self.command_group('ai-did-you-mean-this', is_preview=True):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe combine them?

Suggested change
with self.command_group('ai-did-you-mean-this') as g:
g.custom_command('version', 'show_extension_version')
with self.command_group('ai-did-you-mean-this', is_preview=True):
pass
with self.command_group('ai-did-you-mean-this', is_preview=True) as g:
g.custom_command('version', 'show_extension_version')


Improve user experience by suggesting recovery options for common CLI failures.

This extension extends the default error handling behavior to include recommendations for recovery. Recommendations are based on how other users were successful after they encountered the same failure.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding some instructions and usage scenarios? Like what kind of error can trigger this extension.

Comment on lines 20 to 26
def should_enable_styling():
try:
if sys.stdout.isatty():
return True
except AttributeError:
pass
return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also honor the no_color setting: Azure/azure-cli#12601

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.

4 participants