-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge feature/fileexplorer-sourcecontrol-integration into main (#3542)
**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
1 parent
b7a5328
commit 2bdfae1
Showing
64 changed files
with
3,439 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationHelper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/SourceControlIntegration/SourceControlIntegrationUserEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...tExtension/FileExplorerGitIntegration.UnitTest/FileExplorerGitIntegration.UnitTest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.