-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
7056: AzureConnection - if preferred cloud shell wasn't set let the user choose rather than crashing #8204
Conversation
{ | ||
_WriteStringWithNewline(_formatShell(i, shells[i])); | ||
_WriteStringWithNewline(_formatShell(i, gsl::at(shells, i))); |
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 nuanced, but for places where we know we're in-bounds we can use til::at
. gsl::at
does a bounds check 😄 which we don't need 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.
Thanks! :) I was looking for it 😊 Fixing it.
Hey this one's no longer relevant with #8197 having merged, right? |
Summary of the Pull Request
This is an alternative implementation for #8197.
In rare occurrences, the shell settings might exist, but have no preferred shell configured.
Usually this will happen if the setting were created with old version of the cloud shell API.
Currently, we crash in such scenarios while trying to read a non-existing value.
This PR allows handles such cases by letting the user choose between PowerShell and Bash.
References
See #8197 for alternative solution (that simply fails the connection with informative message).
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed