Skip to content

Commit

Permalink
Merge feature/fileexplorer-sourcecontrol-integration into main (#3542)
Browse files Browse the repository at this point in the history
**Summary of the pull request**
This PR contains implementation changes for the File Explorer Source Control Integration experimental feature. This feature will allow File Explorer to obtain property information from source control technologies for display (image attached below):

**Detailed description of the pull request / Additional comments**
This PR contains the following changes:
- Reference official Dev Home SDK version (that defines APIs for File Explorer Source Control Integration)
- Declare FileExplorerSourceControlIntegration as an experimental feature
- The FileExplorerSourceControlIntegration project which creates a COM Server used to communicate information with File Explorer
- The FileExplorerGitIntegration project which allows Dev Home to come with an inbox extension that understands git
- Basic Unit Tests

**Detailed description of the pull request / Additional comments**
This PR contains the following changes:
- Reference official Dev Home SDK version (that defines APIs for File Explorer Source Control Integration)
- Declare FileExplorerSourceControlIntegration as an experimental feature
- The FileExplorerSourceControlIntegration project which creates a COM Server used to communicate information with File Explorer
- The FileExplorerGitIntegration project which allows Dev Home to come with an inbox extension that understands git
- Basic Unit Tests

Co-authored-by: Ryan Shepherd <ryansh@microsoft.com>
  • Loading branch information
ssparach and DefaultRyan authored Aug 6, 2024
1 parent b7a5328 commit 2bdfae1
Show file tree
Hide file tree
Showing 64 changed files with 3,439 additions and 14 deletions.
87 changes: 87 additions & 0 deletions DevHome.sln
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WSLExtension", "WSLExtensio
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WSLExtension", "extensions\WSLExtension\WSLExtension.csproj", "{B6153EEA-EADE-4BAA-B47D-6B48205C6696}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileExplorerGitIntegration", "extensions\GitExtension\FileExplorerGitIntegration\FileExplorerGitIntegration.csproj", "{5366F178-AD59-475C-B78D-2E6483313F9E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitExtension", "GitExtension", "{01AB3100-A939-41DD-A67F-1F8C275A307D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FileExplorerGitIntegration.UnitTest", "extensions\GitExtension\FileExplorerGitIntegration.UnitTest\FileExplorerGitIntegration.UnitTest.csproj", "{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.FileExplorerSourceControlIntegration", "tools\Customization\DevHome.FileExplorerSourceControlIntegration\DevHome.FileExplorerSourceControlIntegration.csproj", "{83D12033-364A-45F2-8FCA-9BD8E8322D91}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.FileExplorerSourceControlIntegrationUnitTest", "tools\Customization\DevHome.FileExplorerSourceControlIntegrationUnitTest\DevHome.FileExplorerSourceControlIntegrationUnitTest.csproj", "{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_FailFast|arm64 = Debug_FailFast|arm64
Expand Down Expand Up @@ -1079,6 +1089,78 @@ Global
{B6153EEA-EADE-4BAA-B47D-6B48205C6696}.Release|x64.Build.0 = Release|x64
{B6153EEA-EADE-4BAA-B47D-6B48205C6696}.Release|x86.ActiveCfg = Release|x86
{B6153EEA-EADE-4BAA-B47D-6B48205C6696}.Release|x86.Build.0 = Release|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|arm64.ActiveCfg = Debug|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|arm64.Build.0 = Debug|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|x64.ActiveCfg = Debug|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|x64.Build.0 = Debug|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|x86.ActiveCfg = Debug|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug_FailFast|x86.Build.0 = Debug|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|arm64.ActiveCfg = Debug|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|arm64.Build.0 = Debug|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|x64.ActiveCfg = Debug|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|x64.Build.0 = Debug|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|x86.ActiveCfg = Debug|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Debug|x86.Build.0 = Debug|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|arm64.ActiveCfg = Release|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|arm64.Build.0 = Release|arm64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|x64.ActiveCfg = Release|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|x64.Build.0 = Release|x64
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|x86.ActiveCfg = Release|x86
{5366F178-AD59-475C-B78D-2E6483313F9E}.Release|x86.Build.0 = Release|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|arm64.ActiveCfg = Debug|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|arm64.Build.0 = Debug|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|x64.ActiveCfg = Debug|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|x64.Build.0 = Debug|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|x86.ActiveCfg = Debug|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug_FailFast|x86.Build.0 = Debug|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|arm64.ActiveCfg = Debug|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|arm64.Build.0 = Debug|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|x64.ActiveCfg = Debug|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|x64.Build.0 = Debug|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|x86.ActiveCfg = Debug|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Debug|x86.Build.0 = Debug|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|arm64.ActiveCfg = Release|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|arm64.Build.0 = Release|arm64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|x64.ActiveCfg = Release|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|x64.Build.0 = Release|x64
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|x86.ActiveCfg = Release|x86
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E}.Release|x86.Build.0 = Release|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|arm64.ActiveCfg = Debug|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|arm64.Build.0 = Debug|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|x64.ActiveCfg = Debug|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|x64.Build.0 = Debug|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|x86.ActiveCfg = Debug|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug_FailFast|x86.Build.0 = Debug|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|arm64.ActiveCfg = Debug|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|arm64.Build.0 = Debug|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|x64.ActiveCfg = Debug|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|x64.Build.0 = Debug|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|x86.ActiveCfg = Debug|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Debug|x86.Build.0 = Debug|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|arm64.ActiveCfg = Release|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|arm64.Build.0 = Release|arm64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|x64.ActiveCfg = Release|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|x64.Build.0 = Release|x64
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|x86.ActiveCfg = Release|x86
{83D12033-364A-45F2-8FCA-9BD8E8322D91}.Release|x86.Build.0 = Release|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|arm64.ActiveCfg = Debug|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|arm64.Build.0 = Debug|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|x64.ActiveCfg = Debug|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|x64.Build.0 = Debug|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|x86.ActiveCfg = Debug|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug_FailFast|x86.Build.0 = Debug|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|arm64.ActiveCfg = Debug|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|arm64.Build.0 = Debug|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|x64.ActiveCfg = Debug|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|x64.Build.0 = Debug|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|x86.ActiveCfg = Debug|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Debug|x86.Build.0 = Debug|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|arm64.ActiveCfg = Release|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|arm64.Build.0 = Release|arm64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x64.ActiveCfg = Release|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x64.Build.0 = Release|x64
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x86.ActiveCfg = Release|x86
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1141,6 +1223,11 @@ Global
{D7A1C2CE-36B1-43A8-9BA6-1EE2CF24479F} = {E0A15760-487A-4CCB-8093-DE6FF3C4BC23}
{73D1E84F-56CC-412B-BF2B-FA692BF6B396} = {DCAF188B-60C3-4EDB-8049-BAA927FBCD7D}
{B6153EEA-EADE-4BAA-B47D-6B48205C6696} = {73D1E84F-56CC-412B-BF2B-FA692BF6B396}
{5366F178-AD59-475C-B78D-2E6483313F9E} = {01AB3100-A939-41DD-A67F-1F8C275A307D}
{01AB3100-A939-41DD-A67F-1F8C275A307D} = {DCAF188B-60C3-4EDB-8049-BAA927FBCD7D}
{8C1C7BF8-B27B-4F4D-97E5-A16E02C7860E} = {01AB3100-A939-41DD-A67F-1F8C275A307D}
{83D12033-364A-45F2-8FCA-9BD8E8322D91} = {623998FD-B0A6-4980-95D5-A5072301CA10}
{A1FAE679-39D4-4278-A8E8-EA351F21A3E7} = {623998FD-B0A6-4980-95D5-A5072301CA10}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {030B5641-B206-46BB-BF71-36FF009088FA}
Expand Down
3 changes: 2 additions & 1 deletion common/DevHome.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@
<PackageReference Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.1.240328-rc" />
<PackageReference Include="CommunityToolkit.WinUI.Converters" Version="8.1.240328-rc" />
<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.0.240109" />
<PackageReference Include="LibGit2Sharp" Version="0.30.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Internal.Windows.DevHome.Helpers" Version="1.0.20240709-x2135" />
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.600.494" />
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.700.544" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down
12 changes: 12 additions & 0 deletions common/Helpers/CommonConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,26 @@ public static class CommonConstants
public const string HyperVExtensionClassId = "6B219EF0-E238-434C-952E-4DF3D452AC83";

public const string WSLExtensionClassId = "EF2342AC-FF53-433D-9EDE-D395500F3B3E";

public const string GitExtensionClassId = "A65E46FF-F979-480d-A379-1FDA3EB5F7C5";

public const string SourceControlServerClassId = "8DDE51FC-3AE8-4880-BD85-CA57DF7E2889";
#elif STABLE_BUILD
public const string HyperVExtensionClassId = "F8B26528-976A-488C-9B40-7198FB425C9E";

public const string WSLExtensionClassId = "121253AB-BA5D-4E73-99CF-25A2CB8BF173";

public const string GitExtensionClassId = "8A962CBD-530D-4195-8FE3-F0DF3FDDF128";

public const string SourceControlServerClassId = "1212F95B-257E-414e-B44F-F26634BD2627";
#else
public const string HyperVExtensionClassId = "28DD4098-162D-483C-9ED0-FB3887A22F61";

public const string WSLExtensionClassId = "7F572DC5-F40E-440F-B660-F579168B69B8";

public const string GitExtensionClassId = "BDA76685-E749-4f09-8F13-C466D0802DA1";

public const string SourceControlServerClassId = "40FE4D6E-C9A0-48b4-A83E-AAA1D002C0D5";
#endif

public const string HyperVWindowsOptionalFeatureName = "Microsoft-Hyper-V";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Diagnostics.Tracing;
using DevHome.Telemetry;
using Microsoft.Diagnostics.Telemetry;
using Microsoft.Diagnostics.Telemetry.Internal;

namespace DevHome.Common.TelemetryEvents.SourceControlIntegration;

[EventData]
public class SourceControlIntegrationEvent : EventBase
{
public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServicePerformance;

public string RepositoryRootPath
{
get;
}

public int TrackedRepositoryCount
{
get;
}

public SourceControlIntegrationEvent(string sourceControlProviderClassId, string repositoryRootPath, int trackedRepositoryCount)
{
RepositoryRootPath = SourceControlIntegrationHelper.GetSafeRootPath(repositoryRootPath);
TrackedRepositoryCount = trackedRepositoryCount;
}

public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings)
{
// The only sensitive strings is the repository root path. GetSafeRootPath is used to potentially remove PII and
// keep last part of path.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.IO;
using System.Linq;

namespace DevHome.Common.TelemetryEvents.SourceControlIntegration;

public static class SourceControlIntegrationHelper
{
public static string GetSafeRootPath(string rootPath)
{
var parts = rootPath.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries);
return parts.LastOrDefault() ?? string.Empty;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Diagnostics.Tracing;
using DevHome.Telemetry;
using Microsoft.Diagnostics.Telemetry;
using Microsoft.Diagnostics.Telemetry.Internal;

namespace DevHome.Common.TelemetryEvents.SourceControlIntegration;

[EventData]
public class SourceControlIntegrationUserEvent : EventBase
{
public override PartA_PrivTags PartA_PrivTags => PrivTags.ProductAndServicePerformance;

public string RepositoryRootPath
{
get;
}

public int TrackedRepositoryCount
{
get;
}

public SourceControlIntegrationUserEvent(string sourceControlProviderClassId, string repositoryRootPath, int trackedRepositoryCount)
{
RepositoryRootPath = SourceControlIntegrationHelper.GetSafeRootPath(repositoryRootPath);
TrackedRepositoryCount = trackedRepositoryCount;
}

public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings)
{
// The only sensitive strings is the repository root path. GetSafeRootPath is used to potentially remove PII and
// keep last part of path.
}
}
2 changes: 2 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ graph TD;
DevHome.SetupFlow.ElevatedComponent.Projection-->DevHome.SetupFlow;
CoreWidgetProvider-->DevHome;
HyperVExtensionServer-->DevHome;
FileExplorerGitIntegration-->DevHome;
DevHome.Common-->DevHome;
DevHome.Customization-->DevHome;
DevHome.Dashboard-->DevHome;
Expand All @@ -42,6 +43,7 @@ graph TD;
DevHome.Services.DesiredStateConfiguration-->DevHome.SetupFlow;
DevHome.Services.WindowsPackageManager-->DevHome.SetupFlow.ElevatedComponent;
DevHome.Services.DesiredStateConfiguration-->DevHome.SetupFlow.ElevatedComponent;
DevHome.FileExplorerSourceControlIntegration-->DevHome.Customization;
DevHome.QuietBackgroundProcesses.ElevatedServer.Projection-->DevHome.Settings;
```

Expand Down
2 changes: 1 addition & 1 deletion extensions/CoreWidgetProvider/CoreWidgetProvider.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.106">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.600.494" />
<PackageReference Include="Microsoft.Windows.DevHome.SDK" Version="0.700.544"/>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)ToolingVersions.props" />
<PropertyGroup>
<RootNamespace>FileExplorerGitIntegration.UnitTest</RootNamespace>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<UseWinUI>true</UseWinUI>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<ProjectPriFileName>resources.pri</ProjectPriFileName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FileExplorerGitIntegration\FileExplorerGitIntegration.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 2bdfae1

Please sign in to comment.