Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge feature/fileexplorer-sourcecontrol-integration into main #3542

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ssparach
Copy link
Contributor

@ssparach ssparach commented Aug 5, 2024

Summary of the pull request

This PR adds the File Explorer Source Control Integration functionality to DevHome (as an experimental feature). This functionality allows a user to add a repository path inside DevHome for which the user can then view source control metadata (such as commit author, file status etc.) inside File Explorer

References and relevant issues

Detailed description of the pull request / Additional comments

Below is a brief summary of the changes made:

- DevHome Git Extension

  • Inbox extension that uses libgit2sharp to obtain information (such as last commit date, last commit author etc.)
  • GVFS repo compatibility: Use git.exe (if found on user machine) to obtain repository status for GVFS repos
  • Caching improvements for faster information retrieval

- File Explorer Source Control Integration Project

  • COM Server used to relay source control property information to File Explorer from the extensions
  • Also responsible for tracking the repositories added for this functionality and the source control extension assigned to obtain information

- DevHome.Customization

UX to add repositories inside Dev Home and choose source control extension
image

The PR also adds unit tests, logging and telemetry

Validation steps performed

MSIX build
Manual testing inside VM
Unit testing

PR checklist

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

ssparach and others added 17 commits July 31, 2024 13:29
**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

**Validation steps performed**
SDK and MSIX local builds
Tested Git Integration File Explorer behavior inside VM

Related work items: #48431506
…ntrol extensions inside Dev Home (#2984)

* changes to write/read data (extension information + root path) from json

* address PR comments

* revert line endings

* address PR comments
* fix

* move nullable property in csproj

* fix format
* declare appextension for git, find all source control extensions, UI changes, SDK changes, get extension information to use for mapping

* changes to map extension to registered root paths, add validation to git implementation

* changes after testing

* use serilog in validation code

* reorder using

* use published SDK version

* address PR feedback

* address PR feedback

* address PR feedback

* Minor cleanup of RepositoryTracking.cs

---------

Co-authored-by: Ryan Shepherd <[email protected]>
* detect git and invoke functionality

* address PR comments

* address PR feedback

* address style comments
* WARP SPEED COMMIT HISTORY. Rooted out and worked around a major bottleneck inside LibGit2Sharp

* Better status

* Introduce RepositoryWrapper to lock access to Repository

* Update unit test to reflect new repo status

* Check cache before calling Repository.IsValid
…inside Dev Home (#3484)

* proposed telemetry changes for add/remove repository

* remove unrequired using statements

* address PR feedback

* address PR feedback

* adjust comment

* add count of repos tracked inside Dev Home to event
* reset branch to 548d868

* Revert "reset branch to 548d868"

This reverts commit f30055f.

* Merged PR 10695071: Move to feature branch in preparation for GitHub

**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

**Validation steps performed**
SDK and MSIX local builds
Tested Git Integration File Explorer behavior inside VM

Related work items: #48431506

* Mapping of extensions to repository paths in DevHome core (#3230)

* declare appextension for git, find all source control extensions, UI changes, SDK changes, get extension information to use for mapping

* changes to map extension to registered root paths, add validation to git implementation

* changes after testing

* use serilog in validation code

* reorder using

* use published SDK version

* address PR feedback

* address PR feedback

* address PR feedback

* Minor cleanup of RepositoryTracking.cs

---------

Co-authored-by: Ryan Shepherd <[email protected]>

* save state

* save state

* save state

* save state

* save state

* implement button actions

* changes

* address PR feedback

* address PR feedback

* rebased user branch, made fixes, validated functionality on VM

* cleanup UI changes, tested on VM

* fix proj references to match dev home feed and unblock PR pipeline

---------

Co-authored-by: Ryan Shepherd <[email protected]>
* fix class ids

* remaining modifications for ClassId change
@ssparach ssparach changed the title Feature/fileexplorer sourcecontrol integration Merge feature/fileexplorer sourcecontrol integration into main Aug 5, 2024
@ssparach ssparach changed the title Merge feature/fileexplorer sourcecontrol integration into main Merge feature/fileexplorer-sourcecontrol-integration into main Aug 5, 2024
@ssparach ssparach marked this pull request as ready for review August 5, 2024 19:37
@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you do a Control+K+D in visual studio on the new csproj files? Standard is 2 space indents, not 4.

<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FileExplorerGitIntegration\FileExplorerGitIntegration.csproj" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be great if you could add the new projects to the architecture diagram here: https://github.com/microsoft/devhome/blob/main/docs/architecture.md

</None>
</ItemGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add a "Debug_FailFast" group here

@@ -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}"
Copy link
Contributor

Choose a reason for hiding this comment

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

(not about this file) This change seems to introduce files with both crlf and lf line endings. Might be a good idea to change everything to CRLF before merging.

Comment on lines +26 to +27
private GitDetect _gitDetect = new();
private bool _gitInstalled;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be readonly (I opened the branch in VS, I'm not that good at noticing 🙂)

private readonly List<GitStatusEntry> _untracked = new();
private readonly List<GitStatusEntry> _modified = new();
private readonly List<GitStatusEntry> _missing = new();
private readonly List<GitStatusEntry> _ignored = new();
Copy link
Contributor

Choose a reason for hiding this comment

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

Not used

public sealed class Program
{
[MTAThread]
public static void Main([System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArray] string[] args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include fixes from #3445

@@ -128,6 +142,20 @@
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension Name="com.microsoft.devhome" Id="PG-SP-ID3" PublicFolder="Public" DisplayName="ms-resource:AppDisplayNameGitExt" Description="ms-resource:AppDescriptionGitExt">
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to change the Id, we already have PG-SP-ID3 (same for other two appxmanifests)

Suggested change
<uap3:AppExtension Name="com.microsoft.devhome" Id="PG-SP-ID3" PublicFolder="Public" DisplayName="ms-resource:AppDisplayNameGitExt" Description="ms-resource:AppDescriptionGitExt">
<uap3:AppExtension Name="com.microsoft.devhome" Id="PG-SP-ID4" PublicFolder="Public" DisplayName="ms-resource:AppDisplayNameGitExt" Description="ms-resource:AppDescriptionGitExt">

Comment on lines +8 to +10
xmlns:converters="using:CommunityToolkit.WinUI.Converters"
xmlns:viewmodels="using:DevHome.Customization.ViewModels"
xmlns:ctControls="using:CommunityToolkit.WinUI.Controls"
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need these 3.

public sealed class Program
{
[MTAThread]
public static void Main([System.Runtime.InteropServices.WindowsRuntime.ReadOnlyArray] string[] args)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment about #3445

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants