Skip to content

Commit

Permalink
Merge pull request #2122 from microsoft/staging
Browse files Browse the repository at this point in the history
Release - 1/10/24
  • Loading branch information
EricJohnson327 authored Jan 10, 2024
2 parents c609470 + b42327f commit 8f49970
Show file tree
Hide file tree
Showing 44 changed files with 672 additions and 200 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
![dev-home-readme-header](https://github.com/microsoft/devhome/blob/main/src/Assets/Preview/StoreDisplay-150.png)

# Welcome to the Dev Home repo
# Welcome to the Dev Home repo!

Dev Home is a new experience from Microsoft aiming to give developers more power on Windows.

This repository contains the source code for:

Expand All @@ -10,6 +12,7 @@ This repository contains the source code for:
Related repositories include:

* [Dev Home GitHub Extension](https://github.com/microsoft/devhomegithubextension)
* [Dev Home Azure Extension](https://github.com/microsoft/devhomeazureextension)

## Installing and running Dev Home

Expand Down
11 changes: 11 additions & 0 deletions TestingScenarios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Testing Scenarios
These are the testing scenarios that need to be validated before shipping a new release. When an automated test is added, please remove it from the below lists.

1. [Dev Home Core](test/TestingScenarios/DevHome.md)
1. [Dashboard](tools/Dashboard/DevHome.Dashboard.UnitTest/TestingScenarios/Dashboard.md)
1. [App Install](tools/SetupFlow/DevHome.SetupFlow.UnitTest/TestingScenarios/AppInstall.md)
1. [Repository](tools/SetupFlow/DevHome.SetupFlow.UnitTest/TestingScenarios/Repository.md)
1. [Config](tools/SetupFlow/DevHome.SetupFlow.UnitTest/TestingScenarios/Config.md)
1. [Dev Drive](tools/SetupFlow/DevHome.SetupFlow.UnitTest/TestingScenarios/DevDrive.md)
1. [Extension Library](tools/ExtensionLibrary/DevHome.ExtensionLibrary.UnitTest/TestingScenarios/ExtensionLibrary.md)
1. [Settings](settings/DevHome.Settings.UnitTest/TestingScenarios/Settings.md)
3 changes: 2 additions & 1 deletion ToolingVersions.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<TargetFramework>net6.0-windows10.0.22000.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.19045.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion>10.0.19045.0</SupportedOSPlatformVersion>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ parameters:

variables:
# MSIXVersion's second part should always be odd to account for stub app's version
MSIXVersion: '0.801'
MSIXVersion: '0.901'
VersionOfSDK: '0.100'
solution: '**/DevHome.sln'
appxPackageDir: 'AppxPackages'
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/CreateBuildInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Param(
)

$Major = "0"
$Minor = "8"
$Minor = "9"
$Patch = "99" # default to 99 for local builds

$versionSplit = $Version.Split(".");
Expand Down
4 changes: 2 additions & 2 deletions common/DevHome.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.100.254" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.100.369" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.Internal.Windows.DevHome.Helpers" Version="1.0.20230706-x2201" />
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
Expand Down
10 changes: 10 additions & 0 deletions common/Helpers/RuntimeHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

using System;
using Windows.Win32;
using Windows.Win32.Foundation;

Expand All @@ -17,4 +18,13 @@ public static bool IsMSIX
return PInvoke.GetCurrentPackageFullName(ref length, null) != WIN32_ERROR.APPMODEL_ERROR_NO_PACKAGE;
}
}

public static bool IsOnWindows11
{
get
{
var version = Environment.OSVersion.Version;
return version.Major >= 10 && version.Build >= 22000;
}
}
}
5 changes: 1 addition & 4 deletions common/Models/ExtensionAdaptiveCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ public ProviderOperationResult Update(string templateJson, string dataJson, stri
DataJson = dataJson ?? DataJson;
State = state ?? State;

if (UiUpdate is not null)
{
UiUpdate.Invoke(this, parseResult.AdaptiveCard);
}
UiUpdate?.Invoke(this, parseResult.AdaptiveCard);

return new ProviderOperationResult(ProviderOperationStatus.Success, null, "IExtensionAdaptiveCard.Update succeeds", "IExtensionAdaptiveCard.Update succeeds");
}
Expand Down
1 change: 1 addition & 0 deletions common/Services/IPackageDeploymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public interface IPackageDeploymentService
/// <summary>
/// Find packages for the current user. If maxVersion is specified, package versions must be
/// between minVersion and maxVersion. If maxVersion is null, packages must be above minVersion.
/// If no minVersion is specified, returns packages of any version.
/// </summary>
/// <returns>An IEnumerable containing the installed packages that meet the version criteria.</returns>
public IEnumerable<Package> FindPackagesForCurrentUser(string packageFamilyName, params (Version minVersion, Version? maxVersion)[] ranges);
Expand Down
10 changes: 9 additions & 1 deletion common/Services/PackageDeploymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ public IEnumerable<Package> FindPackagesForCurrentUser(string packageFamilyName,
var version = package.Id.Version;
var major = version.Major;
var minor = version.Minor;
var build = version.Build;
var revision = version.Revision;

Log.Logger()?.ReportInfo("PackageDeploymentService", $"Found package {package.Id.FullName}");

// Create System.Version type from PackageVersion to test. System.Version supports CompareTo() for easy comparisons.
if (IsVersionSupported(new (major, minor), ranges))
if (IsVersionSupported(new (major, minor, build, revision), ranges))
{
versionedPackages.Add(package);
}
Expand Down Expand Up @@ -79,6 +81,12 @@ public IEnumerable<Package> FindPackagesForCurrentUser(string packageFamilyName,

private bool IsVersionSupported(Version target, params (Version minVersion, Version? maxVersion)[] ranges)
{
// If a min version wasn't specified, any version is fine.
if (ranges.Length == 0)
{
return true;
}

foreach (var (minVersion, maxVersion) in ranges)
{
if (maxVersion == null)
Expand Down
20 changes: 19 additions & 1 deletion common/TelemetryEvents/DeveloperId/DeveloperIdHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Security.Cryptography;
using System.Security.Principal;
using System.Text;
using Microsoft.Windows.DevHome.SDK;

Expand All @@ -22,7 +23,24 @@ public static string GetHashedDeveloperId(string providerName, IDeveloperId devI
}

var hashedLoginIdString = BitConverter.ToString(hashedLoginId).Replace("-", string.Empty);
var hashedWindowsIdString = "UNKNOWN";

return $"{hashedLoginIdString}_{providerName}";
// Include Hashed WindowsId if available
var loginSessionId = WindowsIdentity.GetCurrent().Name;

if (loginSessionId != null)
{
loginIdBytes = Encoding.ASCII.GetBytes(loginSessionId);

hashedLoginId = hasher.ComputeHash(loginIdBytes);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(hashedLoginId);
}

hashedWindowsIdString = BitConverter.ToString(hashedLoginId).Replace("-", string.Empty);
}

return $"{hashedLoginIdString}_{hashedWindowsIdString}_{providerName}";
}
}
17 changes: 10 additions & 7 deletions common/Views/ExtensionAdaptiveCardPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using AdaptiveCards.ObjectModel.WinUI3;
using AdaptiveCards.Rendering.WinUI3;
using DevHome.Common.Models;
using DevHome.Logging;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
Expand All @@ -20,6 +21,8 @@ public class ExtensionAdaptiveCardPanel : StackPanel
{
public event EventHandler<FrameworkElement>? UiUpdate;

private RenderedAdaptiveCard? _renderedAdaptiveCard;

public void Bind(IExtensionAdaptiveCardSession extensionAdaptiveCardSession, AdaptiveCardRenderer? customRenderer)
{
var adaptiveCardRenderer = customRenderer ?? new AdaptiveCardRenderer();
Expand All @@ -36,22 +39,22 @@ public void Bind(IExtensionAdaptiveCardSession extensionAdaptiveCardSession, Ada
{
uiDispatcher.TryEnqueue(() =>
{
var renderedAdaptiveCard = adaptiveCardRenderer.RenderAdaptiveCard(adaptiveCard);
renderedAdaptiveCard.Action += async (RenderedAdaptiveCard? sender, AdaptiveActionEventArgs args) =>
_renderedAdaptiveCard = adaptiveCardRenderer.RenderAdaptiveCard(adaptiveCard);
_renderedAdaptiveCard.Action += async (RenderedAdaptiveCard? sender, AdaptiveActionEventArgs args) =>
{
GlobalLog.Logger?.ReportInfo($"RenderedAdaptiveCard.Action(): Called for {args.Action.Id}");
await extensionAdaptiveCardSession.OnAction(args.Action.ToJson().Stringify(), args.Inputs.AsJson().Stringify());
};
Children.Clear();
Children.Add(renderedAdaptiveCard.FrameworkElement);
Children.Add(_renderedAdaptiveCard.FrameworkElement);
if (this.UiUpdate != null)
{
this.UiUpdate.Invoke(this, renderedAdaptiveCard.FrameworkElement);
}
UiUpdate?.Invoke(this, _renderedAdaptiveCard.FrameworkElement);
GlobalLog.Logger?.ReportInfo($"ExtensionAdaptiveCard.UiUpdate(): Event handler for UiUpdate finished successfully");
});
};

extensionAdaptiveCardSession.Initialize(extensionUI);
GlobalLog.Logger?.ReportInfo($"ExtensionAdaptiveCardPanel.Bind(): Binding to AdaptiveCard session finished successfully");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<RootNamespace>Microsoft.Windows.DevHome.SDK</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<AppContainerApplication>true</AppContainerApplication>
<AppContainerApplication>false</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
<WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0.19041.0</WindowsTargetPlatformVersion>
Expand Down Expand Up @@ -96,6 +96,34 @@
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<DesktopCompatible>true</DesktopCompatible>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'">
<ClCompile>
<!-- We use MultiThreadedDebug, rather than MultiThreadedDebugDLL, to avoid DLL dependencies on VCRUNTIME140d.dll and MSVCP140d.dll. -->
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile>
<Link>
<!-- Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
lib and instead linking against the Universal CRT DLL import library. This "hybrid" linking mechanism is
supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
than they would otherwise be if the CRT, runtime, and STL were all statically linked in. -->
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries);libucrtd.lib</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>%(AdditionalOptions) /defaultlib:ucrtd.lib</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'">
<ClCompile>
<!-- We use MultiThreaded, rather than MultiThreadedDLL, to avoid DLL dependencies on VCRUNTIME140.dll and MSVCP140.dll. -->
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<!-- Link statically against the runtime and STL, but link dynamically against the CRT by ignoring the static CRT
lib and instead linking against the Universal CRT DLL import library. This "hybrid" linking mechanism is
supported according to the CRT maintainer. Dynamic linking against the CRT makes the binaries a bit smaller
than they would otherwise be if the CRT, runtime, and STL were all statically linked in. -->
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries);libucrt.lib</IgnoreSpecificDefaultLibraries>
<AdditionalOptions>%(AdditionalOptions) /defaultlib:ucrt.lib</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
Expand Down
12 changes: 12 additions & 0 deletions settings/DevHome.Settings.UnitTest/TestingScenarios/Settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Settings Tests
If your code affects the settings pages, please manually verify these scenarios.

## Scenarios
Please make sure to verify all these scenarios.

1. User can submit feedback via the feedback button
1. User can set the app theme
1. User can enable/disable an extension
1. User can add an account
1. User can remove an account
1. Disabled extensions do not show up when signing into an account
81 changes: 76 additions & 5 deletions settings/DevHome.Settings/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down Expand Up @@ -268,8 +327,8 @@
<comment>Opt into including experimentation information into your issue template</comment>
</data>
<data name="Settings_Feedback_ReportBug_IncludeExtensions.Content" xml:space="preserve">
<value>Include installed Dev Home extensions</value>
<comment>Opt into including information on extensions into your issue template</comment>
<value>Include installed Dev Home extensions and related packages</value>
<comment>Opt into including information on extensions and related packages into your issue template</comment>
</data>
<data name="Settings_Feedback_ReportBug_IncludeSystemInfo.Content" xml:space="preserve">
<value>Include my system information</value>
Expand All @@ -291,7 +350,7 @@
<value>Create an extension</value>
<comment>Creating a new extension</comment>
</data>
<data name="Settings_Feedback_BuildExtension_Button.Text" xml:space="preserve">
<data name="Settings_Feedback_BuildExtension_TextBlock.Text" xml:space="preserve">
<value>Learn more</value>
<comment>Description or instruction on building an extension</comment>
</data>
Expand Down Expand Up @@ -372,9 +431,9 @@
<value>Report a security vulnerability</value>
<comment>Tell us about potential security concerns</comment>
</data>
<data name="Settings_Feedback_ReportSecurity_Button.Text" xml:space="preserve">
<data name="Settings_Feedback_ReportSecurity_Button.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Learn more</value>
<comment>Click on this link if you want to learn more and read the security policy. View is an action.</comment>
<comment>Click on this link if you want to learn more and read the security policy. View is an action. Narrated by the narrator.</comment>
</data>
<data name="Settings_Feedback_LocalizationIssue_LanguageAffected.Header" xml:space="preserve">
<value>Language</value>
Expand Down Expand Up @@ -452,6 +511,10 @@
<value>Extensions</value>
<comment>Label for displaying device's installed extensions</comment>
</data>
<data name="Settings_Feedback_WidgetService" xml:space="preserve">
<value>Widget Service</value>
<comment>Label for displaying device's installed widget service</comment>
</data>
<data name="Settings_Accounts_NoProvidersContentDialog_SecondaryButtonText" xml:space="preserve">
<value>Cancel</value>
</data>
Expand All @@ -467,4 +530,12 @@
<value>There are currently no experimental features</value>
<comment>Message shown when there are no available experimental features</comment>
</data>
<data name="Settings_Feedback_BuildExtension_Button.[using:Microsoft.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Learn more</value>
<comment>Description or instruction on building an extension. Narrated by the narrator.</comment>
</data>
<data name="Settings_Feedback_ReportSecurity_TextBlock.Text" xml:space="preserve">
<value>Learn more</value>
<comment>Click on this link if you want to learn more and read the security policy. View is an action.</comment>
</data>
</root>
Loading

0 comments on commit 8f49970

Please sign in to comment.