This repository was archived by the owner on Jun 5, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Git extension integration in Repository Management. #3896
Merged
Merged
Changes from 56 commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
fc754c1
Refining Repository Management's UI. (#3557)
dhoehna e52afbf
Merge branch 'main' into user/dhoehna/RepositoryManagementFeature
dhoehna 7d00a02
Adding EF core, database project, and some usage. (#3674)
dhoehna cd2f925
Merge branch 'main' into user/dhoehna/RepositoryManagementFeature
dhoehna 6775301
Merge branch 'user/dhoehna/RepositoryManagementFeature' of https://gi…
dhoehna 9d77f68
Moving this to experimental
dhoehna 17cc488
WIP
dhoehna 66f6978
Some telemetry and logging
dhoehna 8606981
THings build again.
dhoehna 241bcee
Returning this back
dhoehna 234af67
I believe I am understanding this.
dhoehna 038c65b
Can update
dhoehna e45e669
Almost done with open in FE
dhoehna 0d39cd6
Try/Catching everything. Open in FE should be done.
dhoehna d6f4f44
Open in CMD works. :)
dhoehna e3b552e
Merge branch 'main' into user/dhoehna/ImplementingTheRepositoryActions
dhoehna 1d628c7
Re-adding changes lost due to merge
dhoehna d23a431
Getting saving straightened out.
dhoehna 6b7b72e
Merge branch 'main' into user/dhoehna/ImplementingTheRepositoryActions
dhoehna d73857d
WIP
dhoehna 87a1a38
Move Repository done.
dhoehna 5395f4c
Removing 1:1. Finishing RemoveFromList
dhoehna 022977a
Adding _items
dhoehna 7fe619c
Adding configuration file information to the repository table
dhoehna 5655157
Opening the configuration file location in FE
dhoehna 2ef3922
Deleting a repository.
dhoehna 2c44c31
Add to winget configuration file.
dhoehna cfa8f9a
Cleaning up the code
dhoehna 0c00fca
Icon for a configuration file. UI updates when hiding a repo
dhoehna 4135ec4
All the buttons do something.
dhoehna 5d0d7d3
Removing 'local'
dhoehna e1b38ba
Making sure the test works
dhoehna 9220814
New test works
dhoehna ce627ce
Another TODO
dhoehna b8fd941
Fixing more things before PR.
dhoehna 13367f8
Removing another un-used using.
dhoehna 73f6563
MOre un used usings.
dhoehna cc6f2ba
Another Todo
dhoehna 3441e1c
Anotehr TODO
dhoehna 42f7605
Localized strings
dhoehna e7444d1
WIP
dhoehna 3c24c6a
Merge branch 'main' into user/dhoehna/DatabaseMigrationsAndTodos
dhoehna 203070f
Adding enhanced information if it can be found.
dhoehna bf9edb7
Commit, Filtering, and Sorting.
dhoehna e72aa44
Merge
dhoehna 1fbf56c
Fixing up the merge
dhoehna 6eb1145
Removing Move/Delete because of a bug in FileExplorerGitIntegration.
dhoehna ed70a2f
Adding a TODO
dhoehna 5d93aff
A small commit
dhoehna 2c21807
Removing some unused usings
dhoehna 5b7dd87
Update tools/RepositoryManagement/DevHome.RepositoryManagement/String…
dhoehna c9a67f5
Update tools/RepositoryManagement/DevHome.RepositoryManagement/String…
dhoehna 0e2b21a
Update tools/RepositoryManagement/DevHome.RepositoryManagement/String…
dhoehna 5400dd0
Adressing comments
dhoehna f90a5c8
Merge branch 'user/dhoehna/DatabaseMigrationsAndTodos' of https://git…
dhoehna 5a8051b
Adressing comments
dhoehna 41a8d4e
Addressing code quality comments
dhoehna 856e0f0
Update database/DevHome.Database/DatabaseModels/RepositoryManagement/…
dhoehna 1dbed3a
Fixing some issues.
dhoehna fed4755
Added a TODO
dhoehna fa22fce
Adding drop down to select a source control provider
dhoehna 20a433e
Hide source control selection
dhoehna 85c0014
FIxing indentation
dhoehna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/DevHomeDatabase/DevHomeDatabaseContextEvent.cs
This file contains hidden or 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.Internal; | ||
|
|
||
| namespace DevHome.Common.TelemetryEvents.DevHomeDatabase; | ||
|
|
||
| [EventData] | ||
| public class DevHomeDatabaseContextEvent : EventBase | ||
| { | ||
| public override PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance; | ||
|
|
||
| public string Step { get; } = string.Empty; | ||
|
|
||
| public int HResult { get; } | ||
|
|
||
| public string ExceptionMessage { get; } = string.Empty; | ||
|
|
||
| public DevHomeDatabaseContextEvent(string step) | ||
| { | ||
| Step = step; | ||
| } | ||
|
|
||
| public DevHomeDatabaseContextEvent(string step, Exception ex) | ||
| { | ||
| Step = step; | ||
| HResult = ex.HResult; | ||
| ExceptionMessage = ex.Message; | ||
| } | ||
|
|
||
| public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings) | ||
| { | ||
| // no sensitive strings to replace. | ||
| } | ||
| } |
38 changes: 38 additions & 0 deletions
38
common/TelemetryEvents/DevHomeDatabase/DevHomeDatabaseEvent.cs
This file contains hidden or 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.Internal; | ||
|
|
||
| namespace DevHome.Common.TelemetryEvents.DevHomeDatabase; | ||
|
|
||
| [EventData] | ||
| public class DevHomeDatabaseEvent : EventBase | ||
| { | ||
| public override PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance; | ||
|
|
||
| public string Step { get; } = string.Empty; | ||
|
|
||
| public int HResult { get; } | ||
|
|
||
| public string ExceptionMessage { get; } = string.Empty; | ||
|
|
||
| public DevHomeDatabaseEvent(string step) | ||
| { | ||
| Step = step; | ||
| } | ||
|
|
||
| public DevHomeDatabaseEvent(string step, Exception ex) | ||
| { | ||
| Step = step; | ||
| HResult = ex.HResult; | ||
| ExceptionMessage = ex.Message; | ||
| } | ||
|
|
||
| public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings) | ||
| { | ||
| // No sensitive strings to replace. | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
common/TelemetryEvents/RepositoryManagement/EnhanceRepositoryErrorEvent.cs
This file contains hidden or 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,36 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| using System; | ||
| using System.Diagnostics.Tracing; | ||
| using DevHome.Telemetry; | ||
| using Microsoft.Diagnostics.Telemetry.Internal; | ||
|
|
||
| namespace DevHome.Common.TelemetryEvents.RepositoryManagement; | ||
|
|
||
| [EventData] | ||
| public class EnhanceRepositoryErrorEvent : EventBase | ||
| { | ||
| public override PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance; | ||
|
|
||
| public string Action { get; } = string.Empty; | ||
|
|
||
| public int Hresult { get; } | ||
|
|
||
| public string ErrorMessage { get; } = string.Empty; | ||
|
|
||
| public string RepositoryName { get; } = string.Empty; | ||
|
|
||
| public EnhanceRepositoryErrorEvent(string action, int hresult, string errorMessage, string repositoryName) | ||
| { | ||
| Action = action; | ||
| Hresult = hresult; | ||
| ErrorMessage = errorMessage; | ||
| RepositoryName = repositoryName; | ||
| } | ||
|
|
||
| public override void ReplaceSensitiveStrings(Func<string, string> replaceSensitiveStrings) | ||
| { | ||
| // No sensitive strings to replace | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
7 changes: 6 additions & 1 deletion
7
...240919221355_InitialMigration.Designer.cs → ...240920200626_InitialMigration.Designer.cs
dhoehna marked this conversation as resolved.
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -100,9 +100,6 @@ public App() | |
| }). | ||
| ConfigureServices((context, services) => | ||
| { | ||
| // Add databse connection | ||
| services.AddDatabase(context); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this a duplicate from somewhere else? |
||
|
|
||
| // Add Serilog logging for ILogger. | ||
| services.AddLogging(lb => lb.AddSerilog(dispose: true)); | ||
|
|
||
|
|
||
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -11,14 +11,16 @@ namespace DevHome.Test.Database; | |
| [TestClass] | ||
| public class RepositoryTests | ||
| { | ||
| private const string ConfigurationFileLocation = @"The\Best\Configuration\Location"; | ||
|
|
||
| private const string CloneLocation = @"The\Best\File\Location"; | ||
| private const string CloneLocation = @"TestSource\repos"; | ||
|
|
||
| private const string RepositoryName = "DevHome"; | ||
|
|
||
| private const string ConfigurationFileLocation = @".configurations\configuration.dsc.yaml"; | ||
|
|
||
| private const string RepositoryUri = "https://www.github.com/microsoft/devhome"; | ||
|
|
||
| private readonly string _repositoryCloneLocation = Path.Join(CloneLocation, RepositoryName); | ||
|
|
||
| [TestInitialize] | ||
| public void ResetDatabase() | ||
| { | ||
|
|
@@ -33,6 +35,26 @@ public void ResetDatabase() | |
|
|
||
| dbContext.Database.EnsureDeleted(); | ||
| dbContext.Database.EnsureCreated(); | ||
|
|
||
| if (Directory.Exists(_repositoryCloneLocation)) | ||
| { | ||
| // Cumbersome, but needed to remove read-only files. | ||
| foreach (var repositoryFile in Directory.EnumerateFiles(_repositoryCloneLocation, "*", SearchOption.AllDirectories)) | ||
| { | ||
| File.SetAttributes(repositoryFile, FileAttributes.Normal); | ||
| File.Delete(repositoryFile); | ||
| } | ||
|
|
||
| foreach (var repositoryDirectory in Directory.GetDirectories(_repositoryCloneLocation, "*", SearchOption.AllDirectories).Reverse()) | ||
| { | ||
| Directory.Delete(repositoryDirectory); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This might benefit from a "Try-catch" since the deletion of each file/folder might fail, and shouldn't fail the reset() and should proceed to the next item. Maybe log failure and proceed is best, since any dependent tests will indicate if it's a problem. |
||
| } | ||
|
|
||
| File.SetAttributes(_repositoryCloneLocation, FileAttributes.Normal); | ||
| Directory.Delete(_repositoryCloneLocation, false); | ||
| } | ||
|
|
||
| LibGit2Sharp.Repository.Clone(RepositoryUri, _repositoryCloneLocation); | ||
| } | ||
|
|
||
| [TestMethod] | ||
|
|
@@ -86,5 +108,6 @@ public void MakefilledInRepository() | |
| Assert.IsTrue(savedRepository.IsHidden); | ||
| Assert.IsTrue(savedRepository.HasAConfigurationFile); | ||
| Assert.AreEqual(RepositoryUri, savedRepository.RepositoryUri); | ||
| Assert.IsTrue(savedRepository.HasAConfigurationFile); | ||
| } | ||
| } | ||
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.