Skip to content

Commit

Permalink
Merge pull request #244 from microsoft/staging
Browse files Browse the repository at this point in the history
Release - 10/17/23
  • Loading branch information
EricJohnson327 authored Oct 11, 2023
2 parents 8f275c3 + 7876c48 commit 4ffb4bc
Show file tree
Hide file tree
Showing 296 changed files with 421 additions and 400 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/GitHubExt-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ jobs:
Add-Content $env:GITHUB_ENV "VSDevCmd=$VSDevCmd"
- name: Restore dependencies
run: dotnet restore GITServices.sln -p:PublishReadyToRun=true
run: dotnet restore GitHubExtension.sln -p:PublishReadyToRun=true

- name: Build_DevHomeGitHubExtension
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} /restore GITServices.sln
run: cmd /c "$env:VSDevCmd" "&" msbuild /p:Configuration=${{ matrix.configuration }},Platform=${{ matrix.platform }} /restore GitHubExtension.sln

- name: Find vstest.console.exe
if: ${{ matrix.platform != 'arm64' }}
Expand All @@ -69,4 +69,4 @@ jobs:
- name: DevHome UnitTests
if: ${{ matrix.platform != 'arm64' }}
run: cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} /TestCaseFilter:"TestCategory!=LiveData" BuildOutput\\${{ matrix.configuration }}\\${{ matrix.platform }}\\GitHubPlugin.Test\\GitHubPlugin.Test.dll
run: cmd /c "$env:VSDevTestCmd" /Platform:${{ matrix.platform }} /TestCaseFilter:"TestCategory!=LiveData" BuildOutput\\${{ matrix.configuration }}\\${{ matrix.platform }}\\GitHubExtension.Test\\GitHubExtension.Test.dll
12 changes: 6 additions & 6 deletions GITServices.sln → GitHubExtension.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32901.215
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GITServices.UITest", "test\UITest\GITServices.UITest.csproj", "{E9F49E1C-C15D-4B87-92CA-9003C1C31DB5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtension.UITest", "test\UITest\GitHubExtension.UITest.csproj", "{E9F49E1C-C15D-4B87-92CA-9003C1C31DB5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubPlugin.TestConsole", "test\Console\GitHubPlugin.TestConsole.csproj", "{90991D71-5740-4C75-B79B-6092F4D75BF4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtension.TestConsole", "test\Console\GitHubExtension.TestConsole.csproj", "{90991D71-5740-4C75-B79B-6092F4D75BF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubPlugin", "src\GithubPlugin\GitHubPlugin.csproj", "{FFC1FC71-6386-4D30-A6A9-2401121BEEE3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtension", "src\GitHubExtension\GitHubExtension.csproj", "{FFC1FC71-6386-4D30-A6A9-2401121BEEE3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubPluginServer", "src\GithubPluginServer\GitHubPluginServer.csproj", "{9AEDC455-CF92-43A7-8E89-C6CA50DEC536}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtensionServer", "src\GitHubExtensionServer\GitHubExtensionServer.csproj", "{9AEDC455-CF92-43A7-8E89-C6CA50DEC536}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GITServices.Telemetry", "src\Telemetry\GITServices.Telemetry.csproj", "{8E1764CB-2FFC-4F23-9FC0-BDE84E519319}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtension.Telemetry", "src\Telemetry\GitHubExtension.Telemetry.csproj", "{8E1764CB-2FFC-4F23-9FC0-BDE84E519319}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5BDF2709-4299-49C3-B971-B10747F2925D}"
EndProject
Expand All @@ -38,7 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{A371
build\scripts\Unstub.ps1 = build\scripts\Unstub.ps1
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubPlugin.Test", "test\GitHubPlugin\GitHubPlugin.Test.csproj", "{D8EFDB34-7019-4807-AE97-1B50891F345D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GitHubExtension.Test", "test\GitHubExtension\GitHubExtension.Test.csproj", "{D8EFDB34-7019-4807-AE97-1B50891F345D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DevHome.Logging", "src\Logging\DevHome.Logging.csproj", "{FEEEDA62-F746-4160-A3A8-1EE74137F8AB}"
EndProject
Expand Down
6 changes: 3 additions & 3 deletions build/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ parameters:
- release

variables:
MSIXVersion: '0.501'
solution: '**/GITServices.sln'
MSIXVersion: '0.600'
solution: '**/GitHubExtension.sln'
appxPackageDir: 'AppxPackages'
testOutputArtifactDir: 'TestResults'

Expand Down Expand Up @@ -123,7 +123,7 @@ stages:
ArtifactName: LocOutput

- task: PowerShell@2
displayName: Build GITServices Extension
displayName: Build GitHub Extension
retryCountOnTaskFailure: 2
inputs:
filePath: 'build/scripts/Build.ps1'
Expand Down
20 changes: 10 additions & 10 deletions build/scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Syntax:
Build.cmd [options]
Description:
Builds GIT services for Windows.
Builds GitHubExtension for Windows.
Options:
Expand Down Expand Up @@ -58,7 +58,7 @@ $env:msix_version = build\Scripts\CreateBuildInfo.ps1 -Version $Version -IsAzure
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')

# Set GitHub OAuth Client App configuration if build-time parameters are present
$OAuthConfigFilePath = (Join-Path $env:Build_RootDirectory "src\GithubPlugin\Configuration\OAuthConfiguration.cs")
$OAuthConfigFilePath = (Join-Path $env:Build_RootDirectory "src\GitHubExtension\Configuration\OAuthConfiguration.cs")
if (![string]::IsNullOrWhitespace($ClientId)) {
(Get-Content $OAuthConfigFilePath).Replace("%BUILD_TIME_GITHUB_CLIENT_ID_PLACEHOLDER%", $ClientId) | Set-Content $OAuthConfigFilePath
}
Expand Down Expand Up @@ -117,7 +117,7 @@ Try {
$uapAppExtension = [System.Xml.Linq.XName]::Get("{http://schemas.microsoft.com/appx/manifest/uap/windows10/3}AppExtension");

# Update the appxmanifest
$appxmanifestPath = (Join-Path $env:Build_RootDirectory "src\GithubPluginServer\Package.appxmanifest")
$appxmanifestPath = (Join-Path $env:Build_RootDirectory "src\GitHubExtensionServer\Package.appxmanifest")
$appxmanifest = [System.Xml.Linq.XDocument]::Load($appxmanifestPath)
$appxmanifest.Root.Element($xIdentity).Attribute("Version").Value = $env:msix_version
if (-not ([string]::IsNullOrEmpty($newPackageName))) {
Expand Down Expand Up @@ -148,22 +148,22 @@ Try {
foreach ($platform in $env:Build_Platform.Split(",")) {
foreach ($configuration in $env:Build_Configuration.Split(",")) {
$appxPackageDir = (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration")
$solutionPath = (Join-Path $env:Build_RootDirectory "GITServices.sln")
$solutionPath = (Join-Path $env:Build_RootDirectory "GitHubExtension.sln")
$msbuildArgs = @(
($solutionPath),
("/p:platform="+$platform),
("/p:configuration="+$configuration),
("/restore"),
("/binaryLogger:GITServices.$platform.$configuration.binlog"),
("/p:AppxPackageOutput=$appxPackageDir\GITServices-$platform.msix"),
("/binaryLogger:GitHubExtension.$platform.$configuration.binlog"),
("/p:AppxPackageOutput=$appxPackageDir\GitHubExtension-$platform.msix"),
("/p:AppxPackageSigningEnabled=false"),
("/p:GenerateAppxPackageOnBuild=true"),
("/p:BuildRing=$buildRing")
)

& $msbuildPath $msbuildArgs
if (-not($IsAzurePipelineBuild) -And $isAdmin) {
Invoke-SignPackage "$appxPackageDir\GITServices-$platform.msix"
Invoke-SignPackage "$appxPackageDir\GitHubExtension-$platform.msix"
}
}
}
Expand Down Expand Up @@ -193,9 +193,9 @@ Try {

if (($BuildStep -ieq "all") -Or ($BuildStep -ieq "msixbundle")) {
foreach ($configuration in $env:Build_Configuration.Split(",")) {
.\build\scripts\Create-AppxBundle.ps1 -InputPath (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration") -ProjectName GITServices -BundleVersion ([version]$env:msix_version) -OutputPath (Join-Path $env:Build_RootDirectory ("AppxBundles\$configuration\GITServices_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle"))
.\build\scripts\Create-AppxBundle.ps1 -InputPath (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration") -ProjectName GitHubExtension -BundleVersion ([version]$env:msix_version) -OutputPath (Join-Path $env:Build_RootDirectory ("AppxBundles\$configuration\GitHubExtension_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle"))
if (-not($IsAzurePipelineBuild) -And $isAdmin) {
Invoke-SignPackage ("AppxBundles\$configuration\GITServices_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle")
Invoke-SignPackage ("AppxBundles\$configuration\GitHubExtension_" + $env:msix_version + "_8wekyb3d8bbwe.msixbundle")
}
}
}
Expand All @@ -219,7 +219,7 @@ WARNING: Cert signing requires admin privileges. To sign, run the following in
foreach ($configuration in $env:Build_Configuration.Split(",")) {
$appxPackageDir = (Join-Path $env:Build_RootDirectory "AppxPackages\$configuration")
Write-Host @"
powershell -command "& { . build\scripts\CertSignAndInstall.ps1; Invoke-SignPackage $appxPackageDir\GITServices-$platform.msix }"
powershell -command "& { . build\scripts\CertSignAndInstall.ps1; Invoke-SignPackage $appxPackageDir\GitHubExtension-$platform.msix }"
"@ -ForegroundColor GREEN
}
}
Expand Down
14 changes: 7 additions & 7 deletions build/scripts/CertSignAndInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function Invoke-SignPackage([string]$Path) {
return
}

$certName = "Microsoft.GITServices"
$certName = "Microsoft.GitHubExtension"
$cert = Get-ChildItem 'Cert:\CurrentUser\My' | Where-Object {$_.FriendlyName -match $certName} | Select-Object -First 1

if ($cert) {
Expand All @@ -31,14 +31,14 @@ function Invoke-SignPackage([string]$Path) {
SignTool sign /fd SHA256 /sha1 $($cert.Thumbprint) $Path

if (-not(Test-Path Cert:\LocalMachine\TrustedPeople\$($cert.Thumbprint))) {
Export-Certificate -Cert $cert -FilePath "$($PSScriptRoot)\Microsoft.GITServices.cer" -Type CERT
Import-Certificate -FilePath "$($PSScriptRoot)\Microsoft.GITServices.cer" -CertStoreLocation Cert:\LocalMachine\TrustedPeople
Remove-Item -Path "$($PSScriptRoot)\Microsoft.GITServices.cer"
Export-Certificate -Cert $cert -FilePath "$($PSScriptRoot)\$($certName).cer" -Type CERT
Import-Certificate -FilePath "$($PSScriptRoot)\$($certName).cer" -CertStoreLocation Cert:\LocalMachine\TrustedPeople
Remove-Item -Path "$($PSScriptRoot)\$($certName).cer"
(Get-ChildItem Cert:\LocalMachine\TrustedPeople\$($cert.Thumbprint)).FriendlyName = $certName
}
}

function Remove-GITServiceseCertificates() {
Get-ChildItem 'Cert:\CurrentUser\My' | Where-Object {$_.FriendlyName -match 'Microsoft.GITServices'} | Remove-Item
Get-ChildItem 'Cert:\LocalMachine\TrustedPeople' | Where-Object {$_.FriendlyName -match 'Microsoft.GITServices'} | Remove-Item
function Remove-GitHubExtensionCertificates() {
Get-ChildItem 'Cert:\CurrentUser\My' | Where-Object {$_.FriendlyName -match 'Microsoft.GitHubExtension'} | Remove-Item
Get-ChildItem 'Cert:\LocalMachine\TrustedPeople' | Where-Object {$_.FriendlyName -match 'Microsoft.GitHubExtension'} | Remove-Item
}
2 changes: 1 addition & 1 deletion build/scripts/CreateBuildInfo.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Param(
)

$Major = "0"
$Minor = "5"
$Minor = "6"
$Patch = "99" # default to 99 for local builds

$versionSplit = $Version.Split(".");
Expand Down
Binary file removed build/scripts/Microsoft.GITServices.cer
Binary file not shown.
18 changes: 9 additions & 9 deletions build/scripts/Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Syntax:
Test.cmd [options]
Description:
Runs GITServices tests.
Runs GitHubExtension tests.
Options:
Expand Down Expand Up @@ -68,25 +68,25 @@ Try {
foreach ($configuration in $env:Build_Configuration.Split(",")) {
# TODO: UI tests are currently disabled in pipeline until signing is solved
if (-not($IsAzurePipelineBuild)) {
$Package = Get-AppPackage "GITServices"
$Package = Get-AppPackage "GitHubExtension"
if ($Package) {
Write-Host "Uninstalling old GITServices"
Write-Host "Uninstalling old GitHubExtension"
Remove-AppPackage -Package $Package.PackageFullName
}
Write-Host "Installing GITServices"
Add-AppPackage "AppxPackages\$platform\$configuration\GITServices.msix"
Write-Host "Installing GitHubExtension"
Add-AppPackage "AppxPackages\$platform\$configuration\GitHubExtension.msix"
}

$vstestArgs = @(
("/Platform:$platform"),
("/Logger:trx;LogFileName=GitHubPlugin.Test-$platform-$configuration.trx"),
("/Logger:trx;LogFileName=GitHubExtension.Test-$platform-$configuration.trx"),
("/TestCaseFilter:""TestCategory=Unit"""),
("BuildOutput\$configuration\$platform\GitHubPlugin.Test\GitHubPlugin.Test.dll")
("BuildOutput\$configuration\$platform\GitHubExtension.Test\GitHubExtension.Test.dll")
)
$winAppTestArgs = @(
("/Platform:$platform"),
("/Logger:trx;LogFileName=GITServices.UITest-$platform-$configuration.trx"),
("BuildOutput\$configuration\$platform\GITServices.UITest\GITServices.UITest.dll")
("/Logger:trx;LogFileName=GitHubExtension.UITest-$platform-$configuration.trx"),
("BuildOutput\$configuration\$platform\GitHubExtension.UITest\GitHubExtension.UITest.dll")
)

& $vstestPath $vstestArgs
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/Unstub.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Remove-Item "$($PSScriptRoot)\..\..\src\Telemetry\TelemetryEventSource.cs"

$projFile = "$($PSScriptRoot)\..\..\src\Telemetry\GITServices.Telemetry.csproj"
$projFile = "$($PSScriptRoot)\..\..\src\Telemetry\GitHubExtension.Telemetry.csproj"
$projFileContent = Get-Content $projFile -Encoding UTF8 -Raw

if ($projFileContent.Contains('Microsoft.Telemetry.Inbox.Managed')) {
Expand Down
8 changes: 4 additions & 4 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ Once you've discussed your proposed feature/fix/etc. with a team member, and you
- if it's not a code fix that effects the end user, the issue can be closed (for example a fix in the build or a code refactoring and so on).
-->

## Compiling GITServices
## Compiling GitHubExtension

### Compiling Source Code

There are two ways to compile locally.

- Open the Developer Command Prompt for Visual Studio
- Run `Build` from GITServices's root directory. You can pass in a list of platforms/configurations
- The GITServices MSIX will be in your repo under `AppxPackages\x64\debug`
- Run `Build` from GitHubExtension's root directory. You can pass in a list of platforms/configurations
- The GitHubExtension MSIX will be in your repo under `AppxPackages\x64\debug`

Alternatively

- Open `GITServices.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
- Open `GitHubExtension.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin.Client;
namespace GitHubExtension.Client;
public class InvalidUrlException : Exception
{
public InvalidUrlException()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Licensed under the MIT license.

using DevHome.Logging.Helpers;
using GitHubPlugin.DeveloperId;
using GitHubExtension.DeveloperId;
using Microsoft.Windows.DevHome.SDK;
using Octokit;

namespace GitHubPlugin.Client;
namespace GitHubExtension.Client;

public class GitHubClientProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.
using GitHubPlugin.DataModel;
using GitHubExtension.DataModel;

namespace GitHubPlugin.Client;
namespace GitHubExtension.Client;

// Validation layer to help parsing GitHub URL.
public static class Validation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin;
namespace GitHubExtension;
internal static class DeveloperOAuthConfiguration
{
//// Follow this link https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin;
namespace GitHubExtension;
internal static class OauthConfiguration
{
// This redirect url has to be configured into the OAuth app. This package has "devhome://"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin;
namespace GitHubExtension;
internal class Constants
{
#pragma warning disable SA1310 // Field names should not contain underscore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin.DataManager;
namespace GitHubExtension.DataManager;

public delegate void DataManagerUpdateEventHandler(object? source, DataManagerUpdateEventArgs e);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

using GitHubPlugin.DeveloperId;
using GitHubExtension.DeveloperId;
using Microsoft.Windows.DevHome.SDK;

namespace GitHubPlugin;
namespace GitHubExtension;
public class DataStoreOperationParameters
{
// parameters for updating the data store.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin.DataManager;
namespace GitHubExtension.DataManager;
public class DataUpdater : IDisposable
{
// This is the default interval the timer will run. It is not the interval that we necessarily do work.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin.DataManager;
namespace GitHubExtension.DataManager;

public enum SearchCategory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

namespace GitHubPlugin;
namespace GitHubExtension;
public class RepositoryNotFoundException : ApplicationException
{
public RepositoryNotFoundException()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

using GitHubPlugin.Client;
using GitHubPlugin.DataManager;
using GitHubPlugin.DataModel;
using GitHubPlugin.Helpers;
using GitHubExtension.Client;
using GitHubExtension.DataManager;
using GitHubExtension.DataModel;
using GitHubExtension.Helpers;
using Windows.Storage;

namespace GitHubPlugin;
namespace GitHubExtension;
public partial class GitHubDataManager : IGitHubDataManager, IDisposable
{
public static event DataManagerUpdateEventHandler? OnUpdate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Copyright (c) Microsoft Corporation and Contributors
// Licensed under the MIT license.

using GitHubPlugin.DataManager;
using GitHubPlugin.DataModel;
using GitHubExtension.DataManager;
using GitHubExtension.DataModel;

namespace GitHubPlugin;
namespace GitHubExtension;
public partial class GitHubDataManager
{
// This is how frequently the DataStore update occurs.
Expand Down
Loading

0 comments on commit 4ffb4bc

Please sign in to comment.