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

Make sure to copy connectionType for the azure shell #12147

Merged
1 commit merged into from
Jan 12, 2022

Conversation

zadjii-msft
Copy link
Member

This was a simple oversight. No user profile ever has connectionType set, because why would they. So even for the Azure Shell, which needed this, the check would fail and we'd forget to duplicate the connectionType to the new profile.

@ghost ghost added Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Area-Settings Issues related to settings and customizability, for console or terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-2 A description (P2) Product-Terminal The new Windows Terminal. labels Jan 12, 2022
@zadjii-msft zadjii-msft added the Needs-Second It's a PR that needs another sign-off label Jan 12, 2022
Comment on lines +354 to 357
if (source.ConnectionType() != winrt::guid{})
{
duplicated->ConnectionType(source.ConnectionType());
}
Copy link
Member

Choose a reason for hiding this comment

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

In Go you have this idiom where you write:

if foo := bar(); foo != 123 {
    baz(foo);
}

You can write the same in C++:

 if (const auto type = source.ConnectionType(); type != winrt::guid{})
{
    duplicated->ConnectionType(type);
}

I personally find this idiom quite fitting for such situations.

Copy link
Member

Choose a reason for hiding this comment

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

indeed!

@DHowett
Copy link
Member

DHowett commented Jan 12, 2022

@msftbot merge this in 5 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 12, 2022
@ghost
Copy link

ghost commented Jan 12, 2022

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Wed, 12 Jan 2022 18:37:11 GMT, which is in 5 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit eb83469 into main Jan 12, 2022
@ghost ghost deleted the dev/migrie/b/12120-duplicate-azure branch January 12, 2022 18:38
@DHowett DHowett added the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label Jan 21, 2022
DHowett pushed a commit that referenced this pull request Jan 21, 2022
This was a simple oversight. No user profile ever has `connectionType` set, because why would they. So even for the Azure Shell, which needed this, the check would fail and we'd forget to duplicate the connectionType to the new profile.

* [x] I work here
* [x] Closes #12120
* [x] Tested manually

(cherry picked from commit eb83469)
@DHowett DHowett removed the zPreview-Service-Queued-1.13 A floating label that tracks the current Preview version for servicing purposes. label Jan 26, 2022
@ghost
Copy link

ghost commented Feb 3, 2022

🎉Windows Terminal Preview v1.13.10336.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AzureShell Workitems pertaining to the Azure Cloud Shell connection. Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Second It's a PR that needs another sign-off Priority-2 A description (P2) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to duplicate Azure Cloud Shell Profile
5 participants