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

Commit 3d307d2

Browse files
authored
Merge branch 'master' into feature/open-file-from-github
2 parents 030e2da + ffafd4d commit 3d307d2

File tree

7 files changed

+144
-44
lines changed

7 files changed

+144
-44
lines changed

azure-pipelines.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# .NET Desktop
2+
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
3+
# Add steps that publish symbols, save build artifacts, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net
5+
6+
pool:
7+
vmImage: 'VS2017-Win2016'
8+
9+
variables:
10+
solution: '**/*.sln'
11+
buildPlatform: 'Any CPU'
12+
buildConfiguration: 'Release'
13+
14+
steps:
15+
- task: InstallSSHKey@0
16+
inputs:
17+
hostName: github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
18+
sshPublicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCx/AxLjr4mhH7XFlbISb65GBxQnVnKh1owmAT1bK/Qt1b4/Z0SL68IvV88DpgLyKbica2giEVfKo/Z4dkO+P8M2bGXrNgazzfO910DlR+e1vt8BSU/Dbvscz0i1lsfKb3PnfSouCkQev6Th0v+hBdgkuackWgaBw22DDLkp9Uf/cAo+QYLz56p5KVctEESRRgGgIIlZyUc8OYDMSU2wQhG9x31mSyJ4ODuOZsi1RgBBHrgUb2QRhLJ9nZWfQgGBRDxGYTKLWiWIQwgSVQ9x1Az/Rei+CbPRvLcVGg+5vHt8lcu+HxEgrY4IsjXdMqosPqxQ+TT6f+G4GQDn8+IQ4wOpTVi84PkOQX3JPE2QSJwWA0AHNe5NTSns6WWYQyzxFJYBN2pLPuMnj9/+ozV3GaeQqn47WHfUH3s5IawNQPTFDxcl4qsmU66Ybfqa4eFIPEvCCp1leQcuXyDHxKLq80x1szN4kn0oyL2W0zbkwTaZG4I5l4Rto0hErUf3qx7FlZjMGEFMdJVskgnRMkKdqngF0FmSYQICpmqqYD8TydUc6jxZVOCvFF5gbqwxV/F2lk10D7FnetUNeWvpcZKbFUX4e5Ff15vibJZp4/5FUbksv+glfbPwk6tGuNj3xPFODP7KG8Y5wtcbknX11XI0vi+iL8TxL0Vk30TpZUMXWYYvQ==
19+
sshKeySecureFile: id_rsa
20+
21+
- script: git submodule init && git submodule deinit script && git submodule update
22+
displayName: Submodule init
23+
24+
# Can't use the NuGet tasks because of https://github.com/Microsoft/azure-pipelines-tasks/issues/6790
25+
#- task: NuGetToolInstaller@0
26+
#- task: NuGetCommand@2
27+
# inputs:
28+
# restoreSolution: '$(solution)'
29+
# feedsToUse: 'config'
30+
# nugetConfigPath: nuget.config
31+
32+
# Instead run nuget manually.
33+
- script: tools\nuget\nuget.exe restore
34+
displayName: NuGet restore
35+
36+
# Ideally we'd run NerdBank.GitVersioning but that will come later. For now bump the
37+
# version with the azure BuildId
38+
- task: PowerShell@2
39+
inputs:
40+
targetType: filePath
41+
filePath: '$(Build.SourcesDirectory)\scripts\Bump-Version.ps1'
42+
arguments: -BumpBuild -BuildNumber:$(Build.BuildId)
43+
displayName: Bump version
44+
45+
- task: VSBuild@1
46+
inputs:
47+
solution: GitHubVS.sln
48+
platform: '$(buildPlatform)'
49+
configuration: '$(buildConfiguration)'
50+
51+
# VSTest is hanging. Skip tests for now; we're still running Appveyor which will handle the tests.
52+
#- task: VSTest@2
53+
# inputs:
54+
# searchFolder: '$(Build.SourcesDirectory)\test'
55+
# testAssemblyVer2: '**\bin\**\*Tests.dll'
56+
# platform: '$(buildPlatform)'
57+
# configuration: '$(buildConfiguration)'
58+
# diagnosticsEnabled: true
59+
# runSettingsFile: '$(Build.SourcesDirectory)\test\test.runsettings'
60+
61+
- task: PublishBuildArtifacts@1
62+
inputs:
63+
pathtoPublish: '$(Build.SourcesDirectory)\build\Release\GitHub.VisualStudio.vsix'
64+
artifactName: 'vsix'

nuget.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<packageSources>
4-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
4+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
55
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
66
<add key="vsixtesting" value="https://www.myget.org/F/vsixtesting/api/v3/index.json" />
77
<add key="Custom Packages for GHfVS" value="lib" />

src/GitHub.VisualStudio.UI/Views/GitHubPane/PullRequestAnnotationsView.xaml

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -27,63 +27,74 @@
2727
</Control.Resources>
2828

2929
<ScrollViewer VerticalScrollBarVisibility="Auto">
30-
<StackPanel>
31-
<StackPanel DockPanel.Dock="Top" Margin="8 0" Orientation="Vertical">
32-
<TextBlock FontSize="16" VerticalAlignment="Center">
33-
<Run FontWeight="SemiBold" Text="{Binding CheckSuiteName, Mode=OneWay}"/>
34-
<Run Text="/"/>
35-
<Run FontWeight="SemiBold" Text="{Binding CheckRunName, Mode=OneWay}"/>
36-
37-
<Run>for</Run>
38-
39-
<Hyperlink Command="{Binding NavigateToPullRequest}">
40-
<Run>#</Run><Run Text="{Binding PullRequestNumber, Mode=OneWay}"/>
41-
</Hyperlink>
42-
</TextBlock>
43-
44-
<TextBlock Foreground="{DynamicResource GitHubVsGrayText}"
45-
Margin="0"
46-
Text="{Binding PullRequestTitle}"
47-
TextWrapping="Wrap"/>
48-
49-
<markdig:MarkdownViewer FontFamily="Consolas"
50-
Visibility="{Binding CheckRunSummary, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}"
51-
Markdown="{Binding CheckRunSummary}" />
52-
53-
<TextBlock FontFamily="Consolas"
54-
Foreground="{DynamicResource VsBrush.GrayText}"
55-
Visibility="{Binding CheckRunText, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
56-
<Run Text="{Binding CheckRunText, Mode=OneWay}"/>
57-
</TextBlock>
58-
59-
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="-8 4"/>
60-
61-
<ItemsControl Margin="-4 0" ItemsSource="{Binding AnnotationsDictionary}">
30+
<DockPanel>
31+
<StackPanel DockPanel.Dock="Top" Orientation="Vertical">
32+
<StackPanel Margin="8 0 8 4">
33+
<TextBlock FontSize="16" VerticalAlignment="Center">
34+
<Run FontWeight="SemiBold" Text="{Binding CheckSuiteName, Mode=OneWay}"/>
35+
<Run Text="/"/>
36+
<Run FontWeight="SemiBold" Text="{Binding CheckRunName, Mode=OneWay}"/>
37+
38+
<Run>for</Run>
39+
40+
<Hyperlink Command="{Binding NavigateToPullRequest}">
41+
<Run>#</Run><Run Text="{Binding PullRequestNumber, Mode=OneWay}"/>
42+
</Hyperlink>
43+
</TextBlock>
44+
45+
<TextBlock Foreground="{DynamicResource GitHubVsGrayText}"
46+
Margin="0"
47+
Text="{Binding PullRequestTitle}"
48+
TextWrapping="Wrap"/>
49+
</StackPanel>
50+
51+
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="0 4"/>
52+
53+
<Expander Header="Body" Margin="0 4"
54+
FontWeight="SemiBold"
55+
Visibility="{Binding CheckRunSummary, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
56+
<markdig:MarkdownViewer Margin="21 0 8 0" FontWeight="Normal" Markdown="{Binding CheckRunSummary}" />
57+
</Expander>
58+
59+
<Expander Margin="0 4"
60+
Visibility="{Binding CheckRunText, Converter={ghfvs:NullOrWhitespaceToVisibilityConverter}}">
61+
<Expander.Header>
62+
<TextBlock FontWeight="SemiBold" Text="Details" />
63+
</Expander.Header>
64+
<TextBlock Margin="21 0 8 0" FontFamily="Consolas"
65+
Foreground="{DynamicResource VsBrush.GrayText}">
66+
<Run Text="{Binding CheckRunText, Mode=OneWay}"/>
67+
</TextBlock>
68+
</Expander>
69+
70+
<Rectangle Fill="{DynamicResource GitHubHeaderSeparatorBrush}" Height="1" Margin="0 4"/>
71+
72+
<ItemsControl ItemsSource="{Binding AnnotationsDictionary}">
6273
<ItemsControl.ItemTemplate>
6374
<DataTemplate>
64-
<StackPanel>
75+
<StackPanel Margin="0 4">
6576
<Expander>
6677
<Expander.Header>
67-
<Label Foreground="{DynamicResource VsBrush.WindowText}" Content="{Binding Key}" FontWeight="SemiBold" ToolTip="{Binding Key}" />
78+
<TextBlock Margin="0 0 0 4" Foreground="{DynamicResource VsBrush.WindowText}" Text="{Binding Key}" FontWeight="SemiBold" />
6879
</Expander.Header>
6980

7081
<ItemsControl ItemsSource="{Binding Value}">
7182
<ItemsControl.ItemTemplate>
7283
<DataTemplate>
73-
<Grid Margin="26 0 0 8" >
84+
<Grid Margin="22 0 0 8" >
7485
<Grid.ColumnDefinitions>
75-
<ColumnDefinition Width="16" />
86+
<ColumnDefinition Width="20" />
7687
<ColumnDefinition Width="*" />
7788
</Grid.ColumnDefinitions>
7889

79-
<StackPanel Grid.Column="0" VerticalAlignment="Center">
90+
<StackPanel Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center">
8091
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusInformation}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Notice}}"/>
8192
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusWarning}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Warning}}"/>
8293
<imaging:CrispImage Width="16" Height="16" Moniker="{x:Static catalog:KnownMonikers.StatusError}" Visibility="{Binding Annotation.AnnotationLevel, Converter={ghfvs:EqualsToVisibilityConverter Failure}}"/>
8394
</StackPanel>
8495

8596
<StackPanel Margin="8,0,0,0" Grid.Column="1">
86-
<TextBlock FontWeight="SemiBold">
97+
<TextBlock FontWeight="SemiBold" TextWrapping="Wrap">
8798
<Run Text="{Binding Annotation.Title, Mode=OneWay}"/>
8899
</TextBlock>
89100

@@ -115,8 +126,11 @@
115126
</ItemsControl.ItemTemplate>
116127
</ItemsControl>
117128
</StackPanel>
118-
</StackPanel>
129+
</DockPanel>
119130
</ScrollViewer>
120131

132+
<FrameworkElement.CommandBindings>
133+
<CommandBinding Command="{x:Static markdig:Commands.Hyperlink}" Executed="OpenHyperlink" />
134+
</FrameworkElement.CommandBindings>
121135
</UserControl>
122136

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
22
using System.ComponentModel.Composition;
3-
using System.Windows.Forms;
3+
using System.Windows.Controls;
4+
using System.Windows.Input;
45
using GitHub.Exports;
56
using GitHub.Services;
6-
using GitHub.UI;
77
using GitHub.ViewModels.GitHubPane;
8-
using ReactiveUI;
9-
using UserControl = System.Windows.Controls.UserControl;
8+
using Microsoft.VisualStudio.Shell;
109

1110
namespace GitHub.VisualStudio.Views.GitHubPane
1211
{
@@ -18,5 +17,18 @@ public PullRequestAnnotationsView()
1817
{
1918
InitializeComponent();
2019
}
20+
21+
void OpenHyperlink(object sender, ExecutedRoutedEventArgs e)
22+
{
23+
Uri uri;
24+
25+
if (Uri.TryCreate(e.Parameter?.ToString(), UriKind.Absolute, out uri))
26+
{
27+
Browser.OpenUrl(uri);
28+
}
29+
}
30+
31+
[Import]
32+
public IVisualStudioBrowser Browser { get; set; }
2133
}
2234
}

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@
7979
<DeployExtension>False</DeployExtension>
8080
<OutputPath>..\..\build\Release\</OutputPath>
8181
</PropertyGroup>
82+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
83+
<!-- Only deploy extension when building inside Visual Studio -->
84+
<DeployExtension>False</DeployExtension>
85+
</PropertyGroup>
8286
<Import Project="..\common\signing.props" />
8387
<ItemGroup>
8488
<Reference Include="Microsoft.CSharp" />

test/test.runsettings

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RunSettings>
3+
<RunConfiguration>
4+
<TestSessionTimeout>120000</TestSessionTimeout>
5+
</RunConfiguration>
6+
</RunSettings>

tools/nuget/NuGet.exe

1.34 MB
Binary file not shown.

0 commit comments

Comments
 (0)