Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 0210df0

Browse files
authored
Merge branch 'master' into docs-changes
2 parents e0f04a7 + efe148d commit 0210df0

File tree

39 files changed

+462
-349
lines changed

39 files changed

+462
-349
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<ProjectConfiguration>
22
<Settings>
3+
<AdditionalFilesToIncludeForProject>
4+
<Value>xlf\**.*</Value>
5+
</AdditionalFilesToIncludeForProject>
36
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully>
47
</Settings>
58
</ProjectConfiguration>

crowdin.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
preserve_hierarchy: true
2+
13
files:
24
- source: /src/GitHub.Resources/Resources.resx
35
translation: /%original_path%/Resources.%locale%.resx
6+
- source: /src/GitHub.VisualStudio/xlf/GitHub.VisualStudio.vsct.zh-CN.xlf
7+
translation: /%original_path%/GitHub.VisualStudio.vsct.%locale%.xlf
8+
- source: /src/GitHub.VisualStudio/xlf/VSPackage.zh-CN.xlf
9+
translation: /%original_path%/VSPackage.%locale%.xlf

nuget.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<configuration>
33
<packageSources>
44
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
5+
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
56
<add key="Custom Packages for GHfVS" value="lib" />
67
</packageSources>
78
<activePackageSource>

src/GitHub.App/Services/DialogService.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ public DialogService(
3131

3232
public async Task<CloneDialogResult> ShowCloneDialog(IConnection connection)
3333
{
34-
Guard.ArgumentNotNull(connection, nameof(connection));
35-
3634
var viewModel = factory.CreateViewModel<IRepositoryCloneViewModel>();
3735

38-
return (CloneDialogResult)await showDialog.Show(
39-
viewModel,
40-
connection,
41-
ApiClientConfiguration.RequestedScopes)
42-
.ConfigureAwait(false);
36+
if (connection != null)
37+
{
38+
return (CloneDialogResult)await showDialog.Show(
39+
viewModel,
40+
connection,
41+
ApiClientConfiguration.RequestedScopes)
42+
.ConfigureAwait(false);
43+
}
44+
else
45+
{
46+
return (CloneDialogResult)await showDialog.ShowWithFirstConnection(viewModel)
47+
.ConfigureAwait(false);
48+
}
4349
}
4450

4551
public async Task<string> ShowReCloneDialog(IRepositoryModel repository)

src/GitHub.App/Services/RepositoryCloneService.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,20 @@ public async Task CloneRepository(
121121
try
122122
{
123123
await vsGitServices.Clone(cloneUrl, repositoryPath, true, progress);
124+
124125
await usageTracker.IncrementCounter(x => x.NumberOfClones);
126+
127+
var repositoryUrl = new UriString(cloneUrl).ToRepositoryUrl();
128+
var isDotCom = HostAddress.IsGitHubDotComUri(repositoryUrl);
129+
if (isDotCom)
130+
{
131+
await usageTracker.IncrementCounter(x => x.NumberOfGitHubClones);
132+
}
133+
else
134+
{
135+
// If it isn't a GitHub URL, assume it's an Enterprise URL
136+
await usageTracker.IncrementCounter(x => x.NumberOfEnterpriseClones);
137+
}
125138
}
126139
catch (Exception ex)
127140
{

src/GitHub.App/ViewModels/Dialog/Clone/RepositoryCloneViewModel.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ public class RepositoryCloneViewModel : ViewModelBase, IRepositoryCloneViewModel
2323
readonly IOperatingSystem os;
2424
readonly IConnectionManager connectionManager;
2525
readonly IRepositoryCloneService service;
26+
readonly IUsageService usageService;
27+
readonly IUsageTracker usageTracker;
2628
readonly IReadOnlyList<IRepositoryCloneTabViewModel> tabs;
2729
string path;
2830
IRepositoryModel previousRepository;
@@ -34,13 +36,17 @@ public RepositoryCloneViewModel(
3436
IOperatingSystem os,
3537
IConnectionManager connectionManager,
3638
IRepositoryCloneService service,
39+
IUsageService usageService,
40+
IUsageTracker usageTracker,
3741
IRepositorySelectViewModel gitHubTab,
3842
IRepositorySelectViewModel enterpriseTab,
3943
IRepositoryUrlViewModel urlTab)
4044
{
4145
this.os = os;
4246
this.connectionManager = connectionManager;
4347
this.service = service;
48+
this.usageService = usageService;
49+
this.usageTracker = usageTracker;
4450

4551
GitHubTab = gitHubTab;
4652
EnterpriseTab = enterpriseTab;
@@ -119,6 +125,33 @@ public async Task InitializeAsync(IConnection connection)
119125
}
120126

121127
this.WhenAnyValue(x => x.SelectedTabIndex).Subscribe(x => tabs[x].Activate().Forget());
128+
129+
// Users in group A will see the URL tab by default
130+
if (await IsGroupA().ConfigureAwait(false))
131+
{
132+
SelectedTabIndex = 2;
133+
}
134+
135+
switch (SelectedTabIndex)
136+
{
137+
case 0:
138+
usageTracker.IncrementCounter(model => model.NumberOfCloneViewGitHubTab).Forget();
139+
break;
140+
case 1:
141+
usageTracker.IncrementCounter(model => model.NumberOfCloneViewEnterpriseTab).Forget();
142+
break;
143+
case 2:
144+
usageTracker.IncrementCounter(model => model.NumberOfCloneViewUrlTab).Forget();
145+
break;
146+
}
147+
}
148+
149+
// Put 50% of users in group A
150+
async Task<bool> IsGroupA()
151+
{
152+
var userGuid = await usageService.GetUserGuid().ConfigureAwait(false);
153+
var lastByte = userGuid.ToByteArray().Last();
154+
return lastByte % 2 == 0;
122155
}
123156

124157
void BrowseForDirectory()

src/GitHub.Exports/Extensions/ServiceProviderExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace GitHub.Extensions
88
{
99
public static class IServiceProviderExtensions
1010
{
11-
static readonly ILogger log = LogManager.ForContext<VSServices>();
11+
static readonly ILogger log = LogManager.ForContext(typeof(IServiceProviderExtensions));
1212

1313
/// <summary>
1414
/// Safe variant of GetService that doesn't throw exceptions if the service is

src/GitHub.Exports/Models/UsageModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class DimensionsModel
3232
public string VSVersion { get; set; }
3333
public string Lang { get; set; }
3434
public string CurrentLang { get; set; }
35+
public string CurrentUILang { get; set; }
3536
}
3637

3738
public class MeasuresModel
@@ -85,6 +86,11 @@ public class MeasuresModel
8586
public int ExecuteToggleInlineCommentMarginCommand { get; set; }
8687
public int NumberOfPullRequestFileMarginToggleInlineCommentMargin { get; set; }
8788
public int NumberOfPullRequestFileMarginViewChanges { get; set; }
89+
public int NumberOfCloneViewGitHubTab { get; set; }
90+
public int NumberOfCloneViewEnterpriseTab { get; set; }
91+
public int NumberOfCloneViewUrlTab { get; set; }
92+
public int NumberOfGitHubClones { get; set; }
93+
public int NumberOfEnterpriseClones { get; set; }
8894
}
8995
}
9096
}

src/GitHub.Extensions/GitHub.Extensions.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
</ItemGroup>
2626

2727
<ItemGroup>
28-
<None Include="packages.config" />
2928
<ProjectReference Include="..\..\submodules\splat\Splat\Splat-Net45.csproj" />
3029
<ProjectReference Include="..\GitHub.Logging\GitHub.Logging.csproj" />
3130
</ItemGroup>

src/GitHub.InlineReviews/GitHub.InlineReviews.csproj

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props')" />
34
<Import Project="..\..\packages\LibGit2Sharp.NativeBinaries.1.0.164\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\..\packages\LibGit2Sharp.NativeBinaries.1.0.164\build\LibGit2Sharp.NativeBinaries.props')" />
4-
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props')" />
55
<PropertyGroup>
66
<!-- This is added to prevent forced migrations in Visual Studio 2012 and newer -->
77
<MinimumVisualStudioVersion Condition="'$(VisualStudioVersion)' != ''">$(VisualStudioVersion)</MinimumVisualStudioVersion>
@@ -488,11 +488,15 @@
488488
<PropertyGroup>
489489
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
490490
</PropertyGroup>
491-
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.props'))" />
492-
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.targets'))" />
493491
<Error Condition="!Exists('..\..\packages\LibGit2Sharp.NativeBinaries.1.0.164\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\LibGit2Sharp.NativeBinaries.1.0.164\build\LibGit2Sharp.NativeBinaries.props'))" />
492+
<Error Condition="!Exists('..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
493+
<Error Condition="!Exists('..\..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets'))" />
494+
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props'))" />
495+
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets'))" />
494496
</Target>
495-
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.14.3.25407\build\Microsoft.VSSDK.BuildTools.targets')" />
497+
<Import Project="..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('..\..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
498+
<Import Project="..\..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets" Condition="Exists('..\..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets')" />
499+
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets')" />
496500
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
497501
Other similar extension points exist, see Microsoft.Common.targets.
498502
<Target Name="BeforeBuild">

0 commit comments

Comments
 (0)