Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Conversation

bbonaby
Copy link
Contributor

@bbonaby bbonaby commented Feb 27, 2024

Summary of the pull request

This PR updates the setup target flow to allow for the winget configure file generated by Dev Home
To be sent to an extension. The Extension then starts the configuration and provides Dev Home with the progress and completion details of the configuration:

1. Updated Clone repository flow to prevent Dev Drives from showing up when users are in the setup target flow
2. Updated the loading page and summary page to show progress of the remote winget configuration operation.
	a. Added ability for adaptive cards to appear in the loading screens action center

Updated adaptive cards sent from Hyper-v so the strings appear in the UI

Video soon:

References and relevant issues

Will need to change adaptive card theme when the theme in the UI changes. In dark mode the card doesn't look the nicest.

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@bbonaby bbonaby changed the title User/bbonaby/update environments setup Update setup target flow to allow for configuration of a dev environment. Feb 27, 2024
@bbonaby bbonaby marked this pull request as ready for review February 27, 2024 23:13

if (!string.IsNullOrEmpty(result.CommandOutputErrorMessage))
{
Logging.Logger()?.ReportWarn($"Unable to WindowsPSModulePath for the Hyper-V module location, Error: {result.CommandOutputErrorMessage}");
Copy link
Member

Choose a reason for hiding this comment

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

This sounds more like an error than warning. Hyper-V functionality won't work without Hyper-V module.
WindowsPSModulePath sounds confusing in the message is confusing. Maybe "Unable to install WindowsPSModulePath module ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this and removed it but left it as a warn for now. I figured it'll be best to just left the cmdlet throw the exception so we don't hide it.

Comment on lines 101 to 102
var hyperVManager = Host.GetService<IHyperVManager>();
hyperVManager.ImportHyperVModule();
Copy link
Member

Choose a reason for hiding this comment

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

Can we do this from HyperVManager itself (from constructor or lazy initialization whenever needed)? Doesn't look like clients of IHyperVManager need to know about that detail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed and provided a better work around. I'll need to investigate what happened between .Net 6 and .Net 8 in dev home that caused this. I created a test app with .Net 8 and PowerShell SDK 7.4.0 and it worked fine. So there is something weird with what we're doing in Dev Home. But I'll investigate it. For now I found that attempting to load it via Get-Module when the session starts and then using it again to get the list of available modules to find the module we want fixes the issue. This happened last minute unfortunately as we were using .Net 6 and PowerShell sdk 7.2.* before then

resultCode, resultInformation, new SDKApplyConfigurationSetResult(applyConfigSetResult), new SDKOpenConfigurationSetResult(openConfigResult, _stringResource));

// Check if there were errors while opening the configuration set.
if (!Result.OpenConfigSucceeded)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to check resultCode (or Result.ResultCode) first. The operation could fail before getting to OpenConfigurationSetResult.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll update these when we have the update sdk changes into main

Column = result.Column;
Value = result.Value.Clone() as string;
ResultCode = Result.ResultCode;
Succeeded = ResultCode != null && ResultCode.HResult == 0;
Copy link
Member

Choose a reason for hiding this comment

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

I think you had it right in SDKApplyConfigurationSetResult, if ResultCode is null it's succeeded:
(ResultCode == null || ResultCode?.HResult == 0)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated but will probably need to update it again once we have sdk changes into main

… new work around that doesn't involve installing using Install-Module which installs from PsGallery
@bbonaby bbonaby merged commit c4c71cf into microsoftfeature/dev-environments Mar 1, 2024
bbonaby added a commit that referenced this pull request Mar 7, 2024
* add initial SDK changes (#2209)

* Add UX code from private ADO branch to public feature branch (#2241)

* Add initial code from private branch that will be shared between the setup flow and the Dev environments tool page. PRs: from private ADO repo: https://dev.azure.com/microsoft/Dart/_git/DevHome?version=GBDevEnv

* add changes to the setup flow for dev environment configuration PRS: from private ADO repo: https://dev.azure.com/microsoft/Dart/_git/DevHome?version=GBDevEnv

* Add dev environments management tool page from private ADO repo: https://dev.azure.com/microsoft/Dart/_git/DevHome?version=GBDevEnv

* fix conflicts and stylecop errors due to update from merge with main

---------

Co-authored-by: Huzaifa Danish <modanish@microsoft.com>

* Move Hyper-V extension code from private repository to public dev environments feature branch (#2246)

* Add Hyper-v extension to Dev Home from Private Hyper-v extension branch: PRS https://github.com/microsoft/DevHomeHyperVExtension

* Merge changes from Dev Home main and fix style cop errors

* Initial implementation of IComputeSystem::ApplyConfiguration for HyperV extension. (#2258)

* Add environments to experimentation (#2260)

* Add PowerShell script and a helper class to deploy DevSetupAgent service to a Hyper-V VM. (#2261)

* Hyper-V extension: Add "Ask for VM credentials" and "Wait for logon" Adaptive Cards to Hyper-V Configure command. (#2289)

* Changes to make DevSetupEngine work with .NET 8 (#2308)

* Build DevSetupAgent separately from the main Dev Home solution and add DevSetupAgent_*.zip to MSIX package. (#2325)

* Add WaitForLogin and Credentials Adaptive Cards

* Address review comments.

* New VS solution for DevSetupAgent

* Add BuildDevSetupAgentHelper script

* Fix x86 DevSetupAgent to work on x64 OS.
Create DevSetupAgent zip for different VM architectures.
Fixed build scripts and HyperVExtension.csproj to include DevSetupAgent zip file into Dev Home MSIX package.

* Remove old comment.

* Fix a comment.

* Update setup target flow to allow for configuration of a dev environment. (#2321)

* initial code

* update messaging and adaptive cards

* remove added method

* update strings and names

* update based on initial comments and update IsHyperVModuleLoaded with new work around that doesn't involve installing using Install-Module which installs from PsGallery

* improve wording

* fix merge conflicts

* update dev environments feature branch with latest idl changes (#2334)

* update feature branch to latest sdk

* update InputJson to inputJson

* update with latest changes

* Update environments page UX (#2320)

* add updates to ui

* fix crashes due to resource name mismatch

* update feature branch to latest sdk

* update InputJson to inputJson

* update with latest changes

* update

* update to remove duplicate, resize shimmer, remove id from winget file since its not needed, and add comments

* Re-add correct adaptive host file for correct theming, address some initial comments, update loading page to allow scrolling when there are tasks and actions in the action center. Fix error message spelling.

* improve setup target loading page progress messaging

* Fix git clone's dependsOn Id to match our new Ids for setup target flow

* Update build scripts to build DevSetupAgent in Azure official build. (#2339)

* update dev home to use new SDK version and other projects to use win app sdk v1.5 to prevent build issues (#2344)

* Fix PS DevSetupAgent deployment script. (#2345)

* remove classes that don't need to be added

* Change all tabs to spaces

* Update tools directory to use crlf

* Update HyperVExtension directory to use crlf

* Update common/Environments directory to use crlf

* Update more in common directory to use crlf

* [Hyper-V extension]: Fixes for DevSetupEngine registration, Configure progress reporting, and GitHub build. (#2348)

* remove s that was added from a previous commit causing build to fail

* fix tests for build

* update malformed configuration string to allow arm64 to build

---------

Co-authored-by: Huzaifa Danish <modanish@microsoft.com>
Co-authored-by: sshilov7 <51001703+sshilov7@users.noreply.github.com>
Co-authored-by: Kristen Schau <47155823+krschau@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants