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

Commit 862d7c5

Browse files
Merge pull request #158 from microsoft/main
Staging - 4/17/24
2 parents ac531b4 + e23cb27 commit 862d7c5

27 files changed

Lines changed: 1613 additions & 66 deletions

build/azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ parameters:
2020
- release
2121

2222
variables:
23-
MSIXVersion: '0.700'
23+
MSIXVersion: '0.800'
2424
solution: '**/DevHomeAzureExtension.sln'
2525
appxPackageDir: 'AppxPackages'
2626
testOutputArtifactDir: 'TestResults'

build/scripts/CreateBuildInfo.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Param(
55
)
66

77
$Major = "0"
8-
$Minor = "7"
8+
$Minor = "8"
99
$Patch = "99" # default to 99 for local builds
1010

1111
$versionSplit = $Version.Split(".");

src/AzureExtension/AzureExtension.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
<Content Include="Widgets\Templates\AzureSignInTemplate.json">
4646
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
4747
</Content>
48+
<Content Include="DevBox\Templates\CreationForm.json">
49+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
50+
</Content>
51+
<Content Include="DevBox\Templates\ReviewForm.json">
52+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
53+
</Content>
4854
</ItemGroup>
4955

5056
<ItemGroup>
@@ -58,7 +64,7 @@
5864
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
5965
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.2.206-beta" />
6066
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
61-
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.300.443" />
67+
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.400.460" />
6268
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240227000" />
6369
<PackageReference Include="Microsoft.TeamFoundationServer.Client" Version="16.205.1" />
6470
<PackageReference Include="Microsoft.VisualStudio.Services.Client" Version="16.205.1" />
@@ -71,6 +77,7 @@
7177
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
7278
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
7379
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
80+
<PackageReference Include="YamlDotNet" Version="15.1.2" />
7481
</ItemGroup>
7582

7683
<ItemGroup>

src/AzureExtension/Contracts/IDevBoxManagementService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using System.Text.Json;
5+
using AzureExtension.DevBox.DevBoxJsonToCsClasses;
56
using AzureExtension.DevBox.Models;
67
using Microsoft.Windows.DevHome.SDK;
78

@@ -32,10 +33,10 @@ public interface IDevBoxManagementService
3233
/// <summary>
3334
/// Generates a list of objects that each contain a Dev Center project and the Dev Box pools associated with that project.
3435
/// </summary>
35-
/// <param name="projectsJson">The Json recieved from a rest api that returns a list of Dev Center projects.</param>
36+
/// <param name="projects">The Deserialized Json recieved from a rest api that returns a list of Dev Center projects.</param>
3637
/// <param name="developerId">The DeveloperId associated with the request.</param>
3738
/// <returns>A list of objects where each contain a project and its associated pools.</returns>
38-
public Task<List<DevBoxProjectAndPoolContainer>> GetAllProjectsToPoolsMappingAsync(JsonElement projectsJson, IDeveloperId developerId);
39+
public Task<List<DevBoxProjectAndPoolContainer>> GetAllProjectsToPoolsMappingAsync(DevBoxProjects projects, IDeveloperId developerId);
3940

4041
/// <summary>
4142
/// Initiates a call to create a Dev Box in the Dev Center.

src/AzureExtension/Contracts/IPackagesService.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33

44
namespace AzureExtension.Contracts;
55

6+
using Windows.ApplicationModel;
7+
68
public interface IPackagesService
79
{
810
public bool IsPackageInstalled(string packageName);
11+
12+
public PackageVersion GetPackageInstalledVersion(string packageName);
913
}

src/AzureExtension/DataManager/AzureDataManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public partial class AzureDataManager : IAzureDataManager, IDisposable
4040
public static readonly int PullRequestResultLimit = 25;
4141

4242
// Max number of query results to fetch for a given query.
43-
public static readonly int QueryResultLimit = 25;
43+
public static readonly int QueryResultLimit = 26;
4444

4545
// Most data that has not been updated within this time will be removed.
4646
private static readonly TimeSpan DataRetentionTime = TimeSpan.FromDays(1);
@@ -327,7 +327,6 @@ private async Task UpdateDataForQueriesAsync(DataStoreOperationParameters parame
327327
}
328328

329329
var queryId = new Guid(azureUri.Query);
330-
var count = await witClient.GetQueryResultCountAsync(project.Name, queryId);
331330
var queryResult = await witClient.QueryByIdAsync(project.InternalId, queryId);
332331
if (queryResult == null)
333332
{
@@ -481,7 +480,7 @@ private async Task UpdateDataForQueriesAsync(DataStoreOperationParameters parame
481480
};
482481

483482
var serializedJson = JsonSerializer.Serialize(workItemsObj, serializerOptions);
484-
Query.GetOrCreate(DataStore, azureUri.Query, project.Id, parameters.DeveloperId.LoginId, getQueryResult.Name, serializedJson, count);
483+
Query.GetOrCreate(DataStore, azureUri.Query, project.Id, parameters.DeveloperId.LoginId, getQueryResult.Name, serializedJson, workItemIds.Count);
485484
} // Foreach AzureUri
486485

487486
return;

src/AzureExtension/DevBox/Constants.cs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ public static class Constants
2121
public const string ARGQuery = "{\"query\": \"Resources | where type in~ ('microsoft.devcenter/projects') | where properties['provisioningState'] =~ 'Succeeded' | project id, location, tenantId, name, properties, type\"," +
2222
" \"options\":{\"allowPartialScopes\":true}}";
2323

24+
/// <summary>
25+
/// API version used for enumeration and start, stop, and restart APIs
26+
/// </summary>
27+
/// For stable api's <seealso href="https://learn.microsoft.com/rest/api/devcenter/developer/dev-boxes?view=rest-devcenter-developer-2023-04-01"/>
28+
/// for preview api's <seealso cref="https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devcenter/data-plane/Microsoft.DevCenter/preview"/>
29+
public const string APIVersion = "api-version=2024-05-01-preview";
30+
2431
/// <summary>
2532
/// DevCenter API to get all devboxes
2633
/// </summary>
@@ -32,6 +39,11 @@ public static class Constants
3239

3340
public const string OperationsParameter = "operations";
3441

42+
/// <summary>
43+
/// Dev Box API to run the winget customization task
44+
/// </summary>
45+
public const string CustomizationAPI = "/customizationgroups/AzureExt";
46+
3547
/// <summary>
3648
/// Gets the Regex pattern for the name of a DevBox. This pattern is used to validate the name and the project name of a DevBox before attempting
3749
/// to create it.
@@ -50,13 +62,6 @@ public static class Constants
5062
/// </summary>
5163
public const string ManagementPlaneScope = "https://management.azure.com/user_impersonation";
5264

53-
/// <summary>
54-
/// API version used for enumeration and start, stop, and restart APIs
55-
/// </summary>
56-
/// For stable api's <seealso href="https://learn.microsoft.com/rest/api/devcenter/developer/dev-boxes?view=rest-devcenter-developer-2023-04-01"/>
57-
/// for preview api's <seealso cref="https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devcenter/data-plane/Microsoft.DevCenter/preview"/>
58-
public const string APIVersion = "api-version=2024-05-01-preview";
59-
6065
public const string Pools = "pools";
6166

6267
public const string Projects = "projects";
@@ -76,7 +81,7 @@ public static class Constants
7681

7782
public static readonly TimeSpan OneMinutePeriod = TimeSpan.FromMinutes(1);
7883

79-
public static readonly TimeSpan FiveMinutePeriod = TimeSpan.FromMinutes(5);
84+
public static readonly TimeSpan ThreeMinutePeriod = TimeSpan.FromMinutes(3);
8085

8186
public static readonly TimeSpan OperationDeadline = TimeSpan.FromHours(2);
8287

@@ -109,6 +114,8 @@ public static class DevBoxProvisioningStates
109114
public const string Deleting = "Deleting";
110115

111116
public const string Updating = "Updating";
117+
118+
public const string Deleted = "Deleted";
112119
}
113120

114121
public static class DevBoxActionStates

0 commit comments

Comments
 (0)