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 Apr 16, 2024

Summary of the pull request

A Supplemental PR into Dev Home needs to be submitted first before checking this in: microsoft/devhome#2639

This PR adds DevBox creation UI to the Azure extension and changes the following:

  • Adds the CreationAdaptiveCardSession which Dev Home will interaction when presenting the user with an initial creation page and a review page. The initial page contains a textbox, a projects combo box and a pools combo box. When Dev Home requests the creation session if the project and pools have not been retrieved yet, we retrieve them and get the Dev Boxes before returning the session.
  • Data for the pools for all projects is retrieved and sent in the adaptive card payload back to Dev Home.
  • Dev Home will use this data to dynamically update the data for the pools combo box based on the selection within the projects combo box.
  • I've added two adaptive card templates CreationForm.json and ReviewForm.json. The first will be sent as the initial page. When the user selects the next button in Dev Home the review page will be sent. If the user selects the previous button the creation page will be sent. If the user is on the review page and selects next we capture their input, stop the session and send it back to Dev Home. Dev Home will them re-show the review page back to the user once creation of the Dev Box has begun.

Video of flow:

DevBoxCreationInDevHome.mp4

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

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

@bbonaby bbonaby marked this pull request as ready for review April 16, 2024 01:39
// See example Response: https://learn.microsoft.com/en-us/rest/api/devcenter/developer/dev-boxes/start-dev-box?view=rest-devcenter-developer-2023-04-01&tabs=HTTP
var operationId = Guid.Parse(operationLocation!.Segments.Last());

_log.Information($"Adding Dev Box '{DisplayName}' with to OperationMonitor");
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't make sense. Did you mean to add another variable here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea "with" should not be here, should just be "to"

public string PoolName { get; set; } = string.Empty;

public string DevBoxName { get; set; } = string.Empty;
public string NewEnvironmentName { get; set; } = string.Empty;
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: Should just use the consistent DevBox nomenclature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this is used because in Dev Home we have no way of know the name of the compute system the user is attempting to create based on the CreateComputeSystemOperation. See this comment in Dev Home where I explain it a bit more: https://github.com/microsoft/devhome/blob/4559792e7c6c0e62a4da32bbd32011c4fe4c4a20/common/Environments/Models/CreateComputeSystemOperation.cs#L69

public async Task<List<DevBoxProjectAndPoolContainer>> GetAllProjectsToPoolsMappingAsync(JsonElement projectsJson, IDeveloperId developerId)
public async Task<List<DevBoxProjectAndPoolContainer>> GetAllProjectsToPoolsMappingAsync(DevBoxProjects projects, IDeveloperId developerId)
{
var uniqueUserId = $"{developerId.LoginId}#{developerId.Url}";
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious: Why isn't the login id unique enough here and above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now that the azure extension supports multiple accounts, users can have the same email across multiple accounts. So using the login Url is added to make it more unique. It is a best practice suggested by Vineeth

</data>
<data name="DevBox_ReviewPageNameLabel" xml:space="preserve">
<value>Name{0}</value>
<comment>Label text for textbox where users will enter the name for their Dev Box</comment>
Copy link
Contributor

Choose a reason for hiding this comment

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

Should you add locked{0} here?

@bbonaby bbonaby merged commit e23cb27 into main Apr 17, 2024
@krschau krschau added this to the DHAE v0.8 milestone Apr 23, 2024
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.

5 participants