Skip to content

Commit

Permalink
Merge pull request #2110 from microsoftgraph/dev
Browse files Browse the repository at this point in the history
Merge branch Dev into Master
  • Loading branch information
fey101 authored Jul 24, 2024
2 parents 933293f + 61d9e48 commit d041e26
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.15" />
<PackageReference Include="System.Text.Json" Version="8.0.3" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions ExceptionMiddleware/ExceptionMiddleware.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions FileService.Test/FileService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion FileService/FileService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="Azure.Identity" Version="1.12.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.20.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.21.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions GraphWebApi/GraphWebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@
<PackageReference Include="Microsoft.ApplicationInsights.Web" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.0.7" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.3" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.3" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="4.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions KnownIssuesService.Test/KnownIssuesService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions OpenAPIService.Test/OpenAPIService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.15" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions OpenAPIService/OpenAPIService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<ItemGroup>
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageReference Include="Microsoft.OData.Edm" Version="7.21.3" />
<PackageReference Include="Microsoft.OpenApi" Version="1.6.15" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.6" />
<PackageReference Include="Microsoft.OpenApi.OData" Version="1.6.7" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="1.6.15" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions PermissionsService.Test/PermissionsService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions PermissionsService/PermissionsService.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageReference Include="Microsoft.Graph.Kibali" Version="0.19.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Graph.Kibali" Version="0.21.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions SamplesService.Test/SamplesService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions TelemetryService.Test/TelemetrySanitizerService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions UriMatchService.Test/UriMatchingService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions UtilityService.Test/UtilityService.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
27 changes: 19 additions & 8 deletions pipelines/snippets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resources:
ref: main

pool:
vmImage: 'ubuntu-latest'
name: 1es-ubuntu-latest


parameters:
Expand Down Expand Up @@ -178,6 +178,7 @@ stages:
inputs:
artifact: 'Generation Test Results'
path: '$(Build.ArtifactStagingDirectory)/TestResults'

- pwsh: |
Write-Host "Installing module ImportExcel"
Install-Module -Name ImportExcel -Scope CurrentUser -Force -AllowClobber
Expand All @@ -188,19 +189,29 @@ stages:
workingDirectory: '$(Build.SourcesDirectory)'
- pwsh: |
Write-Host "create file appSettings.json in the workingDirectory"
New-Item -Path $(Build.SourcesDirectory) -Name "appSettings.json" -ItemType "file" -Force
Write-Host "Creating folder Reports"
New-Item -Path $(Build.SourcesDirectory) -Name "Reports" -ItemType "Directory" -Force
displayName: Create requisite directory items
- pwsh: |
$ErrorActionPreference="Continue"
$(Build.SourcesDirectory)/scripts/categorizeErrors.ps1 -trxFolderPath '$(Build.ArtifactStagingDirectory)/TestResults/' -txtOutputFolderPath '$(Build.ArtifactStagingDirectory)/Reports/'
- task: AzurePowerShell@5
inputs:
azureSubscription: "RaptorServiceFederationConnection"
ScriptType: "FilePath"
ScriptPath: "$(Build.SourcesDirectory)/scripts/categorizeErrors.ps1"
ScriptArguments: "
-trxFolderPath '$(Build.ArtifactStagingDirectory)/TestResults/'
-reportOutputPath '$(Build.ArtifactStagingDirectory)/Reports/'
-snippetsBaseErrorPath '$(Build.ArtifactStagingDirectory)'
"
workingDirectory: '$(Build.SourcesDirectory)'
pwsh: true
azurePowerShellVersion: latestVersion
failOnStandardError: true
displayName: Generate error category report
workingDirectory: '$(Build.SourcesDirectory)'
env:
RAPTOR_CONFIGCONNECTIONSTRING: $(RAPTOR_CONFIGCONNECTIONSTRING)
RAPTOR_CONFIGENDPOINT: $(RAPTOR_CONFIGENDPOINT)
RAPTOR_CONFIGMANAGEDIDENTITY_ID: $(RAPTOR_CONFIGMANAGEDIDENTITY_ID)
WorkingDirectory: '$(Build.SourcesDirectory)'
continueOnError: true

- task: PublishBuildArtifacts@1
Expand Down
15 changes: 9 additions & 6 deletions scripts/categorizeErrors.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
param(
[Parameter(Mandatory=$true)]
[string]$trxFolderPath,
[Parameter(Mandatory=$true)]
[string]$snippetsBaseErrorPath,
[Parameter(Mandatory=$false)]
[string]$txtOutputFolderPath
[string]$reportOutputPath
)

Import-Module ImportExcel
Expand All @@ -13,10 +15,10 @@ if (!(Test-Path $trxFolderPath))
exit
}

#if $txtOutputFolderPath is not set, use current directory
if (-not $txtOutputFolderPath)
#if $reportOutputPath is not set, use current directory
if (-not $reportOutputPath)
{
$txtOutputFolderPath = $PSScriptRoot
$reportOutputPath = $PSScriptRoot
}

$outcomeLocal = "Failed" # Only process failed tests
Expand All @@ -36,7 +38,8 @@ $invalidStart = @()
$other = @()

$files = Get-ChildItem -Path $trxFolderPath -Exclude "http*"
$SpecificErrorPattern = "/home/vsts/work/1/a/Snippets/"

$SpecificErrorPattern = "$snippetsBaseErrorPath/Snippets/"
foreach ($trxFilePath in $files){
Write-Host "Processing file $trxFilePath"
[xml]$xmlContent = Get-Content $trxFilePath
Expand Down Expand Up @@ -109,7 +112,7 @@ foreach ($trxFilePath in $files){

}

$excelOutputPath = Join-Path $txtOutputFolderPath "report.xlsx"
$excelOutputPath = Join-Path $reportOutputPath "report.xlsx"
$methodNotFound | Export-Excel -Path $excelOutputPath -WorksheetName "MethodNotFound" -AutoSize
$pathNotFound | Export-Excel -Path $excelOutputPath -WorksheetName "PathNotFound" -AutoSize
$invalidStart | Export-Excel -Path $excelOutputPath -WorksheetName "InvalidStart" -AutoSize
Expand Down
29 changes: 25 additions & 4 deletions scripts/getWorkloadOwner.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,37 @@ function Get-AppSettings ()
return $AppSettings
}
# read app settings from Azure App Config
$appSettingsPath = "./appSettings.json"
$baseSettingsDirectory = $env:WorkingDirectory
if (!$baseSettingsDirectory)
{
$baseSettingsDirectory = $env:TEMP
}
New-Item -Path $baseSettingsDirectory -Name "appSettings.json" -Force
$appSettingsPath = Join-Path $baseSettingsDirectory "appSettings.json" -Resolve
write-host "appsettings path: $appSettingsPath"
# Support Reading Settings from a Custom Label, otherwise default to Development
$settingsLabel = $env:RAPTOR_CONFIGLABEL
if ([string]::IsNullOrWhiteSpace($settingsLabel))
{
$settingsLabel = "Development"
}
az appconfig kv export --connection-string $env:RAPTOR_CONFIGCONNECTIONSTRING --label $settingsLabel --destination file --path $appSettingsPath --format json --yes
$appSettings = Get-Content $AppSettingsPath -Raw | ConvertFrom-Json
Remove-Item $appSettingsPath
try {
az login --identity -u $env:RAPTOR_CONFIGMANAGEDIDENTITY_ID #Pipeline login
# Disable below to test locally
# az login
Write-Host "Login successful. Fetching AppSettings from Azure App Config."
}
catch {
Write-Host "Failed to login using Managed Identity."
}
try {
az appconfig kv export --endpoint $env:RAPTOR_CONFIGENDPOINT --auth-mode login --label $settingsLabel --destination file --path $appSettingsPath --format json --yes
$appSettings = Get-Content $AppSettingsPath -Raw | ConvertFrom-Json
Remove-Item $appSettingsPath
}
catch {
Write-Host "Failed to fetch AppSettings from Azure App Config."
}

if ( !$appSettings.CertificateThumbprint `
-or !$appSettings.ClientID `
Expand Down

0 comments on commit d041e26

Please sign in to comment.