From c2d453afea1c02f92d8a2ad6441f8f3959d87c0e Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Mon, 7 Feb 2022 10:59:49 -0800 Subject: [PATCH 01/78] Use latest darc version (#1463) * Add optional darc version parameter --- eng/release/Scripts/AcquireBuild.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/release/Scripts/AcquireBuild.ps1 b/eng/release/Scripts/AcquireBuild.ps1 index b213d711d1b..d0d99353007 100644 --- a/eng/release/Scripts/AcquireBuild.ps1 +++ b/eng/release/Scripts/AcquireBuild.ps1 @@ -7,6 +7,7 @@ param( [Parameter(Mandatory=$true)][string] $MaestroToken, [Parameter(Mandatory=$true)][string] $GitHubToken, [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', + [Parameter(Mandatory=$false)][string] $DarcVersion = $null, [switch] $help, [Parameter(ValueFromRemainingArguments=$true)][String[]]$properties ) @@ -45,7 +46,7 @@ try { } catch{ . $PSScriptRoot\..\..\common\tools.ps1 - $darc = Get-Darc "1.1.0-beta.20602.1" + $darc = Get-Darc $DarcVersion } & $darc gather-drop ` From 676f1e487bff36cf135aac14379574b8da1326ba Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Mon, 7 Feb 2022 12:12:41 -0800 Subject: [PATCH 02/78] Add common release scripts (#1462) --- eng/release/Scripts/GetBarId.ps1 | 46 +++++++++++++++++++++++ eng/release/Scripts/GetReleaseVersion.ps1 | 40 ++++++++++++++++++++ eng/release/Scripts/SetTaskVariable.ps1 | 10 +++++ 3 files changed, 96 insertions(+) create mode 100644 eng/release/Scripts/GetBarId.ps1 create mode 100644 eng/release/Scripts/GetReleaseVersion.ps1 create mode 100644 eng/release/Scripts/SetTaskVariable.ps1 diff --git a/eng/release/Scripts/GetBarId.ps1 b/eng/release/Scripts/GetBarId.ps1 new file mode 100644 index 00000000000..3a931d7e7c2 --- /dev/null +++ b/eng/release/Scripts/GetBarId.ps1 @@ -0,0 +1,46 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string] $BuildId, + [Parameter(Mandatory=$false)][string] $TaskVariableName = $null +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +if ([String]::IsNullOrEmpty($env:System_AccessToken)) { + Write-Error 'System access token missing, this script needs access.' +} + +$tagsUri = "${env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI}${env:SYSTEM_TEAMPROJECT}/_apis/build/builds/$BuildId/tags?api-version=6.0" +$buildData = Invoke-RestMethod ` + -Uri $tagsUri ` + -Method 'GET' ` + -Headers @{ 'accept' = 'application/json'; 'Authorization' = "Bearer ${env:System_AccessToken}" } + +Write-Verbose 'BuildData:' +$buildDataJson = $buildData | ConvertTo-Json +Write-Verbose $buildDataJson + +$barId = -1; +$buildData.Value | Foreach-Object { + if ($_.StartsWith('BAR ID - ')) { + if ($barId -ne -1) { + Write-Error 'Multiple BAR IDs found in tags.' + } + $barId = $_.SubString(9) + } +} + +if ($barId -eq -1) { + Write-Error 'Failed to get BAR ID from tags.' +} + +Write-Verbose "BAR ID: $barId" + +if ($TaskVariableName) { + & $PSScriptRoot\SetTaskVariable.ps1 ` + -Name $TaskVariableName ` + -Value $barId +} + +Write-Output $barId \ No newline at end of file diff --git a/eng/release/Scripts/GetReleaseVersion.ps1 b/eng/release/Scripts/GetReleaseVersion.ps1 new file mode 100644 index 00000000000..0855a2baa87 --- /dev/null +++ b/eng/release/Scripts/GetReleaseVersion.ps1 @@ -0,0 +1,40 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string] $BarId, + [Parameter(Mandatory=$true)][string] $MaestroToken, + [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', + [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2020-02-20', + [Parameter(Mandatory=$false)][string] $TaskVariableName = $null, + [Parameter(Mandatory=$false)][switch] $IncludeV +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$releaseData = Invoke-RestMethod ` + -Uri "$MaestroApiEndPoint/api/assets?buildId=$BarId&name=dotnet-monitor&api-version=$MaestroApiVersion" ` + -Method 'GET' ` + -Headers @{ 'accept' = 'application/json'; 'Authorization' = "Bearer $MaestroToken" } + +Write-Verbose 'ReleaseData:' +$releaseDataJson = $releaseData | ConvertTo-Json +Write-Verbose $releaseDataJson + +if ($releaseData.Length -ne 1) { + Write-Error 'Unable to obtain release version' +} + +$version = $releaseData[0].Version +if ($IncludeV) { + $version = "v$version" +} + +Write-Verbose "Release Version: $version" + +if ($TaskVariableName) { + & $PSScriptRoot\SetTaskVariable.ps1 ` + -Name $TaskVariableName ` + -Value $version +} + +Write-Output $version \ No newline at end of file diff --git a/eng/release/Scripts/SetTaskVariable.ps1 b/eng/release/Scripts/SetTaskVariable.ps1 new file mode 100644 index 00000000000..0db85fd9142 --- /dev/null +++ b/eng/release/Scripts/SetTaskVariable.ps1 @@ -0,0 +1,10 @@ +param( + [Parameter(Mandatory=$true)][string] $Name, + [Parameter(Mandatory=$false)][string] $Value +) + +$ErrorActionPreference = 'Stop' +$VerbosePreference = 'Continue' +Set-StrictMode -Version 2.0 + +Write-Host "##vso[task.setvariable variable=$Name]$Value" \ No newline at end of file From c621fbf750aee08eacc065e33b49051d81b8e028 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Mon, 7 Feb 2022 12:30:21 -0800 Subject: [PATCH 03/78] 6.0.2 Release Notes (#1461) --- documentation/releaseNotes/releaseNotes.v6.0.2.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 documentation/releaseNotes/releaseNotes.v6.0.2.md diff --git a/documentation/releaseNotes/releaseNotes.v6.0.2.md b/documentation/releaseNotes/releaseNotes.v6.0.2.md new file mode 100644 index 00000000000..4415964c38a --- /dev/null +++ b/documentation/releaseNotes/releaseNotes.v6.0.2.md @@ -0,0 +1,7 @@ +Today we are releasing the 6.0.2 build of the `dotnet-monitor` tool. This release includes: + +- Ensure dump folder exists before capturing dump (#1216) +- Ensure `config show` command completely writes end of configuration (#1112) +- Allow command line parameters to be overriden by file-based configuration (#1102) +- Allow command line parameters to be overriden by environment variables (#1398) +- Fix `generatekey` command `output` parameter description (#1119) From 5475f72d0efb032a05e7850473213132a01f140a Mon Sep 17 00:00:00 2001 From: Juan Hoyos Date: Mon, 7 Feb 2022 16:31:39 -0800 Subject: [PATCH 04/78] Update AcquireBuild.ps1 --- eng/release/Scripts/AcquireBuild.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eng/release/Scripts/AcquireBuild.ps1 b/eng/release/Scripts/AcquireBuild.ps1 index d0d99353007..ecab93729fb 100644 --- a/eng/release/Scripts/AcquireBuild.ps1 +++ b/eng/release/Scripts/AcquireBuild.ps1 @@ -59,6 +59,7 @@ try { --azdev-pat $AzdoToken ` --bar-uri $MaestroApiEndPoint ` --password $MaestroToken ` + --separated ` --verbose if ($LastExitCode -ne 0) { @@ -71,4 +72,4 @@ try { } catch { Write-Host $_ -} \ No newline at end of file +} From c11cb56c97f039cd11c415b345fc8e0782309a05 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 19:06:46 -0800 Subject: [PATCH 05/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220204.1 (#1459) Microsoft.Diagnostics.Monitoring.EventPipe , Microsoft.Diagnostics.Monitoring From Version 5.0.0-preview.22102.2 -> To Version 5.0.0-preview.22104.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f029f443708..f57a21807df 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - d631e5c78205e71cb5174652ff2e19c5394222da + 4b75504adcbf5f4f7f283ca3ba54a82d9276bb28 - + https://github.com/dotnet/diagnostics - d631e5c78205e71cb5174652ff2e19c5394222da + 4b75504adcbf5f4f7f283ca3ba54a82d9276bb28 diff --git a/eng/Versions.props b/eng/Versions.props index 1d81a5379f6..ff4a8aa578c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22104.1 7.0.0-preview.2.22104.1 - 5.0.0-preview.22102.2 - 5.0.0-preview.22102.2 + 5.0.0-preview.22104.1 + 5.0.0-preview.22104.1 7.0.0-preview.2.22103.2 7.0.0-preview.2.22103.2 From e0b31aa40abe94a75beb7aeb499031d1b7c04b38 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 7 Feb 2022 19:07:06 -0800 Subject: [PATCH 06/78] [main] Update dependencies from dotnet/aspnetcore (#1460) * Update dependencies from https://github.com/dotnet/aspnetcore build 20220204.13 Microsoft.AspNetCore.App.Runtime.win-x64 , VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0 From Version 7.0.0-preview.2.22104.1 -> To Version 7.0.0-preview.2.22104.13 * Update dependencies from https://github.com/dotnet/aspnetcore build 20220205.3 Microsoft.AspNetCore.App.Runtime.win-x64 , VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0 From Version 7.0.0-preview.2.22104.1 -> To Version 7.0.0-preview.2.22105.3 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f57a21807df..a974ff9e25a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - ed1ac4285213158a85f69449dba448ef0c65fbf4 + 414e7573284cb19c8465ee6aaa1fe9900ab5df8f https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 0ae04e5b33afac1c14a6127df1037f83d39a6ec3 - + https://github.com/dotnet/aspnetcore - ed1ac4285213158a85f69449dba448ef0c65fbf4 + 414e7573284cb19c8465ee6aaa1fe9900ab5df8f https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index ff4a8aa578c..808157b16c7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22103.1 - 7.0.0-preview.2.22104.1 - 7.0.0-preview.2.22104.1 + 7.0.0-preview.2.22105.3 + 7.0.0-preview.2.22105.3 5.0.0-preview.22104.1 5.0.0-preview.22104.1 From 7aa5bf48b14d6e2bbd1348364e8faa86af0f24bd Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 14:51:34 +0000 Subject: [PATCH 07/78] Update dependencies from https://github.com/dotnet/runtime build 20220207.26 (#1473) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a974ff9e25a..a62cdbb24a4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore deba0030bc4777ab0a225c11d0dcde6779d3fd3d - + https://github.com/dotnet/runtime - 0ae04e5b33afac1c14a6127df1037f83d39a6ec3 + af42c8ee4e1f0e420605f928cded476520296ced https://github.com/dotnet/aspnetcore 414e7573284cb19c8465ee6aaa1fe9900ab5df8f - + https://github.com/dotnet/runtime - 0ae04e5b33afac1c14a6127df1037f83d39a6ec3 + af42c8ee4e1f0e420605f928cded476520296ced diff --git a/eng/Versions.props b/eng/Versions.props index 808157b16c7..12d55288603 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22104.1 5.0.0-preview.22104.1 - 7.0.0-preview.2.22103.2 - 7.0.0-preview.2.22103.2 + 7.0.0-preview.2.22107.26 + 7.0.0-preview.2.22107.26 1.0.310102 From b5fea8d9ec7f03267fcf5560f9e2e88d68681c15 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 17:29:26 +0000 Subject: [PATCH 08/78] Update dependencies from https://github.com/dotnet/symstore build 20220207.1 (#1472) [main] Update dependencies from dotnet/symstore --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a62cdbb24a4..061773650b8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -26,9 +26,9 @@ https://github.com/dotnet/arcade 70831f0d126fe88b81d7dc8de11358e17a5ce364 - + https://github.com/dotnet/symstore - deba0030bc4777ab0a225c11d0dcde6779d3fd3d + fed6eefe34de9690712e2ada8a2f7e6a9555b76d https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 12d55288603..700a510c333 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,7 +53,7 @@ 7.0.0-preview.2.22107.26 7.0.0-preview.2.22107.26 - 1.0.310102 + 1.0.310701 3.1.22 From a61522a085aaa91b3ca60977c7b8253d36e0e8af Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 17:33:43 +0000 Subject: [PATCH 09/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220208.1 (#1474) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 061773650b8..88a39898ab6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 414e7573284cb19c8465ee6aaa1fe9900ab5df8f + 3b8ce2746c6835690a4e1b9c97e3a9ea43844909 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime af42c8ee4e1f0e420605f928cded476520296ced - + https://github.com/dotnet/aspnetcore - 414e7573284cb19c8465ee6aaa1fe9900ab5df8f + 3b8ce2746c6835690a4e1b9c97e3a9ea43844909 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 700a510c333..c59740d6399 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22103.1 - 7.0.0-preview.2.22105.3 - 7.0.0-preview.2.22105.3 + 7.0.0-preview.2.22108.1 + 7.0.0-preview.2.22108.1 5.0.0-preview.22104.1 5.0.0-preview.22104.1 From 9021d4c4288d270db589623d6232d3947fe01136 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 18:02:26 +0000 Subject: [PATCH 10/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220207.1 (#1471) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 88a39898ab6..233f5e04560 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 4b75504adcbf5f4f7f283ca3ba54a82d9276bb28 + 243cebb165dd61b90f4bf7a7c7097880c4cf1469 - + https://github.com/dotnet/diagnostics - 4b75504adcbf5f4f7f283ca3ba54a82d9276bb28 + 243cebb165dd61b90f4bf7a7c7097880c4cf1469 diff --git a/eng/Versions.props b/eng/Versions.props index c59740d6399..363e6626b97 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22108.1 7.0.0-preview.2.22108.1 - 5.0.0-preview.22104.1 - 5.0.0-preview.22104.1 + 5.0.0-preview.22107.1 + 5.0.0-preview.22107.1 7.0.0-preview.2.22107.26 7.0.0-preview.2.22107.26 From aa76fa29a2422c50025c844076ada5c24f1955e5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 14:58:33 +0000 Subject: [PATCH 11/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220208.14 (#1482) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 233f5e04560..ec2f0f58b0f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 3b8ce2746c6835690a4e1b9c97e3a9ea43844909 + 1e21fb868bfa327b337d5c4712a0333d343e62c4 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime af42c8ee4e1f0e420605f928cded476520296ced - + https://github.com/dotnet/aspnetcore - 3b8ce2746c6835690a4e1b9c97e3a9ea43844909 + 1e21fb868bfa327b337d5c4712a0333d343e62c4 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 363e6626b97..77c417156e0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22103.1 - 7.0.0-preview.2.22108.1 - 7.0.0-preview.2.22108.1 + 7.0.0-preview.2.22108.14 + 7.0.0-preview.2.22108.14 5.0.0-preview.22107.1 5.0.0-preview.22107.1 From 253f17ff377a1c88894dcb556652f1e1b4c70426 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Wed, 9 Feb 2022 11:51:17 -0500 Subject: [PATCH 12/78] Create releaseNotes.v6.1.0.md (#1478) --- documentation/releaseNotes/releaseNotes.v6.1.0.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 documentation/releaseNotes/releaseNotes.v6.1.0.md diff --git a/documentation/releaseNotes/releaseNotes.v6.1.0.md b/documentation/releaseNotes/releaseNotes.v6.1.0.md new file mode 100644 index 00000000000..5b6749261c7 --- /dev/null +++ b/documentation/releaseNotes/releaseNotes.v6.1.0.md @@ -0,0 +1,7 @@ +Today we are releasing the 6.1.0 build of the `dotnet monitor` tool. This release includes: + +- Load a profiler via a collection rule action (#781) +- Get or Set an environment variable via a collection rule action (#1176) +- Add `MachineJson` option to `--output` parameter for `generatekey` command. This is useful for automating credential provisioning. (#1428) +- Allow for simplified diagnostic port configuration (#1292) +- Ensure `config show` command displays arrays without indices (#1054) From 33839ce67c410b7ea1030c251644a3ac7bf394ff Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Wed, 9 Feb 2022 09:46:08 -0800 Subject: [PATCH 13/78] Release tool updates (#1477) - Change NugetLayoutWorker to only consider files under the packages directory - Add checksum file to ChecksumAssets in publish manifest - Add unprocessed files to BlobAssets in publish manifest - Add --dry-run option to run tool without publishing --- .../Common/BlobLayoutWorker.cs | 14 ++++++++++ .../Common/ChecksumLayoutWorker.cs | 14 ++++++++++ .../Common/NugetLayoutWorker.cs | 5 ++-- .../Common/SkipPublisher.cs | 27 +++++++++++++++++++ .../Core/FileMetadata.cs | 2 ++ .../DiagnosticsReleaseTool/Core/Release.cs | 11 +++----- .../DiagnosticsReleaseTool/DarcHelpers.cs | 5 ++++ .../DiagnosticsReleaseCommandLine.cs | 10 +++++-- .../DiagnosticsReleaseRunner.cs | 16 ++++++----- .../DiagnosticsRepoHelpers.cs | 3 +-- 10 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 eng/release/DiagnosticsReleaseTool/Common/BlobLayoutWorker.cs create mode 100644 eng/release/DiagnosticsReleaseTool/Common/ChecksumLayoutWorker.cs create mode 100644 eng/release/DiagnosticsReleaseTool/Common/SkipPublisher.cs diff --git a/eng/release/DiagnosticsReleaseTool/Common/BlobLayoutWorker.cs b/eng/release/DiagnosticsReleaseTool/Common/BlobLayoutWorker.cs new file mode 100644 index 00000000000..d264d2bac9d --- /dev/null +++ b/eng/release/DiagnosticsReleaseTool/Common/BlobLayoutWorker.cs @@ -0,0 +1,14 @@ +using System.IO; + +namespace ReleaseTool.Core +{ + public sealed class BlobLayoutWorker : PassThroughLayoutWorker + { + public BlobLayoutWorker(string stagingPath) : base( + shouldHandleFileFunc: static _ => true, + getRelativePublishPathFromFileFunc: static file => Helpers.GetDefaultPathForFileCategory(file, FileClass.Blob), + getMetadataForFileFunc: static file => Helpers.GetDefaultFileMetadata(file, FileClass.Blob), + stagingPath + ){} + } +} \ No newline at end of file diff --git a/eng/release/DiagnosticsReleaseTool/Common/ChecksumLayoutWorker.cs b/eng/release/DiagnosticsReleaseTool/Common/ChecksumLayoutWorker.cs new file mode 100644 index 00000000000..47f2bacb962 --- /dev/null +++ b/eng/release/DiagnosticsReleaseTool/Common/ChecksumLayoutWorker.cs @@ -0,0 +1,14 @@ +using System.IO; + +namespace ReleaseTool.Core +{ + public sealed class ChecksumLayoutWorker : PassThroughLayoutWorker + { + public ChecksumLayoutWorker(string stagingPath) : base( + shouldHandleFileFunc: static file => file.Extension == ".sha512", + getRelativePublishPathFromFileFunc: static file => Helpers.GetDefaultPathForFileCategory(file, FileClass.Checksum), + getMetadataForFileFunc: static file => Helpers.GetDefaultFileMetadata(file, FileClass.Checksum), + stagingPath + ){} + } +} \ No newline at end of file diff --git a/eng/release/DiagnosticsReleaseTool/Common/NugetLayoutWorker.cs b/eng/release/DiagnosticsReleaseTool/Common/NugetLayoutWorker.cs index d187b900119..7e5c231ef81 100644 --- a/eng/release/DiagnosticsReleaseTool/Common/NugetLayoutWorker.cs +++ b/eng/release/DiagnosticsReleaseTool/Common/NugetLayoutWorker.cs @@ -1,11 +1,12 @@ +using System; using System.IO; namespace ReleaseTool.Core { public sealed class NugetLayoutWorker : PassThroughLayoutWorker { - public NugetLayoutWorker(string stagingPath) : base( - shouldHandleFileFunc: static file => file.Extension == ".nupkg" && !file.Name.EndsWith(".symbols.nupkg"), + public NugetLayoutWorker(string stagingPath, Func additionalFileConstraint = null) : base( + shouldHandleFileFunc: file => file.Extension == ".nupkg" && (null == additionalFileConstraint || additionalFileConstraint(file)), getRelativePublishPathFromFileFunc: static file => Helpers.GetDefaultPathForFileCategory(file, FileClass.Nuget), getMetadataForFileFunc: static file => Helpers.GetDefaultFileMetadata(file, FileClass.Nuget), stagingPath diff --git a/eng/release/DiagnosticsReleaseTool/Common/SkipPublisher.cs b/eng/release/DiagnosticsReleaseTool/Common/SkipPublisher.cs new file mode 100644 index 00000000000..e933df68616 --- /dev/null +++ b/eng/release/DiagnosticsReleaseTool/Common/SkipPublisher.cs @@ -0,0 +1,27 @@ +using ReleaseTool.Core; +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; + +namespace ReleaseTool.Core +{ + internal class SkipPublisher : IPublisher + { + private readonly HashSet _relativeOutputPaths = new(StringComparer.OrdinalIgnoreCase); + + public void Dispose() + { + } + + public Task PublishFileAsync(FileMapping fileData, CancellationToken ct) + { + if (!_relativeOutputPaths.Add(fileData.RelativeOutputPath)) + { + throw new InvalidOperationException($"File {fileData.LocalSourcePath} was already published to {fileData.RelativeOutputPath}."); + } + + return Task.FromResult(fileData.RelativeOutputPath); + } + } +} diff --git a/eng/release/DiagnosticsReleaseTool/Core/FileMetadata.cs b/eng/release/DiagnosticsReleaseTool/Core/FileMetadata.cs index ca9c327c813..f741aba13f7 100644 --- a/eng/release/DiagnosticsReleaseTool/Core/FileMetadata.cs +++ b/eng/release/DiagnosticsReleaseTool/Core/FileMetadata.cs @@ -7,6 +7,7 @@ public enum FileClass Blob, Nuget, SymbolPackage, + Checksum, Unknown } @@ -66,6 +67,7 @@ public FileMetadata(FileClass fileClass, string assetCategory, bool shouldPublis FileClass.Blob => "BlobAssets", FileClass.Nuget => "NugetAssets", FileClass.SymbolPackage => "SymbolNugetAssets", + FileClass.Checksum => "ChecksumAssets", FileClass.Unknown => "UnknownAssets", _ => "UnknownAssets" }; diff --git a/eng/release/DiagnosticsReleaseTool/Core/Release.cs b/eng/release/DiagnosticsReleaseTool/Core/Release.cs index 7c2f2dcb696..d63e4d84726 100644 --- a/eng/release/DiagnosticsReleaseTool/Core/Release.cs +++ b/eng/release/DiagnosticsReleaseTool/Core/Release.cs @@ -224,14 +224,6 @@ private async Task LayoutFilesAsync(CancellationToken ct) if (layoutResult.Status == LayoutResultStatus.FileHandled) { - if (isProcessed) - { - // TODO: Might be worth to relax this limitation. It just needs to turn the - // source -> fileData relationship to something like source -> List). - _logger.LogError("[{buildFilePath}, {worker}] File {file} is getting handled by several workers.", file.FullName, worker.GetType().FullName, file); - return -1; - } - isProcessed = true; (FileMapping fileMap, FileMetadata fileMetadata)[] layoutResultArray = layoutResult.LayoutDataEnumerable.ToArray(); @@ -261,6 +253,9 @@ private async Task LayoutFilesAsync(CancellationToken ct) _logger.LogTrace("[{buildFilePath}, {worker}, {layoutInd}: {srcPath} -> {dstPath}, {fileMetadata}] adding layout to release data.", file.FullName, worker.GetType().FullName, i, srcPath, dstPath, fileMetadata); _filesToRelease.Add(new FileReleaseData(fileMap, fileMetadata)); } + + // Skip remaining layout workers + break; } } diff --git a/eng/release/DiagnosticsReleaseTool/DarcHelpers.cs b/eng/release/DiagnosticsReleaseTool/DarcHelpers.cs index 704a2ca3173..8b07524379b 100644 --- a/eng/release/DiagnosticsReleaseTool/DarcHelpers.cs +++ b/eng/release/DiagnosticsReleaseTool/DarcHelpers.cs @@ -96,5 +96,10 @@ internal DirectoryInfo GetShippingDirectoryForSingleProjectVariants(IEnumerable< return new DirectoryInfo(matchingProducts.First().GetProperty("fileshare").GetString()); } } + + internal static bool IsNuGetPackage(FileInfo file) + { + return file.Extension == ".nupkg" && file.Directory.Name == "packages"; + } } } diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs index 2071a7dc0d7..f1a4d63675e 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseCommandLine.cs @@ -27,11 +27,11 @@ public static Command PrepareRelease() => name: "prepare-release", description: "Given a darc drop, generates validated manifests and layouts to initiate a tool release.") { - CommandHandler.Create(DiagnosticsReleaseRunner.PrepareRelease), + CommandHandler.Create(DiagnosticsReleaseRunner.PrepareRelease), // Inputs InputDropPathOption(), ToolManifestPathOption(), ReleaseNameOption(), // Toggles - ToolManifestVerificationOption(), DiagnosticLoggingOption(), + ToolManifestVerificationOption(), DiagnosticLoggingOption(), DryRunOption(), // Outputs StagingPathOption(), AzureStorageAccountNameOption(), AzureStorageAccountKeyOption(), AzureStorageContainerNameOption(), AzureStorageSasExpirationOption() }; @@ -42,6 +42,12 @@ private static Option DiagnosticLoggingOption() => description: "Enables diagnostic logging", getDefaultValue: () => false); + private static Option DryRunOption() => + new Option( + aliases: new[] { "--dry-run" }, + description: "Stages files and generates manifest, but does not publish.", + getDefaultValue: () => false); + private static Option ToolManifestPathOption() => new Option( aliases: new[] { "--tool-manifest", "-t" }, diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs index ffeea178618..9d2131ca1fc 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsReleaseRunner.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -using System; namespace DiagnosticsReleaseTool.Impl { @@ -16,7 +15,7 @@ internal class DiagnosticsReleaseRunner { internal const string ManifestName = "publishManifest.json"; - internal async static Task PrepareRelease(Config releaseConfig, bool verbose, CancellationToken ct) + internal async static Task PrepareRelease(Config releaseConfig, bool verbose, bool dryRun, CancellationToken ct) { // TODO: This will throw if invalid drop path is given. var darcLayoutHelper = new DarcHelpers(releaseConfig.DropPath); @@ -26,11 +25,12 @@ internal async static Task PrepareRelease(Config releaseConfig, bool verbos var layoutWorkerList = new List { // TODO: We may want to inject a logger. - new NugetLayoutWorker(stagingPath: releaseConfig.StagingDirectory.FullName), + new NugetLayoutWorker(stagingPath: releaseConfig.StagingDirectory.FullName, DarcHelpers.IsNuGetPackage), new SymbolPackageLayoutWorker(stagingPath: releaseConfig.StagingDirectory.FullName), - new SkipLayoutWorker( - shouldHandleFileFunc: DiagnosticsRepoHelpers.IsDockerUtilityFile - ) + new ChecksumLayoutWorker(stagingPath: releaseConfig.StagingDirectory.FullName), + new SkipLayoutWorker(shouldHandleFileFunc: DiagnosticsRepoHelpers.IsDockerUtilityFile), + // This should always be last since it will accept any file + new BlobLayoutWorker(stagingPath: releaseConfig.StagingDirectory.FullName) }; var verifierList = new List { }; @@ -46,7 +46,9 @@ internal async static Task PrepareRelease(Config releaseConfig, bool verbos DirectoryInfo basePublishDirectory = darcLayoutHelper.GetShippingDirectoryForSingleProjectVariants(DiagnosticsRepoHelpers.ProductNames); string publishManifestPath = Path.Combine(releaseConfig.StagingDirectory.FullName, ManifestName); - IPublisher releasePublisher = new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.AccountKey, releaseConfig.ContainerName, releaseConfig.ReleaseName, releaseConfig.SasValidDays, logger); + IPublisher releasePublisher = dryRun ? + new SkipPublisher() : + new AzureBlobBublisher(releaseConfig.AccountName, releaseConfig.AccountKey, releaseConfig.ContainerName, releaseConfig.ReleaseName, releaseConfig.SasValidDays, logger); IManifestGenerator manifestGenerator = new DiagnosticsManifestGenerator(releaseMetadata, releaseConfig.ToolManifest, logger); using var diagnosticsRelease = new Release( diff --git a/eng/release/DiagnosticsReleaseTool/DiagnosticsRepoHelpers.cs b/eng/release/DiagnosticsReleaseTool/DiagnosticsRepoHelpers.cs index 69786b515f3..25047cdd4b3 100644 --- a/eng/release/DiagnosticsReleaseTool/DiagnosticsRepoHelpers.cs +++ b/eng/release/DiagnosticsReleaseTool/DiagnosticsRepoHelpers.cs @@ -7,8 +7,7 @@ public static class DiagnosticsRepoHelpers public static readonly string[] ProductNames = new []{ "dotnet-monitor", "dotnet-dotnet-monitor" }; public static readonly string[] RepositoryUrls = new [] { "https://github.com/dotnet/dotnet-monitor", "https://dev.azure.com/dnceng/internal/_git/dotnet-dotnet-monitor" }; internal static bool IsDockerUtilityFile(FileInfo arg) => - arg.FullName.EndsWith(".nupkg.sha512") - || arg.FullName.EndsWith(".nupkg.version") + arg.FullName.EndsWith(".nupkg.version") || arg.FullName.EndsWith(".nupkg.buildversion"); } } From 9e53e3cca29d380d5cd9c2371517cbd58eaa12a6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:45:11 +0000 Subject: [PATCH 14/78] Update dependencies from https://github.com/dotnet/arcade build 20220208.1 (#1480) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ec2f0f58b0f..e5100a5e0c1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore 1e21fb868bfa327b337d5c4712a0333d343e62c4 - + https://github.com/dotnet/arcade - 70831f0d126fe88b81d7dc8de11358e17a5ce364 + dda61e4601d38b5d9d972f0541ff652ba5a16ad6 - + https://github.com/dotnet/arcade - 70831f0d126fe88b81d7dc8de11358e17a5ce364 + dda61e4601d38b5d9d972f0541ff652ba5a16ad6 https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index 77c417156e0..a38152746f7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22103.1 + 7.0.0-beta.22108.1 7.0.0-preview.2.22108.14 7.0.0-preview.2.22108.14 diff --git a/global.json b/global.json index a4fa90fc762..0af7f1ebf87 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22103.1" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22108.1" } } From 44fbba69b16342b2d1dac61d5e46ab2557c58715 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:49:43 +0000 Subject: [PATCH 15/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220208.2 (#1479) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e5100a5e0c1..3a8178b32fc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 243cebb165dd61b90f4bf7a7c7097880c4cf1469 + 01620015d17d2e5cffae3bab5ebb065854be1684 - + https://github.com/dotnet/diagnostics - 243cebb165dd61b90f4bf7a7c7097880c4cf1469 + 01620015d17d2e5cffae3bab5ebb065854be1684 diff --git a/eng/Versions.props b/eng/Versions.props index a38152746f7..af3f0003cdd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22108.14 7.0.0-preview.2.22108.14 - 5.0.0-preview.22107.1 - 5.0.0-preview.22107.1 + 5.0.0-preview.22108.2 + 5.0.0-preview.22108.2 7.0.0-preview.2.22107.26 7.0.0-preview.2.22107.26 From ad18a2e049004e3acbe7cc94c8977fefe9e3366b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 19:51:58 +0000 Subject: [PATCH 16/78] Update dependencies from https://github.com/dotnet/runtime build 20220208.17 (#1481) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3a8178b32fc..3845c3d2598 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore fed6eefe34de9690712e2ada8a2f7e6a9555b76d - + https://github.com/dotnet/runtime - af42c8ee4e1f0e420605f928cded476520296ced + c4c1c3aac7c42494791aaa5b791ae3641dc2561a https://github.com/dotnet/aspnetcore 1e21fb868bfa327b337d5c4712a0333d343e62c4 - + https://github.com/dotnet/runtime - af42c8ee4e1f0e420605f928cded476520296ced + c4c1c3aac7c42494791aaa5b791ae3641dc2561a diff --git a/eng/Versions.props b/eng/Versions.props index af3f0003cdd..765d894349e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22108.2 5.0.0-preview.22108.2 - 7.0.0-preview.2.22107.26 - 7.0.0-preview.2.22107.26 + 7.0.0-preview.2.22108.17 + 7.0.0-preview.2.22108.17 1.0.310701 From ec50ffcac303c67b089d6d688a2f1eca7aca1342 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Wed, 9 Feb 2022 13:24:17 -0800 Subject: [PATCH 17/78] Update to Preview 2 (#1486) --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 765d894349e..9fcf6e9027a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -2,8 +2,8 @@ https://github.com/dotnet/dotnet-monitor 7.0.0 - alpha - 1 + preview + 2 true - 7.0.0-preview.2.22108.17 - 7.0.0-preview.2.22108.17 + 7.0.0-preview.2.22109.10 + 7.0.0-preview.2.22109.10 1.0.310701 From b92ba458c05b736efa7bfecfa8169d0eb7e593d2 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Thu, 10 Feb 2022 15:51:08 -0800 Subject: [PATCH 19/78] Update 6.0 release to 6.0.2 (#1492) --- documentation/releases.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/releases.md b/documentation/releases.md index 5325a2eb514..642cdc75be0 100644 --- a/documentation/releases.md +++ b/documentation/releases.md @@ -2,4 +2,4 @@ | Version | Release Date | Latest Patch Version | Runtime Frameworks | |---|---|---|---| -| 6.0 | December 8, 2021 | [6.0.1](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v6.0.1.md) | .NET Core 3.1 (with major roll forward)
.NET 6 | \ No newline at end of file +| 6.0 | February 8, 2022 | [6.0.2](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v6.0.2.md) | .NET Core 3.1 (with major roll forward)
.NET 6 | \ No newline at end of file From c515372e1ec48cca9d0ea4aed3c999c21217a135 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 05:39:38 +0000 Subject: [PATCH 20/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220209.1 (#1490) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7706b09ee00..f50e833b9bb 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@
- + https://github.com/dotnet/aspnetcore - 1e21fb868bfa327b337d5c4712a0333d343e62c4 + e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 2b862d43469a79368fa20413d44e3943524daa0b - + https://github.com/dotnet/aspnetcore - 1e21fb868bfa327b337d5c4712a0333d343e62c4 + e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 38d1942d94b..5ec7384dce0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22108.1 - 7.0.0-preview.2.22108.14 - 7.0.0-preview.2.22108.14 + 7.0.0-preview.2.22109.1 + 7.0.0-preview.2.22109.1 5.0.0-preview.22108.2 5.0.0-preview.22108.2 From efbb0d726e0372a0852d3a435e7aa1fce5be5257 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 14:08:14 +0000 Subject: [PATCH 21/78] [main] Update dependencies from dotnet/diagnostics (#1487) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f50e833b9bb..636db60bf13 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 01620015d17d2e5cffae3bab5ebb065854be1684 + b115a5957b82378deb789f7b853c2c00ef65cd58 - + https://github.com/dotnet/diagnostics - 01620015d17d2e5cffae3bab5ebb065854be1684 + b115a5957b82378deb789f7b853c2c00ef65cd58 diff --git a/eng/Versions.props b/eng/Versions.props index 5ec7384dce0..d55dddabbfc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22109.1 7.0.0-preview.2.22109.1 - 5.0.0-preview.22108.2 - 5.0.0-preview.22108.2 + 5.0.0-preview.22110.1 + 5.0.0-preview.22110.1 7.0.0-preview.2.22109.10 7.0.0-preview.2.22109.10 From 3c0c6e1c8302340620af7b7026f66be59b0985a6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 19:29:18 +0000 Subject: [PATCH 22/78] Update dependencies from https://github.com/dotnet/runtime build 20220211.1 (#1493) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 636db60bf13..af810d167cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore fed6eefe34de9690712e2ada8a2f7e6a9555b76d - + https://github.com/dotnet/runtime - 2b862d43469a79368fa20413d44e3943524daa0b + 9293aab2379d6a122d0cf5ed350356cb23e4d698 https://github.com/dotnet/aspnetcore e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d - + https://github.com/dotnet/runtime - 2b862d43469a79368fa20413d44e3943524daa0b + 9293aab2379d6a122d0cf5ed350356cb23e4d698 diff --git a/eng/Versions.props b/eng/Versions.props index d55dddabbfc..1466968477b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22110.1 5.0.0-preview.22110.1 - 7.0.0-preview.2.22109.10 - 7.0.0-preview.2.22109.10 + 7.0.0-preview.2.22111.1 + 7.0.0-preview.2.22111.1 1.0.310701 From e3597ff4033167a0bd188bae05d066d8ae715f8c Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Fri, 11 Feb 2022 20:06:18 -0800 Subject: [PATCH 23/78] Scripts and pipeline for release to blob storage (#1491) --- eng/release.yml | 200 ++++++++++++++++++ eng/release/Scripts/GetBuildVersion.ps1 | 38 ++++ eng/release/Scripts/GetReleaseVersion.ps1 | 2 +- eng/release/Scripts/InstallAzCopy.ps1 | 48 +++++ eng/release/Scripts/PublishToBlobAccounts.ps1 | 129 +++++++++++ 5 files changed, 416 insertions(+), 1 deletion(-) create mode 100644 eng/release.yml create mode 100644 eng/release/Scripts/GetBuildVersion.ps1 create mode 100644 eng/release/Scripts/InstallAzCopy.ps1 create mode 100644 eng/release/Scripts/PublishToBlobAccounts.ps1 diff --git a/eng/release.yml b/eng/release.yml new file mode 100644 index 00000000000..dbacd05e156 --- /dev/null +++ b/eng/release.yml @@ -0,0 +1,200 @@ +trigger: none +pr: none + +parameters: +- name: IsTestRun + type: boolean + default: true +- name: IsDryRun + type: boolean + default: true + +variables: +- name: _TeamName + value: DotNetCore + readonly: true +- group: Release-Pipeline +- name: IsDryRun + value: ${{ parameters.IsDryRun }} + readonly: true +- name: IsTestRun + value: ${{ parameters.IsTestRun }} + readonly: true + +resources: + pipelines: + - pipeline: Build + source: dotnet-dotnet-monitor + +stages: +- stage: Validation + + pool: + name: NetCore1ESPool-Internal + demands: ImageOverride -equals Build.Windows.10.Amd64.VS2019 + + jobs: + - job: Validate + + variables: + # Allow for differentiation of runs of this pipeline + # when running it with the same build repeatedly. + - name: RunRevision + value: $[counter(format('{0}|{1}|{2}', variables['resources.pipeline.Build.runID'], variables['IsDryRun'], variables['IsTestRun']), 1)] + readonly: true + + workspace: + clean: all + + steps: + - download: none + + - task: PowerShell@2 + displayName: Get BAR ID + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/GetBarId.ps1 + arguments: >- + -BuildId $(resources.pipeline.Build.runID) + -TaskVariableName 'BarId' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + + - task: PowerShell@2 + displayName: Get Release Version + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/GetReleaseVersion.ps1 + arguments: >- + -BarId $(BarId) + -MaestroToken $(MaestroAccessToken) + -TaskVariableName 'ReleaseVersion' + + - task: PowerShell@2 + displayName: Get Build Version + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/GetBuildVersion.ps1 + arguments: >- + -BarId $(BarId) + -MaestroToken $(MaestroAccessToken) + -TaskVariableName 'BuildVersion' + + - powershell: | + $buildName = "${env:ReleaseVersion} [${env:BuildVersion}]" + if ($env:IsDryRun -eq 'true') { + $buildName += "[Dry]" + } + if ($env:IsTestRun -eq 'true') { + $buildName += "[Test]" + } + $buildName += "[Run ${env:RunRevision}]" + Write-Host "##vso[build.updatebuildnumber]$buildName" + displayName: Set Name + +- stage: Publish + dependsOn: + - Validation + + pool: + name: NetCore1ESPool-Internal + demands: ImageOverride -equals Build.Windows.10.Amd64.VS2019 + + jobs: + - deployment: PublishToStorageAccounts + displayName: Publish to Storage Accounts + + ${{ if eq(parameters.IsTestRun, 'true') }}: + environment: Diagnostics-Monitor-Storage-Test + ${{ else }}: + environment: Diagnostics-Monitor-Storage-DotNetCli + + variables: + - ${{ if eq(parameters.IsTestRun, 'true') }}: + - group: DotNet-Diagnostics-Storage-Test + - group: DotNet-DotNetStage-Storage + + workspace: + clean: all + + strategy: + runOnce: + deploy: + steps: + - checkout: self + - download: none + + - task: PowerShell@2 + displayName: Install AzCopy + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/InstallAzCopy.ps1 + arguments: >- + -ToolsDirectory $(Agent.ToolsDirectory) + -TaskVariableName 'AzCopyPath' + + - task: PowerShell@2 + displayName: Get BAR ID + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/GetBarId.ps1 + arguments: >- + -BuildId $(resources.pipeline.Build.runID) + -TaskVariableName 'BarId' + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + + - task: PowerShell@2 + displayName: Get Release Version + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/GetReleaseVersion.ps1 + arguments: >- + -BarId $(BarId) + -MaestroToken $(MaestroAccessToken) + -TaskVariableName 'ReleaseVersion' + + - powershell: Install-PackageProvider -Name NuGet -Force -Scope CurrentUser + displayName: Install NuGet PowerShell Package Provider + + - powershell: Install-Module Az.Storage -Force -Scope CurrentUser -AllowClobber -Verbose + displayName: Install Az.Storage Module + + - powershell: | + Write-Host "##vso[task.setvariable variable=DestinationAccountName]$env:DESTINATION_ACCOUNT_NAME" + Write-Host "##vso[task.setvariable variable=DestinationAccountKey;issecret=true]$env:DESTINATION_ACCOUNT_KEY" + Write-Host "##vso[task.setvariable variable=ChecksumsAccountName]$env:CHECKSUMS_ACCOUNT_NAME" + Write-Host "##vso[task.setvariable variable=ChecksumsAccountKey;issecret=true]$env:CHECKSUMS_ACCOUNT_KEY" + displayName: Set Storage Accounts + ${{ if eq(parameters.IsTestRun, 'true') }}: + env: + # Variables provided by DotNet-Diagnostics-Storage-Test group + DESTINATION_ACCOUNT_NAME: $(dotnet-monitor-test-storage-accountname) + DESTINATION_ACCOUNT_KEY: $(dotnet-monitor-test-storage-accountkey) + CHECKSUMS_ACCOUNT_NAME: $(dotnet-monitor-checksums-test-storage-accountname) + CHECKSUMS_ACCOUNT_KEY: $(dotnet-monitor-checksums-test-storage-accountkey) + ${{ else }}: + env: + # Variables provided by Release-Pipeline group + DESTINATION_ACCOUNT_NAME: dotnetcli + DESTINATION_ACCOUNT_KEY: $(dotnetcli-storage-key) + CHECKSUMS_ACCOUNT_NAME: dotnetclichecksums + CHECKSUMS_ACCOUNT_KEY: $(dotnetclichecksums-storage-key) + + - task: PowerShell@2 + displayName: Publish Assets + inputs: + filePath: $(Build.SourcesDirectory)/eng/release/Scripts/PublishToBlobAccounts.ps1 + arguments: >- + -AzCopyPath $(AzCopyPath) + -BuildNumber $(resources.pipeline.Build.runName) + -ReleaseVersion $(ReleaseVersion) + -DotnetStageAccountKey $(dotnetstage-storage-key) + -DestinationAccountName $(DestinationAccountName) + -DestinationAccountKey $(DestinationAccountKey) + -ChecksumsAccountName $(ChecksumsAccountName) + -ChecksumsAccountKey $(ChecksumsAccountKey) + -WhatIf:${{ format('${0}', parameters.IsDryRun) }} + + - task: PublishBuildArtifacts@1 + displayName: Publish Logs + inputs: + PathtoPublish: '$(USERPROFILE)\.azcopy' + PublishLocation: Container + ArtifactName: AzCopyLogs + continueOnError: true + condition: succeededOrFailed() diff --git a/eng/release/Scripts/GetBuildVersion.ps1 b/eng/release/Scripts/GetBuildVersion.ps1 new file mode 100644 index 00000000000..e0886f31295 --- /dev/null +++ b/eng/release/Scripts/GetBuildVersion.ps1 @@ -0,0 +1,38 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string] $BarId, + [Parameter(Mandatory=$true)][string] $MaestroToken, + [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro-prod.westus2.cloudapp.azure.com', + [Parameter(Mandatory=$false)][string] $MaestroApiVersion = '2020-02-20', + [Parameter(Mandatory=$false)][string] $TaskVariableName = $null +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +[array]$releaseData = Invoke-RestMethod ` + -Uri "$MaestroApiEndPoint/api/assets?buildId=$BarId&api-version=$MaestroApiVersion" ` + -Method 'GET' ` + -Headers @{ 'accept' = 'application/json'; 'Authorization' = "Bearer $MaestroToken" } + +Write-Verbose 'ReleaseData:' +$releaseDataJson = $releaseData | ConvertTo-Json +Write-Verbose $releaseDataJson + +[array]$matchingData = $releaseData | Where-Object { $_.name -match '.nupkg.buildversion$' } + +if ($matchingData.Length -ne 1) { + Write-Error 'Unable to obtain build version.' +} + +$version = $matchingData[0].Version + +Write-Verbose "Build Version: $version" + +if ($TaskVariableName) { + & $PSScriptRoot\SetTaskVariable.ps1 ` + -Name $TaskVariableName ` + -Value $version +} + +Write-Output $version \ No newline at end of file diff --git a/eng/release/Scripts/GetReleaseVersion.ps1 b/eng/release/Scripts/GetReleaseVersion.ps1 index 0855a2baa87..50ef03db9c7 100644 --- a/eng/release/Scripts/GetReleaseVersion.ps1 +++ b/eng/release/Scripts/GetReleaseVersion.ps1 @@ -11,7 +11,7 @@ Param( $ErrorActionPreference = 'Stop' Set-StrictMode -Version 2.0 -$releaseData = Invoke-RestMethod ` +[array]$releaseData = Invoke-RestMethod ` -Uri "$MaestroApiEndPoint/api/assets?buildId=$BarId&name=dotnet-monitor&api-version=$MaestroApiVersion" ` -Method 'GET' ` -Headers @{ 'accept' = 'application/json'; 'Authorization' = "Bearer $MaestroToken" } diff --git a/eng/release/Scripts/InstallAzCopy.ps1 b/eng/release/Scripts/InstallAzCopy.ps1 new file mode 100644 index 00000000000..0275c468f11 --- /dev/null +++ b/eng/release/Scripts/InstallAzCopy.ps1 @@ -0,0 +1,48 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory=$true)][string] $ToolsDirectory, + [Parameter(Mandatory=$false)][string] $TaskVariableName = $null +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$url = 'https://aka.ms/downloadazcopy-v10-windows' +$basePath = Join-Path $ToolsDirectory 'azcopy' + +$zipPath = Join-Path $basePath 'azcopy.zip' +$toolDirPath = Join-Path $basePath 'azcopy' +$azCopyPath = Join-Path $toolDirPath 'azcopy.exe' + +if (Test-Path $azCopyPath) { + Write-Verbose 'Already installed' +} else { + if (!(Test-Path $basePath)) { + New-Item -ItemType 'Directory' -Path $basePath | Out-Null + } + + Write-Verbose 'Fetching...' + Invoke-WebRequest -Uri $url -OutFile $zipPath + + Write-Verbose 'Unzipping...' + Expand-Archive -LiteralPath $zipPath -Force -DestinationPath $basePath + + # There should only be one directory that is named like 'azcopy_windows_amd64_' + Write-Verbose 'Renaming...' + $unpackDirName = Get-ChildItem -Path $basePath -Directory -Name + $unpackDirPath = Join-Path $basePath $unpackDirName + Rename-Item -Path $unpackDirPath -NewName 'azcopy' + + # Delete zip + Remove-Item -Path $zipPath + + Write-Verbose 'Finished' +} + +if ($TaskVariableName) { + & $PSScriptRoot\SetTaskVariable.ps1 ` + -Name $TaskVariableName ` + -Value $azCopyPath +} + +Write-Output $azCopyPath \ No newline at end of file diff --git a/eng/release/Scripts/PublishToBlobAccounts.ps1 b/eng/release/Scripts/PublishToBlobAccounts.ps1 new file mode 100644 index 00000000000..d9da8f6f01d --- /dev/null +++ b/eng/release/Scripts/PublishToBlobAccounts.ps1 @@ -0,0 +1,129 @@ +[CmdletBinding(SupportsShouldProcess)] +Param( + [Parameter(Mandatory=$true)][string]$AzCopyPath, + [Parameter(Mandatory=$true)][string]$BuildNumber, + [Parameter(Mandatory=$true)][string]$ReleaseVersion, + [Parameter(Mandatory=$true)][string]$DotnetStageAccountKey, + [Parameter(Mandatory=$true)][string]$DestinationAccountName, + [Parameter(Mandatory=$true)][string]$DestinationAccountKey, + [Parameter(Mandatory=$true)][string]$ChecksumsAccountName, + [Parameter(Mandatory=$true)][string]$ChecksumsAccountKey +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 + +$sourceAccountName = 'dotnetstage' +$sourceContainerName = 'dotnet-monitor' +$destinationContainerName = 'dotnet' + +function Generate-Source-Uri{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$true)][string]$AssetType + ) + + return "https://$sourceAccountName.blob.core.windows.net/$sourceContainerName/$BuildNumber/${AssetType}Assets/*" +} + +function Generate-Destination-Uri{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$true)][string]$AccountName + ) + + return "https://$AccountName.blob.core.windows.net/$destinationContainerName/diagnostics/monitor/$ReleaseVersion" +} + +function Generate-Sas-Token{ + [CmdletBinding()] + Param( + [Parameter(Mandatory=$true)][string]$StorageAccountName, + [Parameter(Mandatory=$true)][string]$ContainerName, + [Parameter(Mandatory=$true)][string]$AccountKey, + [Parameter(Mandatory=$true)][string]$Permissions + ) + + $context = New-AzStorageContext ` + -StorageAccountName $StorageAccountName ` + -StorageAccountKey $AccountKey + + return New-AzStorageContainerSASToken ` + -Container $ContainerName ` + -Context $context ` + -Permission $Permissions ` + -StartTime (Get-Date).AddMinutes(-15.0) ` + -ExpiryTime (Get-Date).AddHours(1.0) +} + +function Transfer-File{ + [CmdletBinding(SupportsShouldProcess)] + Param( + [Parameter(Mandatory=$true)][string]$From, + [Parameter(Mandatory=$true)][string]$To, + [Parameter(Mandatory=$true)][string]$FromToken, + [Parameter(Mandatory=$true)][string]$ToToken + ) + + Write-Verbose "Copy $From -> $To" + + if ($From -eq $to) { + Write-Verbose 'Skipping copy because source and destination are the same.' + } else { + [array]$azCopyArgs = "$from$fromToken" + $azCopyArgs += "$to$toToken" + $azCopyArgs += "--s2s-preserve-properties" + $azCopyArgs += "--s2s-preserve-access-tier=false" + if ($WhatIfPreference) { + $azCopyArgs += "--dry-run" + } + & $AzCopyPath cp @azCopyArgs + } +} + +# Create source URI and SAS token +$sourceUri = Generate-Source-Uri ` + -AssetType 'Blob' +$soureSasToken = Generate-Sas-Token ` + -StorageAccountName $sourceAccountName ` + -ContainerName $sourceContainerName ` + -AccountKey $DotnetStageAccountKey ` + -Permissions 'rl' + +# Create destination URI and SAS token +$destinationUri = Generate-Destination-Uri ` + -AccountName $DestinationAccountName +$destinationSasToken = Generate-Sas-Token ` + -StorageAccountName $DestinationAccountName ` + -ContainerName $destinationContainerName ` + -AccountKey $DestinationAccountKey ` + -Permissions 'rlw' + +# Copy files to destination account +Transfer-File ` + -From $sourceUri ` + -FromToken $soureSasToken ` + -To $destinationUri ` + -ToToken $destinationSasToken ` + -WhatIf:$WhatIfPreference + +# Create source checksums URI +$checksumsSourceUri = Generate-Source-Uri ` + -AssetType 'Checksum' + +# Create checksums destination URI and SAS token +$checksumsDestinationUri = Generate-Destination-Uri ` + -AccountName $ChecksumsAccountName +$checksumsDestinationSasToken = Generate-Sas-Token ` + -StorageAccountName $ChecksumsAccountName ` + -ContainerName $destinationContainerName ` + -AccountKey $ChecksumsAccountKey ` + -Permissions 'rlw' + +# Copy checksums to checksum account +Transfer-File ` + -From $checksumsSourceUri ` + -FromToken $soureSasToken ` + -To $checksumsDestinationUri ` + -ToToken $checksumsDestinationSasToken ` + -WhatIf:$WhatIfPreference \ No newline at end of file From b45dd628d462e142e0260dc9b9d91633dd4fb5fc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 12 Feb 2022 14:05:46 +0000 Subject: [PATCH 24/78] [main] Update dependencies from dotnet/arcade (#1488) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++-- eng/Versions.props | 2 +- eng/common/cross/build-rootfs.sh | 9 ++++ eng/common/cross/ppc64le/sources.list.bionic | 11 +++++ eng/common/cross/toolchain.cmake | 7 +++- eng/common/generate-sbom-prep.ps1 | 19 +++++++++ eng/common/generate-sbom-prep.sh | 22 ++++++++++ eng/common/templates/job/job.yml | 11 +++++ eng/common/templates/jobs/jobs.yml | 5 +++ eng/common/templates/steps/generate-sbom.yml | 44 ++++++++++++++++++++ global.json | 2 +- 11 files changed, 132 insertions(+), 8 deletions(-) create mode 100644 eng/common/cross/ppc64le/sources.list.bionic create mode 100644 eng/common/generate-sbom-prep.ps1 create mode 100644 eng/common/generate-sbom-prep.sh create mode 100644 eng/common/templates/steps/generate-sbom.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index af810d167cf..eb66a19d421 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d
- + https://github.com/dotnet/arcade - dda61e4601d38b5d9d972f0541ff652ba5a16ad6 + ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb - + https://github.com/dotnet/arcade - dda61e4601d38b5d9d972f0541ff652ba5a16ad6 + ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index 1466968477b..4533d4929f8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22108.1 + 7.0.0-beta.22111.10 7.0.0-preview.2.22109.1 7.0.0-preview.2.22109.1 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index f97dca77054..7e4be9a0ccf 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -120,6 +120,15 @@ while :; do __UbuntuRepo="http://ftp.debian.org/debian/" __CodeName=jessie ;; + ppc64le) + __BuildArch=ppc64le + __UbuntuArch=ppc64el + __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/" + __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//') + __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp-dev//') + __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//') + unset __LLDB_Package + ;; s390x) __BuildArch=s390x __UbuntuArch=s390x diff --git a/eng/common/cross/ppc64le/sources.list.bionic b/eng/common/cross/ppc64le/sources.list.bionic new file mode 100644 index 00000000000..21095574095 --- /dev/null +++ b/eng/common/cross/ppc64le/sources.list.bionic @@ -0,0 +1,11 @@ +deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted + +deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse +deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index fba2afda438..9fd345bde6d 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -54,6 +54,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") if(TIZEN) set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") endif() +elseif(TARGET_ARCH_NAME STREQUAL "ppc64le") + set(CMAKE_SYSTEM_PROCESSOR ppc64le) + set(TOOLCHAIN "powerpc64le-linux-gnu") elseif(TARGET_ARCH_NAME STREQUAL "s390x") set(CMAKE_SYSTEM_PROCESSOR s390x) set(TOOLCHAIN "s390x-linux-gnu") @@ -67,7 +70,7 @@ elseif (ILLUMOS) set(CMAKE_SYSTEM_PROCESSOR "x86_64") set(TOOLCHAIN "x86_64-illumos") else() - message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, s390x and x86 are supported!") + message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, ppc64le, s390x and x86 are supported!") endif() if(DEFINED ENV{TOOLCHAIN}) @@ -201,7 +204,7 @@ endif() # Specify compile options -if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|s390x)$" AND NOT ANDROID) OR ILLUMOS) +if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID) OR ILLUMOS) set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN}) set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN}) diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1 new file mode 100644 index 00000000000..a733a888582 --- /dev/null +++ b/eng/common/generate-sbom-prep.ps1 @@ -0,0 +1,19 @@ +Param( + [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed +) + +Write-Host "Creating dir $ManifestDirPath" +# create directory for sbom manifest to be placed +if (!(Test-Path -path $ManifestDirPath)) +{ + New-Item -ItemType Directory -path $ManifestDirPath + Write-Host "Successfully created directory $ManifestDirPath" +} +else{ + Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." +} + +Write-Host "Updating artifact name" +$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_' +Write-Host "Artifact name $artifact_name" +Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name" diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh new file mode 100644 index 00000000000..f6c77453142 --- /dev/null +++ b/eng/common/generate-sbom-prep.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" + +manifest_dir=$1 + +if [ ! -d "$manifest_dir" ] ; then + mkdir -p "$manifest_dir" + echo "Sbom directory created." $manifest_dir +else + Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder." +fi + +artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM" +echo "Artifact name before : "$artifact_name +# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts. +safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}" +echo "Artifact name after : "$safe_artifact_name +export ARTIFACT_NAME=$safe_artifact_name +echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name" + +exit 0 diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 92e98af7ebd..e3ba9398016 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -31,6 +31,10 @@ parameters: name: '' preSteps: [] runAsPublic: false +# Sbom related params + enableSbom: true + PackageVersion: 7.0.0 + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' jobs: - job: ${{ parameters.name }} @@ -248,3 +252,10 @@ jobs: ArtifactName: AssetManifests continueOnError: ${{ parameters.continueOnError }} condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) + + - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}: + - template: /eng/common/templates/steps/generate-sbom.yml + parameters: + PackageVersion: ${{ parameters.packageVersion}} + BuildDropPath: ${{ parameters.buildDropPath }} + diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 70d44735ace..6976330862c 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -41,6 +41,11 @@ parameters: # Internal resources (telemetry, microbuild) can only be accessed from non-public projects, # and some (Microbuild) should only be applied to non-PR cases for internal builds. +# Sbom related params + enableSbom: true + PackageVersion: 7.0.0 + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' + jobs: - ${{ each job in parameters.jobs }}: - template: ../job/job.yml diff --git a/eng/common/templates/steps/generate-sbom.yml b/eng/common/templates/steps/generate-sbom.yml new file mode 100644 index 00000000000..4cea8c33187 --- /dev/null +++ b/eng/common/templates/steps/generate-sbom.yml @@ -0,0 +1,44 @@ +# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated. +# PackageName - The name of the package this SBOM represents. +# PackageVersion - The version of the package this SBOM represents. +# ManifestDirPath - The path of the directory where the generated manifest files will be placed + +parameters: + PackageVersion: 7.0.0 + BuildDropPath: '$(Build.SourcesDirectory)/artifacts' + PackageName: '.NET' + ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom + sbomContinueOnError: true + +steps: +- task: PowerShell@2 + displayName: Prep for SBOM generation in (Non-linux) + condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin')) + inputs: + filePath: ./eng/common/generate-sbom-prep.ps1 + arguments: ${{parameters.manifestDirPath}} + +# Chmodding is a workaround for https://github.com/dotnet/arcade/issues/8461 +- script: | + chmod +x ./eng/common/generate-sbom-prep.sh + ./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}} + displayName: Prep for SBOM generation in (Linux) + condition: eq(variables['Agent.Os'], 'Linux') + continueOnError: ${{ parameters.sbomContinueOnError }} + +- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: 'Generate SBOM manifest' + continueOnError: ${{ parameters.sbomContinueOnError }} + inputs: + PackageName: ${{ parameters.packageName }} + BuildDropPath: ${{ parameters.buildDropPath }} + PackageVersion: ${{ parameters.packageVersion }} + ManifestDirPath: ${{ parameters.manifestDirPath }} + +- task: PublishPipelineArtifact@1 + displayName: Publish SBOM manifest + continueOnError: ${{parameters.sbomContinueOnError}} + inputs: + targetPath: '${{parameters.manifestDirPath}}' + artifactName: $(ARTIFACT_NAME) + diff --git a/global.json b/global.json index 0af7f1ebf87..f1c7a8373f1 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22108.1" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22111.10" } } From 47cc653fca0d57ef2ee2f66479fb6505600a1168 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 12 Feb 2022 14:25:22 +0000 Subject: [PATCH 25/78] Update dependencies from https://github.com/dotnet/runtime build 20220211.16 (#1495) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index eb66a19d421..4be7be0ed6d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore fed6eefe34de9690712e2ada8a2f7e6a9555b76d - + https://github.com/dotnet/runtime - 9293aab2379d6a122d0cf5ed350356cb23e4d698 + 24ae13f43808dcabfea0c48e0845694642a12e39 https://github.com/dotnet/aspnetcore e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d - + https://github.com/dotnet/runtime - 9293aab2379d6a122d0cf5ed350356cb23e4d698 + 24ae13f43808dcabfea0c48e0845694642a12e39
diff --git a/eng/Versions.props b/eng/Versions.props index 4533d4929f8..7b687437f8e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22110.1 5.0.0-preview.22110.1 - 7.0.0-preview.2.22111.1 - 7.0.0-preview.2.22111.1 + 7.0.0-preview.2.22111.16 + 7.0.0-preview.2.22111.16 1.0.310701 From 73f0c9765da9a507e80461912387b112266809c7 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 13 Feb 2022 14:19:26 +0000 Subject: [PATCH 26/78] Update dependencies from https://github.com/dotnet/runtime build 20220212.5 (#1496) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4be7be0ed6d..09f98bf231c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore fed6eefe34de9690712e2ada8a2f7e6a9555b76d
- + https://github.com/dotnet/runtime - 24ae13f43808dcabfea0c48e0845694642a12e39 + 78c6505cffe2558b036fbe44cd27038affbb6cce https://github.com/dotnet/aspnetcore e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d - + https://github.com/dotnet/runtime - 24ae13f43808dcabfea0c48e0845694642a12e39 + 78c6505cffe2558b036fbe44cd27038affbb6cce diff --git a/eng/Versions.props b/eng/Versions.props index 7b687437f8e..fdbb14c2db3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22110.1 5.0.0-preview.22110.1 - 7.0.0-preview.2.22111.16 - 7.0.0-preview.2.22111.16 + 7.0.0-preview.2.22112.5 + 7.0.0-preview.2.22112.5 1.0.310701 From 8dceeea8801b18f05e4fd4728c7e943f38f9ae59 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:00:44 +0000 Subject: [PATCH 27/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220211.1 (#1497) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 09f98bf231c..8c8a98bb7c8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - b115a5957b82378deb789f7b853c2c00ef65cd58 + 3c8b958f99bf246b6bd03c2ea778844a4bd7737d - + https://github.com/dotnet/diagnostics - b115a5957b82378deb789f7b853c2c00ef65cd58 + 3c8b958f99bf246b6bd03c2ea778844a4bd7737d diff --git a/eng/Versions.props b/eng/Versions.props index fdbb14c2db3..a925d5c5f8e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22109.1 7.0.0-preview.2.22109.1 - 5.0.0-preview.22110.1 - 5.0.0-preview.22110.1 + 5.0.0-preview.22111.1 + 5.0.0-preview.22111.1 7.0.0-preview.2.22112.5 7.0.0-preview.2.22112.5 From 3b4b40121ea3bbcf70d5ef27906ce2670b468a1c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 14:23:10 +0000 Subject: [PATCH 28/78] Update dependencies from https://github.com/dotnet/runtime build 20220213.2 (#1498) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8c8a98bb7c8..b1e490e2d17 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore fed6eefe34de9690712e2ada8a2f7e6a9555b76d - + https://github.com/dotnet/runtime - 78c6505cffe2558b036fbe44cd27038affbb6cce + 6e05d78deba320a54ef10a265c6025bbb686efe6 https://github.com/dotnet/aspnetcore e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d - + https://github.com/dotnet/runtime - 78c6505cffe2558b036fbe44cd27038affbb6cce + 6e05d78deba320a54ef10a265c6025bbb686efe6 diff --git a/eng/Versions.props b/eng/Versions.props index a925d5c5f8e..2849fd4c920 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22111.1 5.0.0-preview.22111.1 - 7.0.0-preview.2.22112.5 - 7.0.0-preview.2.22112.5 + 7.0.0-preview.2.22113.2 + 7.0.0-preview.2.22113.2 1.0.310701 From fda2436ce0c92c1e4f6d4c152c3c8901e2975cf6 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Mon, 14 Feb 2022 11:17:16 -0500 Subject: [PATCH 29/78] Config Show - List configuration sources (#1438) --- documentation/configuration.md | 6 + .../Commands/ConfigShowCommandHandler.cs | 8 +- .../dotnet-monitor/ConfigurationJsonWriter.cs | 138 ++++++++++++------ src/Tools/dotnet-monitor/Program.cs | 11 +- src/Tools/dotnet-monitor/Strings.Designer.cs | 18 +++ src/Tools/dotnet-monitor/Strings.resx | 8 + 6 files changed, 138 insertions(+), 51 deletions(-) diff --git a/documentation/configuration.md b/documentation/configuration.md index b34a7472b19..cbf4dafab74 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -188,6 +188,12 @@ The output of the command should resemble the following JSON object: } ``` +To view the loaded configuration providers, run the following command: + +```cmd +dotnet monitor config show --show-sources +``` + ## Diagnostic Port Configuration `dotnet monitor` communicates via .NET processes through their diagnostic port. In the default configuration, .NET processes listen on a platform native transport (named pipes on Windows/Unix-domain sockets on \*nix) in a well-known location. diff --git a/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs b/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs index 66694bd8b02..beb631284d1 100644 --- a/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs +++ b/src/Tools/dotnet-monitor/Commands/ConfigShowCommandHandler.cs @@ -15,19 +15,19 @@ internal sealed class ConfigShowCommandHandler // Although the "noHttpEgress" parameter is unused, it keeps the entire command parameter set a superset // of the "collect" command so that users can take the same arguments from "collect" and use it on "config show" // to get the same configuration without telling them to drop specific command line arguments. - public static void Invoke(string[] urls, string[] metricUrls, bool metrics, string diagnosticPort, bool noAuth, bool tempApiKey, bool noHttpEgress, ConfigDisplayLevel level) + public static void Invoke(string[] urls, string[] metricUrls, bool metrics, string diagnosticPort, bool noAuth, bool tempApiKey, bool noHttpEgress, ConfigDisplayLevel level, bool showSources) { - Write(Console.OpenStandardOutput(), urls, metricUrls, metrics, diagnosticPort, noAuth, tempApiKey, level); + Write(Console.OpenStandardOutput(), urls, metricUrls, metrics, diagnosticPort, noAuth, tempApiKey, level, showSources); } - public static void Write(Stream stream, string[] urls, string[] metricUrls, bool metrics, string diagnosticPort, bool noAuth, bool tempApiKey, ConfigDisplayLevel level) + public static void Write(Stream stream, string[] urls, string[] metricUrls, bool metrics, string diagnosticPort, bool noAuth, bool tempApiKey, ConfigDisplayLevel level, bool showSources) { IAuthConfiguration authConfiguration = HostBuilderHelper.CreateAuthConfiguration(noAuth, tempApiKey); HostBuilderSettings settings = HostBuilderSettings.CreateMonitor(urls, metricUrls, metrics, diagnosticPort, authConfiguration); IHost host = HostBuilderHelper.CreateHostBuilder(settings).Build(); IConfiguration configuration = host.Services.GetRequiredService(); using ConfigurationJsonWriter jsonWriter = new ConfigurationJsonWriter(stream); - jsonWriter.Write(configuration, full: level == ConfigDisplayLevel.Full, skipNotPresent: false); + jsonWriter.Write(configuration, full: level == ConfigDisplayLevel.Full, skipNotPresent: false, showSources: showSources); } } } diff --git a/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs b/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs index 5d3ef1b8a9e..d4949f45232 100644 --- a/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs +++ b/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs @@ -11,6 +11,7 @@ using System.Globalization; using System.IO; using System.Linq; +using System.Text; using System.Text.Json; namespace Microsoft.Diagnostics.Tools.Monitor @@ -21,14 +22,16 @@ namespace Microsoft.Diagnostics.Tools.Monitor internal sealed class ConfigurationJsonWriter : IDisposable { private readonly Utf8JsonWriter _writer; + private IConfiguration _configuration; public ConfigurationJsonWriter(Stream outputStream) { JsonWriterOptions options = new() { Indented = true }; _writer = new Utf8JsonWriter(outputStream, options); } - public void Write(IConfiguration configuration, bool full, bool skipNotPresent) + public void Write(IConfiguration configuration, bool full, bool skipNotPresent, bool showSources = false) { + _configuration = configuration; //Note that we avoid IConfigurationRoot.GetDebugView because it shows everything //CONSIDER Should we show this in json, since it cannot represent complete configuration? //CONSIDER Should we convert number based names to arrays? @@ -37,24 +40,24 @@ public void Write(IConfiguration configuration, bool full, bool skipNotPresent) using (new JsonObjectContext(_writer)) { - ProcessChildSection(configuration, WebHostDefaults.ServerUrlsKey, skipNotPresent); - IConfigurationSection kestrel = ProcessChildSection(configuration, "Kestrel", skipNotPresent, includeChildSections: false); + ProcessChildSection(configuration, WebHostDefaults.ServerUrlsKey, skipNotPresent, showSources: showSources); + IConfigurationSection kestrel = ProcessChildSection(configuration, "Kestrel", skipNotPresent, includeChildSections: false, showSources: showSources); if (kestrel != null) { using (new JsonObjectContext(_writer)) { - IConfigurationSection certificates = ProcessChildSection(kestrel, "Certificates", skipNotPresent, includeChildSections: false); + IConfigurationSection certificates = ProcessChildSection(kestrel, "Certificates", skipNotPresent, includeChildSections: false, showSources: showSources); if (certificates != null) { using (new JsonObjectContext(_writer)) { - IConfigurationSection defaultCert = ProcessChildSection(certificates, "Default", skipNotPresent, includeChildSections: false); + IConfigurationSection defaultCert = ProcessChildSection(certificates, "Default", skipNotPresent, includeChildSections: false, showSources: showSources); if (defaultCert != null) { using (new JsonObjectContext(_writer)) { - ProcessChildSection(defaultCert, "Path", skipNotPresent, includeChildSections: false); - ProcessChildSection(defaultCert, "Password", skipNotPresent, includeChildSections: false, redact: !full); + ProcessChildSection(defaultCert, "Path", skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(defaultCert, "Password", skipNotPresent, includeChildSections: false, redact: !full, showSources: showSources); } } } @@ -63,65 +66,65 @@ public void Write(IConfiguration configuration, bool full, bool skipNotPresent) } //No sensitive information - ProcessChildSection(configuration, ConfigurationKeys.GlobalCounter, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.CollectionRules, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.CorsConfiguration, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.DiagnosticPort, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.Metrics, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.Storage, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.DefaultProcess, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.Logging, skipNotPresent, includeChildSections: true); + ProcessChildSection(configuration, ConfigurationKeys.GlobalCounter, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.CollectionRules, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.CorsConfiguration, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.DiagnosticPort, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.Metrics, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.Storage, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.DefaultProcess, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.Logging, skipNotPresent, includeChildSections: true, showSources: showSources); if (full) { - ProcessChildSection(configuration, ConfigurationKeys.Authentication, skipNotPresent, includeChildSections: true); - ProcessChildSection(configuration, ConfigurationKeys.Egress, skipNotPresent, includeChildSections: true); + ProcessChildSection(configuration, ConfigurationKeys.Authentication, skipNotPresent, includeChildSections: true, showSources: showSources); + ProcessChildSection(configuration, ConfigurationKeys.Egress, skipNotPresent, includeChildSections: true, showSources: showSources); } else { - IConfigurationSection auth = ProcessChildSection(configuration, ConfigurationKeys.Authentication, skipNotPresent, includeChildSections: false); + IConfigurationSection auth = ProcessChildSection(configuration, ConfigurationKeys.Authentication, skipNotPresent, includeChildSections: false, showSources: showSources); if (null != auth) { using (new JsonObjectContext(_writer)) { - IConfigurationSection monitorApiKey = ProcessChildSection(auth, ConfigurationKeys.MonitorApiKey, skipNotPresent, includeChildSections: false); + IConfigurationSection monitorApiKey = ProcessChildSection(auth, ConfigurationKeys.MonitorApiKey, skipNotPresent, includeChildSections: false, showSources: showSources); if (null != monitorApiKey) { using (new JsonObjectContext(_writer)) { - ProcessChildSection(monitorApiKey, nameof(MonitorApiKeyOptions.Subject), skipNotPresent, includeChildSections: false, redact: false); + ProcessChildSection(monitorApiKey, nameof(MonitorApiKeyOptions.Subject), skipNotPresent, includeChildSections: false, redact: false, showSources: showSources); // The PublicKey should only ever contain the public key, however we expect that accidents may occur and we should // redact this field in the event the JWK contains the private key information. - ProcessChildSection(monitorApiKey, nameof(MonitorApiKeyOptions.PublicKey), skipNotPresent, includeChildSections: false, redact: true); + ProcessChildSection(monitorApiKey, nameof(MonitorApiKeyOptions.PublicKey), skipNotPresent, includeChildSections: false, redact: true, showSources: showSources); } } } } - IConfigurationSection egress = ProcessChildSection(configuration, ConfigurationKeys.Egress, skipNotPresent, includeChildSections: false); + IConfigurationSection egress = ProcessChildSection(configuration, ConfigurationKeys.Egress, skipNotPresent, includeChildSections: false, showSources: showSources); if (egress != null) { using (new JsonObjectContext(_writer)) { - ProcessEgressSection(egress, skipNotPresent); + ProcessEgressSection(egress, skipNotPresent, showSources: showSources); } } } } } - private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent) + private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent, bool showSources = false) { IList processedSectionPaths = new List(); // Redact all the properties since they could include secrets such as storage keys - IConfigurationSection propertiesSection = ProcessChildSection(egress, nameof(EgressOptions.Properties), skipNotPresent, includeChildSections: true, redact: true); + IConfigurationSection propertiesSection = ProcessChildSection(egress, nameof(EgressOptions.Properties), skipNotPresent, includeChildSections: true, redact: true, showSources: showSources); if (null != propertiesSection) { processedSectionPaths.Add(propertiesSection.Path); } - IConfigurationSection azureBlobProviderSection = ProcessChildSection(egress, nameof(EgressOptions.AzureBlobStorage), skipNotPresent, includeChildSections: false); + IConfigurationSection azureBlobProviderSection = ProcessChildSection(egress, nameof(EgressOptions.AzureBlobStorage), skipNotPresent, includeChildSections: false, showSources: showSources); if (azureBlobProviderSection != null) { processedSectionPaths.Add(azureBlobProviderSection.Path); @@ -133,20 +136,20 @@ private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent) _writer.WritePropertyName(optionsSection.Key); using (new JsonObjectContext(_writer)) { - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountUri), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.BlobPrefix), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.ContainerName), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.CopyBufferSize), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignature), skipNotPresent, includeChildSections: false, redact: true); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountKey), skipNotPresent, includeChildSections: false, redact: true); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignatureName), skipNotPresent, includeChildSections: false, redact: false); - ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountKeyName), skipNotPresent, includeChildSections: false, redact: false); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountUri), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.BlobPrefix), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.ContainerName), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.CopyBufferSize), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignature), skipNotPresent, includeChildSections: false, redact: true, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountKey), skipNotPresent, includeChildSections: false, redact: true, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignatureName), skipNotPresent, includeChildSections: false, redact: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountKeyName), skipNotPresent, includeChildSections: false, redact: false, showSources: showSources); } } } } - IConfigurationSection fileSystemProviderSection = ProcessChildSection(egress, nameof(EgressOptions.FileSystem), skipNotPresent, includeChildSections: false); + IConfigurationSection fileSystemProviderSection = ProcessChildSection(egress, nameof(EgressOptions.FileSystem), skipNotPresent, includeChildSections: false, showSources: showSources); if (fileSystemProviderSection != null) { processedSectionPaths.Add(fileSystemProviderSection.Path); @@ -158,9 +161,9 @@ private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent) _writer.WritePropertyName(optionsSection.Key); using (new JsonObjectContext(_writer)) { - ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.DirectoryPath), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.IntermediateDirectoryPath), skipNotPresent, includeChildSections: false); - ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.CopyBufferSize), skipNotPresent, includeChildSections: false); + ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.DirectoryPath), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.IntermediateDirectoryPath), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(FileSystemEgressProviderOptions.CopyBufferSize), skipNotPresent, includeChildSections: false, showSources: showSources); } } } @@ -171,12 +174,12 @@ private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent) { if (!processedSectionPaths.Contains(childSection.Path)) { - ProcessChildSection(egress, childSection.Key, skipNotPresent, includeChildSections: true, redact: true); + ProcessChildSection(egress, childSection.Key, skipNotPresent, includeChildSections: true, redact: true, showSources: showSources); } } } - private IConfigurationSection ProcessChildSection(IConfiguration parentSection, string key, bool skipNotPresent, bool includeChildSections = true, bool redact = false) + private IConfigurationSection ProcessChildSection(IConfiguration parentSection, string key, bool skipNotPresent, bool includeChildSections = true, bool redact = false, bool showSources = false) { IConfigurationSection section = parentSection.GetSection(key); if (!section.Exists()) @@ -189,12 +192,12 @@ private IConfigurationSection ProcessChildSection(IConfiguration parentSection, return null; } - ProcessSection(section, includeChildSections, redact); + ProcessSection(section, includeChildSections, redact, showSources: showSources); return section; } - private void ProcessSection(IConfigurationSection section, bool includeChildSections = true, bool redact = false) + private void ProcessSection(IConfigurationSection section, bool includeChildSections = true, bool redact = false, bool showSources = false) { _writer.WritePropertyName(section.Key); @@ -217,11 +220,20 @@ private void ProcessSection(IConfigurationSection section, bool includeChildSect { if (child.GetChildren().Any()) { - ProcessChildren(child, includeChildSections, redact); + ProcessChildren(child, includeChildSections, redact, showSources: showSources); } else { WriteValue(child.Value, redact); + + string comment = GetConfigurationProvider(child, showSources); + + if (comment.Length > 0) + { + // TODO: Comments are currently written after Key/Value pairs due to a limitation in System.Text.Json + // that prevents comments from being directly after commas + _writer.WriteCommentValue(comment); + } } } @@ -229,13 +241,47 @@ private void ProcessSection(IConfigurationSection section, bool includeChildSect } else { - ProcessChildren(section, includeChildSections, redact); + ProcessChildren(section, includeChildSections, redact, showSources: showSources); } } else if (!canWriteChildren) { WriteValue(section.Value, redact); + + string comment = GetConfigurationProvider(section, showSources); + + if (comment.Length > 0) + { + // TODO: Comments are currently written after Key/Value pairs due to a limitation in System.Text.Json + // that prevents comments from being directly after commas + _writer.WriteCommentValue(comment); + } + } + } + + private string GetConfigurationProvider(IConfigurationSection section, bool showSources) + { + if (showSources) + { + var configurationProviders = ((IConfigurationRoot)_configuration).Providers.Reverse(); + + string comment = string.Empty; + + foreach (var provider in configurationProviders) + { + provider.TryGet(section.Path, out string value); + + if (!string.IsNullOrEmpty(value)) + { + comment = provider.ToString(); + break; + } + } + + return comment; } + + return string.Empty; } private bool CanWriteChildren(IConfigurationSection section, IEnumerable children) @@ -255,13 +301,13 @@ private void WriteValue(string value, bool redact) _writer.WriteStringValue(valueToWrite); } - private void ProcessChildren(IConfigurationSection section, bool includeChildSections, bool redact) + private void ProcessChildren(IConfigurationSection section, bool includeChildSections, bool redact, bool showSources) { using (new JsonObjectContext(_writer)) { foreach (IConfigurationSection child in section.GetChildren()) { - ProcessSection(child, includeChildSections, redact); + ProcessSection(child, includeChildSections, redact, showSources: showSources); } } } diff --git a/src/Tools/dotnet-monitor/Program.cs b/src/Tools/dotnet-monitor/Program.cs index c0b046b0245..3ce9e074f23 100644 --- a/src/Tools/dotnet-monitor/Program.cs +++ b/src/Tools/dotnet-monitor/Program.cs @@ -47,7 +47,8 @@ private static Command ConfigCommand() => // Handler CommandHandler.Create(ConfigShowCommandHandler.Invoke), SharedOptions(), - ConfigLevel() + ConfigLevel(), + ShowSources() } }; @@ -131,6 +132,14 @@ private static Option ConfigLevel() => Argument = new Argument(name: "level", getDefaultValue: () => ConfigDisplayLevel.Redacted) }; + private static Option ShowSources() => + new Option( + alias: "--show-sources", + description: Strings.HelpDescription_OptionShowSources) + { + Argument = new Argument(name: "showSources", getDefaultValue: () => false) + }; + public static Task Main(string[] args) { var parser = new CommandLineBuilder() diff --git a/src/Tools/dotnet-monitor/Strings.Designer.cs b/src/Tools/dotnet-monitor/Strings.Designer.cs index 8f6d0f38694..5b3d98c0450 100644 --- a/src/Tools/dotnet-monitor/Strings.Designer.cs +++ b/src/Tools/dotnet-monitor/Strings.Designer.cs @@ -492,6 +492,15 @@ internal static string HelpDescription_OptionNoHttpEgress { } } + /// + /// Looks up a localized string similar to Show loaded configuration providers from high to low priority. + /// + internal static string HelpDescription_OptionShowSources { + get { + return ResourceManager.GetString("HelpDescription_OptionShowSources", resourceCulture); + } + } + /// /// Looks up a localized string similar to Generates a new MonitorApiKey for each launch of the process.. /// @@ -1005,6 +1014,15 @@ internal static string Message_SettingsDump { } } + /// + /// Looks up a localized string similar to Configuration Providers (High to Low Priority):. + /// + internal static string Message_ShowSources { + get { + return ResourceManager.GetString("Message_ShowSources", resourceCulture); + } + } + /// /// Looks up a localized string similar to :NOT PRESENT:. /// diff --git a/src/Tools/dotnet-monitor/Strings.resx b/src/Tools/dotnet-monitor/Strings.resx index 90b661190a4..0d3a5bbd5ce 100644 --- a/src/Tools/dotnet-monitor/Strings.resx +++ b/src/Tools/dotnet-monitor/Strings.resx @@ -355,6 +355,10 @@ Turn off HTTP response egress Gets the string to display in help that explains what the '--no-http-egress' option does. + + Show loaded configuration providers from high to low priority + Gets the string to display in help that explains what the '--show-sources' option does. + Generates a new MonitorApiKey for each launch of the process. Gets the string to display in help that explains what the '--temp-apikey' option does. @@ -617,6 +621,10 @@ Settings in {0} format: Gets a header string for the configuration output of GenerateApiKeyCommand. + + Configuration Providers (High to Low Priority): + Gets the string for displaying the configuration providers with the --show-sources flag. + :NOT PRESENT: Gets a string similar to ":NOT PRESENT:". From 65c2fdaa185003cf0491d5b0d405481df3df7c1b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 14 Feb 2022 18:19:50 +0000 Subject: [PATCH 30/78] [main] Update dependencies from dotnet/aspnetcore (#1494) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b1e490e2d17..5a9c9de14cd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d + 6ac8ebc38cd43027efb4b2cbb32599befe9a6f60 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 6e05d78deba320a54ef10a265c6025bbb686efe6 - + https://github.com/dotnet/aspnetcore - e371b5d1601f0e7c61b4cd94155d5cd2fa3f8d8d + 6ac8ebc38cd43027efb4b2cbb32599befe9a6f60 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 2849fd4c920..ed03fdb1999 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22111.10 - 7.0.0-preview.2.22109.1 - 7.0.0-preview.2.22109.1 + 7.0.0-preview.2.22112.1 + 7.0.0-preview.2.22112.1 5.0.0-preview.22111.1 5.0.0-preview.22111.1 From b35702c46425d0bc578808c4cd1b0a5ab51b8cc0 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 14:36:47 +0000 Subject: [PATCH 31/78] Update dependencies from https://github.com/dotnet/symstore build 20220214.1 (#1503) [main] Update dependencies from dotnet/symstore --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5a9c9de14cd..daf1d47154d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -26,9 +26,9 @@ https://github.com/dotnet/arcade ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb - + https://github.com/dotnet/symstore - fed6eefe34de9690712e2ada8a2f7e6a9555b76d + 0733eb9a993ad0dc565a60c077afdb76b719fc92 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index ed03fdb1999..a6db0c6449b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,7 +53,7 @@ 7.0.0-preview.2.22113.2 7.0.0-preview.2.22113.2 - 1.0.310701 + 1.0.311401 3.1.22 From 66d334f45f5ee60ea3258397c2c7504cfc846e95 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 17:30:13 +0000 Subject: [PATCH 32/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220214.6 (#1505) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index daf1d47154d..187e3ee4de5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 6ac8ebc38cd43027efb4b2cbb32599befe9a6f60 + 4dfc0a726c4a88f183b642e47d8701fb1457b71c https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 6e05d78deba320a54ef10a265c6025bbb686efe6 - + https://github.com/dotnet/aspnetcore - 6ac8ebc38cd43027efb4b2cbb32599befe9a6f60 + 4dfc0a726c4a88f183b642e47d8701fb1457b71c https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index a6db0c6449b..784b7f1d388 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22111.10 - 7.0.0-preview.2.22112.1 - 7.0.0-preview.2.22112.1 + 7.0.0-preview.2.22114.6 + 7.0.0-preview.2.22114.6 5.0.0-preview.22111.1 5.0.0-preview.22111.1 From 9d8e0759d6a35cdc9a3518886f7128dab81cbcb6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 17:34:56 +0000 Subject: [PATCH 33/78] Update dependencies from https://github.com/dotnet/runtime build 20220214.13 (#1504) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 187e3ee4de5..6b7758cf9a5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 0733eb9a993ad0dc565a60c077afdb76b719fc92 - + https://github.com/dotnet/runtime - 6e05d78deba320a54ef10a265c6025bbb686efe6 + 14e64115c99bbad6f22a8e8331052c89e7006a89 https://github.com/dotnet/aspnetcore 4dfc0a726c4a88f183b642e47d8701fb1457b71c - + https://github.com/dotnet/runtime - 6e05d78deba320a54ef10a265c6025bbb686efe6 + 14e64115c99bbad6f22a8e8331052c89e7006a89 diff --git a/eng/Versions.props b/eng/Versions.props index 784b7f1d388..f1dc26ed375 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22111.1 5.0.0-preview.22111.1 - 7.0.0-preview.2.22113.2 - 7.0.0-preview.2.22113.2 + 7.0.0-preview.2.22114.13 + 7.0.0-preview.2.22114.13 1.0.311401 From 92ecfb6f6cf68e1411c90f0648f5c6fc497e2d23 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:36:03 +0000 Subject: [PATCH 34/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220214.1 (#1501) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6b7758cf9a5..271f867cdfc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 3c8b958f99bf246b6bd03c2ea778844a4bd7737d + e8b9993b66fac0ea23c610be57e3bfcbcbd683f5 - + https://github.com/dotnet/diagnostics - 3c8b958f99bf246b6bd03c2ea778844a4bd7737d + e8b9993b66fac0ea23c610be57e3bfcbcbd683f5 diff --git a/eng/Versions.props b/eng/Versions.props index f1dc26ed375..7d779a61505 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22114.6 7.0.0-preview.2.22114.6 - 5.0.0-preview.22111.1 - 5.0.0-preview.22111.1 + 5.0.0-preview.22114.1 + 5.0.0-preview.22114.1 7.0.0-preview.2.22114.13 7.0.0-preview.2.22114.13 From f6d74608226e735b8c26086161a6f7376289a6fb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 15 Feb 2022 18:36:19 +0000 Subject: [PATCH 35/78] Update dependencies from https://github.com/dotnet/arcade build 20220214.7 (#1502) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 271f867cdfc..d3f950af9e1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore 4dfc0a726c4a88f183b642e47d8701fb1457b71c - + https://github.com/dotnet/arcade - ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb + 6d977266bcc193caedb60a27ae44d14d9a11a040 - + https://github.com/dotnet/arcade - ff6cc4e9c3eef575f62a33a642ca80e79d27c9bb + 6d977266bcc193caedb60a27ae44d14d9a11a040 https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index 7d779a61505..272f20e64c7 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22111.10 + 7.0.0-beta.22114.7 7.0.0-preview.2.22114.6 7.0.0-preview.2.22114.6 diff --git a/global.json b/global.json index f1c7a8373f1..514a5587a21 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22111.10" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22114.7" } } From 295101222483575dffb42abc286e61ea65240b14 Mon Sep 17 00:00:00 2001 From: Jacob Parker Date: Tue, 15 Feb 2022 13:59:12 -0500 Subject: [PATCH 36/78] Fix broken link in docs TOC (#1506) --- documentation/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/README.md b/documentation/README.md index a48a68fed13..087b0fc7cbd 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -23,7 +23,7 @@ When running a dotnet application, differences in diverse local and production e - [`/livemetrics`](./api/livemetrics.md) - [`/logs`](./api/logs.md) - [`/info`](./api/info.md) - - [`/operations`](.api/operations.md) + - [`/operations`](./api/operations.md) - [Configuration](./configuration.md) - [JSON Schema](./schema.json) - [Authentication](./authentication.md) From 231987e51f3addfd31a198857f6652e2f3eb846c Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Tue, 15 Feb 2022 17:54:49 -0500 Subject: [PATCH 37/78] Copy 7.0.0 Preview 1 release notes to Main (#1499) --- documentation/releaseNotes/releaseNotes.md | 5 ++--- .../releaseNotes.v7.0.0-preview.1.22109.7.md | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 documentation/releaseNotes/releaseNotes.v7.0.0-preview.1.22109.7.md diff --git a/documentation/releaseNotes/releaseNotes.md b/documentation/releaseNotes/releaseNotes.md index aa1dfe18f97..f38e75eb581 100644 --- a/documentation/releaseNotes/releaseNotes.md +++ b/documentation/releaseNotes/releaseNotes.md @@ -1,7 +1,6 @@ Today we are releasing the next preview of the `dotnet monitor` tool. This release includes: -- Load a profiler via a collection rule action (#781) -- Get or Set an environment via a collection rule action (#1176) -- Add `MachineJson` option to `--output` parameter for `generatekey` command. This is useful for automating credential provisioning. (#1428) +- ⚠️ [Here is a breaking change we did and its work item] (#737) +- [Here is a new feature we added and its work item] (#737) \*⚠️ **_indicates a breaking change_** diff --git a/documentation/releaseNotes/releaseNotes.v7.0.0-preview.1.22109.7.md b/documentation/releaseNotes/releaseNotes.v7.0.0-preview.1.22109.7.md new file mode 100644 index 00000000000..eaa68fe801c --- /dev/null +++ b/documentation/releaseNotes/releaseNotes.v7.0.0-preview.1.22109.7.md @@ -0,0 +1,11 @@ +Today we are releasing the next official preview of the `dotnet monitor` tool. This release includes: + +- Load a profiler via a collection rule action (#781) +- Get or Set an environment variable via a collection rule action (#1176) +- Add `MachineJson` option to `--output` parameter for `generatekey` command. This is useful for automating credential provisioning. (#1428) +- Allow for simplified diagnostic port configuration (#1292) +- Ensure `config show` command displays arrays without indices (#1054) +- ⚠️Remove `netcoreapp3.1` TFM (#1267) +- Add `net7.0` TFM (#1269) + +\*⚠️ **_indicates a breaking change_** From 4cca8d9f0d8f4f0b06328e508d0d7954afd6cdfb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 16 Feb 2022 08:44:13 -0800 Subject: [PATCH 38/78] Update dependencies from https://github.com/dotnet/runtime build 20220215.15 (#1508) Microsoft.NETCore.App.Runtime.win-x64 , VS.Redist.Common.NetCore.SharedFramework.x64.7.0 From Version 7.0.0-preview.2.22114.13 -> To Version 7.0.0-preview.2.22115.15 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d3f950af9e1..e8ab7a1e001 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 0733eb9a993ad0dc565a60c077afdb76b719fc92 - + https://github.com/dotnet/runtime - 14e64115c99bbad6f22a8e8331052c89e7006a89 + 32434f9007428d7d806df6afce80c36a308c2fa0 https://github.com/dotnet/aspnetcore 4dfc0a726c4a88f183b642e47d8701fb1457b71c - + https://github.com/dotnet/runtime - 14e64115c99bbad6f22a8e8331052c89e7006a89 + 32434f9007428d7d806df6afce80c36a308c2fa0 diff --git a/eng/Versions.props b/eng/Versions.props index 272f20e64c7..c968db9bca3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22114.1 5.0.0-preview.22114.1 - 7.0.0-preview.2.22114.13 - 7.0.0-preview.2.22114.13 + 7.0.0-preview.2.22115.15 + 7.0.0-preview.2.22115.15 1.0.311401 From 73a612ddf5bd092b8e7cf03ba3996a6cbed4c16e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 16 Feb 2022 14:57:57 -0800 Subject: [PATCH 39/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220215.1 (#1507) Microsoft.Diagnostics.Monitoring.EventPipe , Microsoft.Diagnostics.Monitoring From Version 5.0.0-preview.22114.1 -> To Version 5.0.0-preview.22115.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e8ab7a1e001..4e6af68c514 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - e8b9993b66fac0ea23c610be57e3bfcbcbd683f5 + 731bab6f51958effa53821ff01861871065b461d - + https://github.com/dotnet/diagnostics - e8b9993b66fac0ea23c610be57e3bfcbcbd683f5 + 731bab6f51958effa53821ff01861871065b461d diff --git a/eng/Versions.props b/eng/Versions.props index c968db9bca3..6c8388adb0b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22114.6 7.0.0-preview.2.22114.6 - 5.0.0-preview.22114.1 - 5.0.0-preview.22114.1 + 5.0.0-preview.22115.1 + 5.0.0-preview.22115.1 7.0.0-preview.2.22115.15 7.0.0-preview.2.22115.15 From 835c7110b296224fcf7b3db23871ef0c5d6fcbd4 Mon Sep 17 00:00:00 2001 From: Patrick Fenelon Date: Thu, 17 Feb 2022 12:55:18 -0800 Subject: [PATCH 40/78] Reduce log messages for APIKey changes when no API key is configured (#1510) * Reduce log messages for APIKey changes when no API key is configured Closes #1509 Co-authored-by: Justin Anderson --- .../Auth/JwtBearerPostConfigure.cs | 2 +- .../Auth/MonitorApiKeyConfiguration.cs | 1 + .../MonitorApiKeyConfigurationObserver.cs | 14 +++++++---- .../Auth/MonitorApiKeyPostConfigure.cs | 12 ++++++++++ src/Tools/dotnet-monitor/LoggingEventIds.cs | 1 + src/Tools/dotnet-monitor/LoggingExtensions.cs | 23 +++++++++++++++++++ src/Tools/dotnet-monitor/Strings.Designer.cs | 9 ++++++++ src/Tools/dotnet-monitor/Strings.resx | 7 ++++++ 8 files changed, 64 insertions(+), 5 deletions(-) diff --git a/src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs b/src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs index ef8a3c1372a..a8621420913 100644 --- a/src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs +++ b/src/Tools/dotnet-monitor/Auth/JwtBearerPostConfigure.cs @@ -29,7 +29,7 @@ public JwtBearerPostConfigure( public void PostConfigure(string name, JwtBearerOptions options) { MonitorApiKeyConfiguration configSnapshot = _apiKeyConfig.CurrentValue; - if (configSnapshot.ValidationErrors.Any()) + if (!configSnapshot.Configured || configSnapshot.ValidationErrors.Any()) { options.SecurityTokenValidators.Add(new RejectAllSecurityValidator()); return; diff --git a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfiguration.cs b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfiguration.cs index 79a2583be67..e7a7b40a789 100644 --- a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfiguration.cs +++ b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfiguration.cs @@ -17,6 +17,7 @@ namespace Microsoft.Diagnostics.Tools.Monitor /// internal class MonitorApiKeyConfiguration : AuthenticationSchemeOptions { + public bool Configured { get; set; } public string Subject { get; set; } public SecurityKey PublicKey { get; set; } public IEnumerable ValidationErrors { get; set; } diff --git a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfigurationObserver.cs b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfigurationObserver.cs index b3dc7954453..6723ee2054b 100644 --- a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfigurationObserver.cs +++ b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyConfigurationObserver.cs @@ -49,14 +49,20 @@ private void OnMonitorApiKeyOptionsChanged(MonitorApiKeyConfiguration options) private void CheckMonitorApiKeyOptions(MonitorApiKeyConfiguration options) { - // ValidationErrors will be null if API key authentication is not enabled. - if (null != options.ValidationErrors && options.ValidationErrors.Any()) + if (options.Configured) { - _logger.ApiKeyValidationFailures(options.ValidationErrors); + if (null != options.ValidationErrors && options.ValidationErrors.Any()) + { + _logger.ApiKeyValidationFailures(options.ValidationErrors); + } + else + { + _logger.ApiKeyAuthenticationOptionsValidated(); + } } else { - _logger.ApiKeyAuthenticationOptionsValidated(); + _logger.MonitorApiKeyNotConfigured(); } } } diff --git a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyPostConfigure.cs b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyPostConfigure.cs index 907cb3addb6..45bfa456e96 100644 --- a/src/Tools/dotnet-monitor/Auth/MonitorApiKeyPostConfigure.cs +++ b/src/Tools/dotnet-monitor/Auth/MonitorApiKeyPostConfigure.cs @@ -36,6 +36,18 @@ public void PostConfigure(string name, MonitorApiKeyConfiguration options) IList errors = new List(); + // If nothing is set, lets not attach an error and instead pass along the blank config + if (sourceOptions.Subject == null && sourceOptions.PublicKey == null) + { + options.Configured = false; + options.Subject = null; + options.PublicKey = null; + return; + } + + // Some options are configured (but may not be valid) + options.Configured = true; + Validator.TryValidateObject( sourceOptions, new ValidationContext(sourceOptions, null, null), diff --git a/src/Tools/dotnet-monitor/LoggingEventIds.cs b/src/Tools/dotnet-monitor/LoggingEventIds.cs index 1ced6efc0d8..9a61250d392 100644 --- a/src/Tools/dotnet-monitor/LoggingEventIds.cs +++ b/src/Tools/dotnet-monitor/LoggingEventIds.cs @@ -66,6 +66,7 @@ internal enum LoggingEventIds LoadingProfiler = 53, SetEnvironmentVariable = 54, GetEnvironmentVariable = 55, + MonitorApiKeyNotConfigured = 56, } internal static class LoggingEventIdsExtensions diff --git a/src/Tools/dotnet-monitor/LoggingExtensions.cs b/src/Tools/dotnet-monitor/LoggingExtensions.cs index 40b1e54cf00..1acb86870f4 100644 --- a/src/Tools/dotnet-monitor/LoggingExtensions.cs +++ b/src/Tools/dotnet-monitor/LoggingExtensions.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using System.Globalization; namespace Microsoft.Diagnostics.Tools.Monitor { @@ -301,6 +302,12 @@ internal static class LoggingExtensions logLevel: LogLevel.Information, formatString: Strings.LogFormatString_GetEnvironmentVariable); + private static readonly Action _monitorApiKeyNotConfigured = + LoggerMessage.Define( + eventId: LoggingEventIds.MonitorApiKeyNotConfigured.EventId(), + logLevel: LogLevel.Warning, + formatString: Strings.LogFormatString_ApiKeyNotConfigured); + public static void EgressProviderInvalidOptions(this ILogger logger, string providerName) { _egressProviderInvalidOptions(logger, providerName, null); @@ -544,5 +551,21 @@ public static void GettingEnvironmentVariable(this ILogger logger, string variab { _getEnvironmentVariable(logger, variableName, processId, null); } + + public static void MonitorApiKeyNotConfigured(this ILogger logger) + { + const long myFwLinkId = 2187444; + string fwLink = GetFwLinkWithCurrentLcidUri(myFwLinkId); + _monitorApiKeyNotConfigured(logger, fwLink, null); + } + + private static string GetFwLinkWithCurrentLcidUri(long fwlinkId) + { + return string.Format( + CultureInfo.InvariantCulture, + @"https://go.microsoft.com/fwlink/?linkid={0}&clcid=0x{1:x}", + fwlinkId, + CultureInfo.CurrentUICulture.LCID); + } } } diff --git a/src/Tools/dotnet-monitor/Strings.Designer.cs b/src/Tools/dotnet-monitor/Strings.Designer.cs index 5b3d98c0450..4c4682ea288 100644 --- a/src/Tools/dotnet-monitor/Strings.Designer.cs +++ b/src/Tools/dotnet-monitor/Strings.Designer.cs @@ -546,6 +546,15 @@ internal static string LogFormatString_ApiKeyAuthenticationOptionsValidated { } } + /// + /// Looks up a localized string similar to API key authentication is not configured. See {0} for more details.. + /// + internal static string LogFormatString_ApiKeyNotConfigured { + get { + return ResourceManager.GetString("LogFormatString_ApiKeyNotConfigured", resourceCulture); + } + } + /// /// Looks up a localized string similar to The {configName} have changed, new values: Subject={subject}, PublicKey={publicKey}. /// diff --git a/src/Tools/dotnet-monitor/Strings.resx b/src/Tools/dotnet-monitor/Strings.resx index 0d3a5bbd5ce..64826bed677 100644 --- a/src/Tools/dotnet-monitor/Strings.resx +++ b/src/Tools/dotnet-monitor/Strings.resx @@ -379,6 +379,13 @@ Gets the format string that is printed in the 22:ApiKeyAuthenticationOptionsChanged event. 1 Format Parameter: 1. apiAuthenticationConfigKey: The string key of ApiAuthentication object in configuration. + + + API key authentication is not configured. See {0} for more details. + Gets the format string that is printed in the 56:MonitorApiKeyNotConfigured event. + +1 formattable parameter +0. Culture LCID of the documentation link The {configName} have changed, new values: Subject={subject}, PublicKey={publicKey} From 8f8b1fd0727e9839d54f244eff04c36574fad1c2 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Thu, 17 Feb 2022 13:24:36 -0800 Subject: [PATCH 41/78] Set OpenApiGen runner to use ASP.NET framework (#1514) --- .../OpenApiGeneratorTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/OpenApiGeneratorTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/OpenApiGeneratorTests.cs index 6b329f727c3..24ca743d2d0 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/OpenApiGeneratorTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.OpenApiGen.UnitTests/OpenApiGeneratorTests.cs @@ -103,6 +103,7 @@ private async Task GenerateDocumentAsync() string path = Path.GetTempFileName(); DotNetRunner runner = new(); + runner.FrameworkReference = DotNetFrameworkReference.Microsoft_AspNetCore_App; runner.EntrypointAssemblyPath = OpenApiGenPath; runner.Arguments = path; From 22773dbda8db59a731e393f2ff178393b05b69db Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Thu, 17 Feb 2022 13:25:37 -0800 Subject: [PATCH 42/78] Update releases and docker documentation (#1515) --- documentation/authentication.md | 2 +- documentation/configuration.md | 6 +++--- documentation/docker.md | 9 ++++++--- documentation/releases.md | 13 +++++++++++-- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/documentation/authentication.md b/documentation/authentication.md index 58359a35bc5..7c2c19991e1 100644 --- a/documentation/authentication.md +++ b/documentation/authentication.md @@ -97,7 +97,7 @@ spec: secretName: apikey containers: - name: dotnetmonitoragent - image: mcr.microsoft.com/dotnet/monitor:6.0 + image: mcr.microsoft.com/dotnet/monitor:6 volumeMounts: - name: apikey mountPath: /etc/dotnet-monitor diff --git a/documentation/configuration.md b/documentation/configuration.md index cbf4dafab74..f38d49d5a2d 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -70,7 +70,7 @@ spec: secretName: apikey containers: - name: dotnetmonitoragent - image: mcr.microsoft.com/dotnet/monitor:6.0 + image: mcr.microsoft.com/dotnet/monitor:6 volumeMounts: - name: config mountPath: /etc/dotnet-monitor @@ -97,7 +97,7 @@ spec: name: my-configmap containers: - name: dotnetmonitoragent - image: mcr.microsoft.com/dotnet/monitor:6.0 + image: mcr.microsoft.com/dotnet/monitor:6 volumeMounts: - name: config mountPath: /etc/dotnet-monitor @@ -117,7 +117,7 @@ spec: name: my-configmap containers: - name: dotnetmonitoragent - image: mcr.microsoft.com/dotnet/monitor:6.0 + image: mcr.microsoft.com/dotnet/monitor:6 volumeMounts: - name: config mountPath: /etc/dotnet-monitor diff --git a/documentation/docker.md b/documentation/docker.md index 12afc4c8071..dec58272052 100644 --- a/documentation/docker.md +++ b/documentation/docker.md @@ -8,14 +8,17 @@ In addition to its availability as a .NET CLI tool, the `dotnet monitor` tool is | Version | Platform | Architecture | Link | |---|---|---|---| -| 6.0 (Current) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/main/src/monitor/6.0/alpine/amd64/Dockerfile | +| 7.0 (Preview) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/main/src/monitor/7.0/alpine/amd64/Dockerfile | +| 6.1 (Current, Latest) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/main/src/monitor/6.1/alpine/amd64/Dockerfile | +| 6.0 | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/main/src/monitor/6.0/alpine/amd64/Dockerfile | ### Nightly Dockerfiles | Version | Platform | Architecture | Link | |---|---|---|---| -| 7.0 (Preview) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/nightly/src/monitor/7.0/alpine/amd64/Dockerfile | -| 6.0 (Current) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/nightly/src/monitor/6.0/alpine/amd64/Dockerfile | +| 7.0 (Preview, Latest) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/nightly/src/monitor/7.0/alpine/amd64/Dockerfile | +| 6.1 (Current) | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/nightly/src/monitor/6.1/alpine/amd64/Dockerfile | +| 6.0 | Linux (Alpine) | amd64 | https://github.com/dotnet/dotnet-docker/blob/nightly/src/monitor/6.0/alpine/amd64/Dockerfile | ## Image Repositories diff --git a/documentation/releases.md b/documentation/releases.md index 642cdc75be0..1d4ad6b0fe3 100644 --- a/documentation/releases.md +++ b/documentation/releases.md @@ -1,5 +1,14 @@ # Releases -| Version | Release Date | Latest Patch Version | Runtime Frameworks | +## Supported Versions + +| Version | Original Release Date | Latest Patch Version | Patch Release Date | End of Support | Runtime Frameworks | +|---|---|---|---|---|---| +| 6.1 | February 17, 2022 | [6.1.0](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v6.1.0.md) | February 17, 2022 | | .NET Core 3.1 (with major roll forward)
.NET 6 | +| 6.0 | November 8, 2021 | [6.0.2](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v6.0.2.md) | February 8, 2022 | May 17, 2022 | .NET Core 3.1 (with major roll forward)
.NET 6 | + +## Preview Versions + +| Version | Latest Version | Release Date | Runtime Frameworks | |---|---|---|---| -| 6.0 | February 8, 2022 | [6.0.2](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v6.0.2.md) | .NET Core 3.1 (with major roll forward)
.NET 6 | \ No newline at end of file +| 7.0 | [7.0.0 Preview 1](https://github.com/dotnet/dotnet-monitor/blob/main/documentation/releaseNotes/releaseNotes.v7.0.0-preview.1.22109.7.md) | February 17, 2022 | .NET 6 (with major roll forward)
.NET 7 | From 196da69ca5a2d42a17df3ddc692af11f75672e79 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Thu, 17 Feb 2022 19:12:44 -0500 Subject: [PATCH 43/78] List Configuration Sources - Testing (#1500) --- .../ConfigurationTests.cs | 90 ++++++++++++++++--- .../DefaultProcess.json | 2 +- .../AuthenticationFull.json | 6 ++ .../AuthenticationRedacted.json | 6 ++ .../CollectionRules.json | 30 +++++++ .../DefaultProcess.json | 8 ++ .../DiagnosticPort.json | 4 + .../EgressFull.json | 18 ++++ .../EgressRedacted.json | 24 +++++ .../GlobalCounter.json | 3 + .../Logging.json | 9 ++ .../Metrics.json | 15 ++++ .../Storage.json | 3 + .../URLs.json | 1 + ...agnostics.Monitoring.Tool.UnitTests.csproj | 36 ++++++++ .../SampleConfigurations/DefaultProcess.json | 2 +- .../ShowSourcesTestsConstants.cs | 44 +++++++++ 17 files changed, 285 insertions(+), 16 deletions(-) create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationFull.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationRedacted.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/CollectionRules.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DefaultProcess.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DiagnosticPort.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressFull.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/GlobalCounter.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Logging.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Metrics.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Storage.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/URLs.json create mode 100644 src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ShowSourcesTestsConstants.cs diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ConfigurationTests.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ConfigurationTests.cs index add1c55c0fc..390b76b98e9 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ConfigurationTests.cs +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ConfigurationTests.cs @@ -71,6 +71,10 @@ public sealed class ConfigurationTests "Egress" }; + private const string ExpectedShowSourcesConfigurationsDirectory = "ExpectedShowSourcesConfigurations"; + + private const string ExpectedConfigurationsDirectory = "ExpectedConfigurations"; + private readonly ITestOutputHelper _outputHelper; public ConfigurationTests(ITestOutputHelper outputHelper) @@ -190,7 +194,7 @@ public void FullConfigurationTest(bool redact) }; // This is the settings.json file in the user profile directory. - File.WriteAllText(Path.Combine(userConfigDir.FullName, "settings.json"), ConstructUserSettingsJson()); + File.WriteAllText(Path.Combine(userConfigDir.FullName, "settings.json"), ConstructSettingsJson()); // Create the initial host builder. IHostBuilder builder = HostBuilderHelper.CreateHostBuilder(settings); @@ -208,7 +212,62 @@ public void FullConfigurationTest(bool redact) string generatedConfig = WriteAndRetrieveConfiguration(rootConfiguration, redact); - Assert.Equal(CleanWhitespace(generatedConfig), CleanWhitespace(ConstructExpectedOutput(redact))); + Assert.Equal(CleanWhitespace(generatedConfig), CleanWhitespace(ConstructExpectedOutput(redact, ExpectedConfigurationsDirectory))); + } + + /// + /// This is a full configuration test that lists the configuration provider source for each piece of config. + /// Instead of having to explicitly define every expected value, this reuses the individual categories to ensure they + /// assemble properly when combined. + /// + [Theory] + [InlineData(true)] + [InlineData(false)] + public void FullConfigurationWithSourcesTest(bool redact) + { + using TemporaryDirectory contentRootDirectory = new(_outputHelper); + using TemporaryDirectory sharedConfigDir = new(_outputHelper); + using TemporaryDirectory userConfigDir = new(_outputHelper); + + // Set up the initial settings used to create the host builder. + HostBuilderSettings settings = new() + { + Authentication = HostBuilderHelper.CreateAuthConfiguration(noAuth: false, tempApiKey: false), + ContentRootDirectory = contentRootDirectory.FullName, + SharedConfigDirectory = sharedConfigDir.FullName, + UserConfigDirectory = userConfigDir.FullName + }; + + settings.Urls = new[] { "https://localhost:44444" }; // This corresponds to the value in SampleConfigurations/URLs.json + + // This is the settings.json file in the user profile directory. + File.WriteAllText(Path.Combine(userConfigDir.FullName, "settings.json"), ConstructSettingsJson("Egress.json", "CollectionRules.json")); + + // This is the appsettings.json file that is normally next to the entrypoint assembly. + // The location of the appsettings.json is determined by the content root in configuration. + File.WriteAllText(Path.Combine(contentRootDirectory.FullName, "appsettings.json"), ConstructSettingsJson("Storage.json", "Authentication.json")); + + // This is the settings.json file in the shared configuration directory that is visible + // to all users on the machine e.g. /etc/dotnet-monitor on Unix systems. + File.WriteAllText(Path.Combine(sharedConfigDir.FullName, "settings.json"), ConstructSettingsJson("Logging.json", "Metrics.json")); + + // Create the initial host builder. + IHostBuilder builder = HostBuilderHelper.CreateHostBuilder(settings); + + // Override the environment configurations to use predefined values so that the test host + // doesn't inadvertently provide unexpected values. Passing null replaces with an empty + // in-memory collection source. + builder.ReplaceAspnetEnvironment(ShowSourcesTestsConstants.DefaultProcess_EnvironmentVariables); + builder.ReplaceDotnetEnvironment(ShowSourcesTestsConstants.DiagnosticPort_EnvironmentVariables); + builder.ReplaceMonitorEnvironment(ShowSourcesTestsConstants.GlobalCounter_EnvironmentVariables); + + // Build the host and get the configuration. + IHost host = builder.Build(); + IConfiguration rootConfiguration = host.Services.GetRequiredService(); + + string generatedConfig = WriteAndRetrieveConfiguration(rootConfiguration, redact, showSources: true); + + Assert.Equal(CleanWhitespace(generatedConfig), CleanWhitespace(ConstructExpectedOutput(redact, ExpectedShowSourcesConfigurationsDirectory))); } /// @@ -252,12 +311,12 @@ public void ConnectionModeTest(string fileName, IDictionary diag Assert.Contains(CleanWhitespace(expectedDiagnosticPortConfig), CleanWhitespace(generatedConfig)); } - private string WriteAndRetrieveConfiguration(IConfiguration configuration, bool redact, bool skipNotPresent=false) + private string WriteAndRetrieveConfiguration(IConfiguration configuration, bool redact, bool skipNotPresent=false, bool showSources = false) { Stream stream = new MemoryStream(); using ConfigurationJsonWriter jsonWriter = new ConfigurationJsonWriter(stream); - jsonWriter.Write(configuration, full: !redact, skipNotPresent: skipNotPresent); + jsonWriter.Write(configuration, full: !redact, skipNotPresent: skipNotPresent, showSources: showSources); jsonWriter.Dispose(); stream.Position = 0; @@ -277,19 +336,22 @@ private string CleanWhitespace(string rawText) return string.Concat(rawText.Where(c => !char.IsWhiteSpace(c))); } - private string ConstructUserSettingsJson() + private string ConstructSettingsJson(params string[] permittedFileNames) { - string[] fileNames = Directory.GetFiles(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SampleConfigurations")); + string[] filePaths = Directory.GetFiles(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "SampleConfigurations")); IDictionary combinedFiles = new Dictionary(); - foreach (var fileName in fileNames) + foreach (var filePath in filePaths) { - IDictionary deserializedFile = JsonSerializer.Deserialize>(File.ReadAllText(fileName)); - - foreach ((string key, JsonElement element) in deserializedFile) + if (!permittedFileNames.Any() || permittedFileNames.Contains(Path.GetFileName(filePath))) { - combinedFiles.Add(key, element); + IDictionary deserializedFile = JsonSerializer.Deserialize>(File.ReadAllText(filePath)); + + foreach ((string key, JsonElement element) in deserializedFile) + { + combinedFiles.Add(key, element); + } } } @@ -298,7 +360,7 @@ private string ConstructUserSettingsJson() return generatedUserSettings; } - private string ConstructExpectedOutput(bool redact) + private string ConstructExpectedOutput(bool redact, string directoryNameLocation) { Dictionary categoryMapping = GetConfigurationFileNames(redact); @@ -313,9 +375,9 @@ private string ConstructExpectedOutput(bool redact) if (categoryMapping.TryGetValue(key, out string fileName)) { - string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ExpectedConfigurations", fileName); + string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), directoryNameLocation, fileName); - writer.WriteRawValue(File.ReadAllText(expectedPath)); + writer.WriteRawValue(File.ReadAllText(expectedPath), skipInputValidation: true); } else { diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/DefaultProcess.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/DefaultProcess.json index 11ded41686d..6291c1ce8c9 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/DefaultProcess.json +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/DefaultProcess.json @@ -1,7 +1,7 @@ { "Filters": [ { - "Key": "ProcessID", + "Key": "ProcessId", "Value": "12345" } ] diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationFull.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationFull.json new file mode 100644 index 00000000000..d7963e592a3 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationFull.json @@ -0,0 +1,6 @@ +{ + "MonitorApiKey": { + "PublicKey": "eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19" /*JsonConfigurationProvider for 'appsettings.json' (Optional)*/, + "Subject": "ae5473b6-8dad-498d-b915-ffffffffffff" /*JsonConfigurationProvider for 'appsettings.json' (Optional)*/ + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationRedacted.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationRedacted.json new file mode 100644 index 00000000000..b6639b31c9e --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/AuthenticationRedacted.json @@ -0,0 +1,6 @@ +{ + "MonitorApiKey": { + "Subject": "ae5473b6-8dad-498d-b915-ffffffffffff" /*JsonConfigurationProvider for 'appsettings.json' (Optional)*/, + "PublicKey": ":REDACTED:" /*JsonConfigurationProvider for 'appsettings.json' (Optional)*/ + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/CollectionRules.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/CollectionRules.json new file mode 100644 index 00000000000..5f17050d8b6 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/CollectionRules.json @@ -0,0 +1,30 @@ +{ + "LargeGCHeap": { + "Actions": [ + { + "Settings": { + "Egress": "artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + }, + "Type": "CollectGCDump" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + ], + "Filters": [ + { + "Key": "ProcessName" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "Value": "FirstWebApp" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + ], + "Limits": { + "ActionCount": "2" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "ActionCountSlidingWindowDuration": "1:00:00" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + }, + "Trigger": { + "Settings": { + "CounterName": "gc-heap-size" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "GreaterThan": "10" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "ProviderName": "System.Runtime" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + }, + "Type": "EventCounter" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DefaultProcess.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DefaultProcess.json new file mode 100644 index 00000000000..631627ccb2c --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DefaultProcess.json @@ -0,0 +1,8 @@ +{ + "Filters": [ + { + "Key": "ProcessId" /*Microsoft.Extensions.Configuration.ChainedConfigurationProvider*/, + "Value": "12345" /*Microsoft.Extensions.Configuration.ChainedConfigurationProvider*/ + } + ] +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DiagnosticPort.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DiagnosticPort.json new file mode 100644 index 00000000000..6b8d25a54ad --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/DiagnosticPort.json @@ -0,0 +1,4 @@ +{ + "ConnectionMode": "Listen" /*Microsoft.Extensions.Configuration.ChainedConfigurationProvider*/, + "EndpointName": "\\\\.\\pipe\\dotnet-monitor-pipe" /*Microsoft.Extensions.Configuration.ChainedConfigurationProvider*/ +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressFull.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressFull.json new file mode 100644 index 00000000000..dc4c1337989 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressFull.json @@ -0,0 +1,18 @@ +{ + "AzureBlobStorage": { + "monitorBlob": { + "accountKeyName": "MonitorBlobAccountKey" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "accountUri": "https://exampleaccount.blob.core.windows.net" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "blobPrefix": "artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "containerName": "dotnet-monitor" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + }, + "FileSystem": { + "artifacts": { + "directoryPath": "/artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + }, + "Properties": { + "MonitorBlobAccountKey": "accountKey" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json new file mode 100644 index 00000000000..999ba2eb26f --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json @@ -0,0 +1,24 @@ +{ + "Properties": { + "MonitorBlobAccountKey": ":REDACTED:" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + }, + "AzureBlobStorage": { + "monitorBlob": { + "AccountUri": "https://exampleaccount.blob.core.windows.net" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "BlobPrefix": "artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "ContainerName": "dotnet-monitor" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "CopyBufferSize": ":NOT PRESENT:", + "SharedAccessSignature": ":NOT PRESENT:", + "AccountKey": ":NOT PRESENT:", + "SharedAccessSignatureName": ":NOT PRESENT:", + "AccountKeyName": "MonitorBlobAccountKey" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + }, + "FileSystem": { + "artifacts": { + "DirectoryPath": " /artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "IntermediateDirectoryPath": ":NOT PRESENT:", + "CopyBufferSize": ":NOT PRESENT:" + } + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/GlobalCounter.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/GlobalCounter.json new file mode 100644 index 00000000000..6364d5dcda8 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/GlobalCounter.json @@ -0,0 +1,3 @@ +{ + "IntervalSeconds": "2" /*MemoryConfigurationProvider*/ +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Logging.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Logging.json new file mode 100644 index 00000000000..831cd5d8869 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Logging.json @@ -0,0 +1,9 @@ +{ + "CaptureScopes": "True" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "Console": { + "FormatterOptions": { + "ColorBehavior": "Default" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + }, + "LogToStandardErrorThreshold": "Error" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Metrics.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Metrics.json new file mode 100644 index 00000000000..2c60f73b18d --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Metrics.json @@ -0,0 +1,15 @@ +{ + "Enabled": "True" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "Endpoints": "http://localhost:52325" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "IncludeDefaultProviders": "True" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "MetricCount": "10" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "Providers": [ + { + "CounterNames": [ + "connections-per-second" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, + "total-connections" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + ], + "ProviderName": "Microsoft-AspNetCore-Server-Kestrel" /*JsonConfigurationProvider for 'settings.json' (Optional)*/ + } + ] +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Storage.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Storage.json new file mode 100644 index 00000000000..43dec97011e --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/Storage.json @@ -0,0 +1,3 @@ +{ + "DumpTempFolder": "/ephemeral-directory/" /*JsonConfigurationProvider for 'appsettings.json' (Optional)*/ +} diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/URLs.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/URLs.json new file mode 100644 index 00000000000..d788cd2c20f --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/URLs.json @@ -0,0 +1 @@ +"https://localhost:44444"/*Microsoft.Extensions.Configuration.ChainedConfigurationProvider*/ diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests.csproj b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests.csproj index 2ddb087aae9..c9c4a32d8c0 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests.csproj +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests.csproj @@ -15,6 +15,42 @@ + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + Always diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/SampleConfigurations/DefaultProcess.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/SampleConfigurations/DefaultProcess.json index 2788633320e..1bbd8a9c6a4 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/SampleConfigurations/DefaultProcess.json +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/SampleConfigurations/DefaultProcess.json @@ -2,7 +2,7 @@ "DefaultProcess": { "Filters": [ { - "Key": "ProcessID", + "Key": "ProcessId", "Value": "12345" } ] diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ShowSourcesTestsConstants.cs b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ShowSourcesTestsConstants.cs new file mode 100644 index 00000000000..fe0e646d0c2 --- /dev/null +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ShowSourcesTestsConstants.cs @@ -0,0 +1,44 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Diagnostics.Monitoring.WebApi; +using Microsoft.Diagnostics.Tools.Monitor; +using System; +using System.Collections.Generic; + +namespace Microsoft.Diagnostics.Monitoring.Tool.UnitTests +{ + internal class ShowSourcesTestsConstants + { + // The values used here correspond to the ones used in SampleConfigurations + + public const string DiagnosticPort = nameof(RootOptions.DiagnosticPort); + public const string EndpointName = $"{nameof(RootOptions.DiagnosticPort)}:{nameof(DiagnosticPortOptions.EndpointName)}"; + public const string ConnectionMode = $"{nameof(RootOptions.DiagnosticPort)}:{nameof(DiagnosticPortOptions.ConnectionMode)}"; + public const string IntervalSeconds = $"{nameof(RootOptions.GlobalCounter)}:{nameof(GlobalCounterOptions.IntervalSeconds)}"; + public const string FiltersKey = $"{nameof(RootOptions.DefaultProcess)}:{nameof(ProcessFilterOptions.Filters)}:0:{nameof(ProcessFilterDescriptor.Key)}"; + public const string FiltersValue = $"{nameof(RootOptions.DefaultProcess)}:{nameof(ProcessFilterOptions.Filters)}:0:{nameof(ProcessFilterDescriptor.Value)}"; + + public const string IntervalSecondsValue = "2"; + public const string ProcessIdValue = "12345"; + public const string DiagnosticPortValue = "\\\\.\\pipe\\dotnet-monitor-pipe"; + + public static readonly Dictionary DefaultProcess_EnvironmentVariables = new(StringComparer.Ordinal) + { + { FiltersKey, nameof(ProcessKey.ProcessId) }, + { FiltersValue, ProcessIdValue } + }; + + public static readonly Dictionary DiagnosticPort_EnvironmentVariables = new(StringComparer.Ordinal) + { + { ConnectionMode, nameof(DiagnosticPortConnectionMode.Listen) }, + { EndpointName, DiagnosticPortValue } + }; + + public static readonly Dictionary GlobalCounter_EnvironmentVariables = new(StringComparer.Ordinal) + { + { IntervalSeconds, IntervalSecondsValue }, + }; + } +} From 9c4d43130b282802e8abd3df036e75b15b8f5abb Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 05:10:35 +0000 Subject: [PATCH 44/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220216.1 (#1511) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4e6af68c514..38d7d80d9dc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 731bab6f51958effa53821ff01861871065b461d + 2b173d87f335cfb6f78839c6d62dd2a8c78b304e - + https://github.com/dotnet/diagnostics - 731bab6f51958effa53821ff01861871065b461d + 2b173d87f335cfb6f78839c6d62dd2a8c78b304e diff --git a/eng/Versions.props b/eng/Versions.props index 6c8388adb0b..3a4e9fc7b2e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.2.22114.6 7.0.0-preview.2.22114.6 - 5.0.0-preview.22115.1 - 5.0.0-preview.22115.1 + 5.0.0-preview.22116.1 + 5.0.0-preview.22116.1 7.0.0-preview.2.22115.15 7.0.0-preview.2.22115.15 From a296feb3961e4eaf4cc9df42e4128b9263e3c51e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 17 Feb 2022 21:48:03 -0800 Subject: [PATCH 45/78] Update dependencies from https://github.com/dotnet/runtime build 20220216.9 (#1512) Microsoft.NETCore.App.Runtime.win-x64 , VS.Redist.Common.NetCore.SharedFramework.x64.7.0 From Version 7.0.0-preview.2.22115.15 -> To Version 7.0.0-preview.2.22116.9 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 38d7d80d9dc..d95b1363530 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 0733eb9a993ad0dc565a60c077afdb76b719fc92 - + https://github.com/dotnet/runtime - 32434f9007428d7d806df6afce80c36a308c2fa0 + 793185a23907b941787fa5e9dab1524d0063df1f https://github.com/dotnet/aspnetcore 4dfc0a726c4a88f183b642e47d8701fb1457b71c - + https://github.com/dotnet/runtime - 32434f9007428d7d806df6afce80c36a308c2fa0 + 793185a23907b941787fa5e9dab1524d0063df1f diff --git a/eng/Versions.props b/eng/Versions.props index 3a4e9fc7b2e..0cc09bd8036 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22116.1 5.0.0-preview.22116.1 - 7.0.0-preview.2.22115.15 - 7.0.0-preview.2.22115.15 + 7.0.0-preview.2.22116.9 + 7.0.0-preview.2.22116.9 1.0.311401 From c31e25deecfd69ab7c079a5e4f1c689ef71bd4d6 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 17 Feb 2022 21:49:56 -0800 Subject: [PATCH 46/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220216.18 (#1513) Microsoft.AspNetCore.App.Runtime.win-x64 , VS.Redist.Common.AspNetCore.SharedFramework.x64.7.0 From Version 7.0.0-preview.2.22114.6 -> To Version 7.0.0-preview.3.22116.18 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d95b1363530..5d62def0e0f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 4dfc0a726c4a88f183b642e47d8701fb1457b71c + 4888800d435b86e0d93c25724eefb33a84332537 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 793185a23907b941787fa5e9dab1524d0063df1f - + https://github.com/dotnet/aspnetcore - 4dfc0a726c4a88f183b642e47d8701fb1457b71c + 4888800d435b86e0d93c25724eefb33a84332537 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 0cc09bd8036..40d9882d605 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22114.7 - 7.0.0-preview.2.22114.6 - 7.0.0-preview.2.22114.6 + 7.0.0-preview.3.22116.18 + 7.0.0-preview.3.22116.18 5.0.0-preview.22116.1 5.0.0-preview.22116.1 From cfae7ac6c03c1ef87f5a586e7f2d98fa8b3ef93c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 20:16:01 +0000 Subject: [PATCH 47/78] Update dependencies from https://github.com/dotnet/runtime build 20220218.1 (#1521) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5d62def0e0f..a11c49230fd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 0733eb9a993ad0dc565a60c077afdb76b719fc92 - + https://github.com/dotnet/runtime - 793185a23907b941787fa5e9dab1524d0063df1f + cc649acaec3cad932f593ab71a8da85bbf7aa49f https://github.com/dotnet/aspnetcore 4888800d435b86e0d93c25724eefb33a84332537 - + https://github.com/dotnet/runtime - 793185a23907b941787fa5e9dab1524d0063df1f + cc649acaec3cad932f593ab71a8da85bbf7aa49f diff --git a/eng/Versions.props b/eng/Versions.props index 40d9882d605..500db8a8186 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22116.1 5.0.0-preview.22116.1 - 7.0.0-preview.2.22116.9 - 7.0.0-preview.2.22116.9 + 7.0.0-preview.3.22118.1 + 7.0.0-preview.3.22118.1 1.0.311401 From 1d7060534909eb6d548effa441234c3f106aacbf Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 20:18:37 +0000 Subject: [PATCH 48/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220217.1 (#1520) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a11c49230fd..0bfb4baa882 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,11 +4,11 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics 2b173d87f335cfb6f78839c6d62dd2a8c78b304e - + https://github.com/dotnet/diagnostics 2b173d87f335cfb6f78839c6d62dd2a8c78b304e diff --git a/eng/Versions.props b/eng/Versions.props index 500db8a8186..fc40b627f8c 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22116.18 7.0.0-preview.3.22116.18 - 5.0.0-preview.22116.1 - 5.0.0-preview.22116.1 + 5.0.0-preview.22117.1 + 5.0.0-preview.22117.1 7.0.0-preview.3.22118.1 7.0.0-preview.3.22118.1 From 23801b242a4102da734590fe826d548b681b8ab0 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 20:26:28 +0000 Subject: [PATCH 49/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220217.7 (#1522) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0bfb4baa882..3603a20459c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 4888800d435b86e0d93c25724eefb33a84332537 + ac27ce1905e239b504b7ffb170c2f5726c3b282f https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime cc649acaec3cad932f593ab71a8da85bbf7aa49f - + https://github.com/dotnet/aspnetcore - 4888800d435b86e0d93c25724eefb33a84332537 + ac27ce1905e239b504b7ffb170c2f5726c3b282f https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index fc40b627f8c..6c0858565cf 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22114.7 - 7.0.0-preview.3.22116.18 - 7.0.0-preview.3.22116.18 + 7.0.0-preview.3.22117.7 + 7.0.0-preview.3.22117.7 5.0.0-preview.22117.1 5.0.0-preview.22117.1 From 8a3e4188dda2de55e3b3b8ee74626e6c291e6476 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 19 Feb 2022 14:03:17 +0000 Subject: [PATCH 50/78] Update dependencies from https://github.com/dotnet/arcade build 20220217.2 (#1525) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++-- eng/Versions.props | 2 +- eng/common/retain-build.ps1 | 47 +++++++++++++++++++++ eng/common/templates/jobs/jobs.yml | 9 ---- eng/common/templates/steps/retain-build.yml | 28 ++++++++++++ global.json | 2 +- 6 files changed, 81 insertions(+), 15 deletions(-) create mode 100644 eng/common/retain-build.ps1 create mode 100644 eng/common/templates/steps/retain-build.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 3603a20459c..866d69ee4fd 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore ac27ce1905e239b504b7ffb170c2f5726c3b282f - + https://github.com/dotnet/arcade - 6d977266bcc193caedb60a27ae44d14d9a11a040 + 49750c02e63d0ad3a77d035bba7498a0b1acd218 - + https://github.com/dotnet/arcade - 6d977266bcc193caedb60a27ae44d14d9a11a040 + 49750c02e63d0ad3a77d035bba7498a0b1acd218 https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index 6c0858565cf..280ae48ceb9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22114.7 + 7.0.0-beta.22117.2 7.0.0-preview.3.22117.7 7.0.0-preview.3.22117.7 diff --git a/eng/common/retain-build.ps1 b/eng/common/retain-build.ps1 new file mode 100644 index 00000000000..e08fc227b21 --- /dev/null +++ b/eng/common/retain-build.ps1 @@ -0,0 +1,47 @@ + +Param( +[Parameter(Mandatory=$true)][int] $buildId, +[Parameter(Mandatory=$true)][string] $azdoOrgUri, +[Parameter(Mandatory=$true)][string] $azdoProject, +[Parameter(Mandatory=$true)][string] $token +) + +$ErrorActionPreference = 'Stop' +Set-StrictMode -Version 2.0 +. $PSScriptRoot\tools.ps1 + + +function Get-AzDOHeaders( + [string] $token) +{ + $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":${token}")) + $headers = @{"Authorization"="Basic $base64AuthInfo"} + return $headers +} + +function Update-BuildRetention( + [string] $azdoOrgUri, + [string] $azdoProject, + [int] $buildId, + [string] $token) +{ + $headers = Get-AzDOHeaders -token $token + $requestBody = "{ + `"keepForever`": `"true`" + }" + + $requestUri = "${azdoOrgUri}/${azdoProject}/_apis/build/builds/${buildId}?api-version=6.0" + write-Host "Attempting to retain build using the following URI: ${requestUri} ..." + + try { + Invoke-RestMethod -Uri $requestUri -Method Patch -Body $requestBody -Header $headers -contentType "application/json" + Write-Host "Updated retention settings for build ${buildId}." + } + catch { + Write-PipelineTelemetryError -Category "Build" -Message "Failed to update retention settings for build: $_.Exception.Response.StatusDescription" + ExitWithExitCode 1 + } +} + +Update-BuildRetention -azdoOrgUri $azdoOrgUri -azdoProject $azdoProject -buildId $buildId -token $token +ExitWithExitCode 0 diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml index 6976330862c..554e71cfc43 100644 --- a/eng/common/templates/jobs/jobs.yml +++ b/eng/common/templates/jobs/jobs.yml @@ -8,10 +8,6 @@ parameters: # Optional: Enable publishing using release pipelines enablePublishUsingPipelines: false - # Optional: Disable component governance detection. In general, component governance - # should be on for all jobs. Use only in the event of issues. - disableComponentGovernance: false - # Optional: Enable running the source-build jobs to build repo from source enableSourceBuild: false @@ -41,11 +37,6 @@ parameters: # Internal resources (telemetry, microbuild) can only be accessed from non-public projects, # and some (Microbuild) should only be applied to non-PR cases for internal builds. -# Sbom related params - enableSbom: true - PackageVersion: 7.0.0 - BuildDropPath: '$(Build.SourcesDirectory)/artifacts' - jobs: - ${{ each job in parameters.jobs }}: - template: ../job/job.yml diff --git a/eng/common/templates/steps/retain-build.yml b/eng/common/templates/steps/retain-build.yml new file mode 100644 index 00000000000..83d97a26a01 --- /dev/null +++ b/eng/common/templates/steps/retain-build.yml @@ -0,0 +1,28 @@ +parameters: + # Optional azure devops PAT with build execute permissions for the build's organization, + # only needed if the build that should be retained ran on a different organization than + # the pipeline where this template is executing from + Token: '' + # Optional BuildId to retain, defaults to the current running build + BuildId: '' + # Azure devops Organization URI for the build in the https://dev.azure.com/ format. + # Defaults to the organization the current pipeline is running on + AzdoOrgUri: '$(System.CollectionUri)' + # Azure devops project for the build. Defaults to the project the current pipeline is running on + AzdoProject: '$(System.TeamProject)' + +steps: + - task: powershell@2 + inputs: + targetType: 'filePath' + filePath: eng/common/retain-build.ps1 + pwsh: true + arguments: > + -AzdoOrgUri: ${{parameters.AzdoOrgUri}} + -AzdoProject ${{parameters.AzdoProject}} + -Token ${{coalesce(parameters.Token, '$env:SYSTEM_ACCESSTOKEN') }} + -BuildId ${{coalesce(parameters.BuildId, '$env:BUILD_ID')}} + displayName: Enable permanent build retention + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + BUILD_ID: $(Build.BuildId) \ No newline at end of file diff --git a/global.json b/global.json index 514a5587a21..874c2a4fb1f 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22114.7" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22117.2" } } From 0679909bb46434bb03351383863af139dacb422f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 20 Feb 2022 14:48:37 +0000 Subject: [PATCH 51/78] [main] Update dependencies from dotnet/runtime (#1526) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 866d69ee4fd..c44f256c88b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 0733eb9a993ad0dc565a60c077afdb76b719fc92 - + https://github.com/dotnet/runtime - cc649acaec3cad932f593ab71a8da85bbf7aa49f + ddb22ef2ac96ed31cfd85782d1c38b1523642aaa https://github.com/dotnet/aspnetcore ac27ce1905e239b504b7ffb170c2f5726c3b282f - + https://github.com/dotnet/runtime - cc649acaec3cad932f593ab71a8da85bbf7aa49f + ddb22ef2ac96ed31cfd85782d1c38b1523642aaa diff --git a/eng/Versions.props b/eng/Versions.props index 280ae48ceb9..2b6f22eaa35 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22117.1 5.0.0-preview.22117.1 - 7.0.0-preview.3.22118.1 - 7.0.0-preview.3.22118.1 + 7.0.0-preview.3.22119.4 + 7.0.0-preview.3.22119.4 1.0.311401 From 863fe31e30bd69b18abcaf223773e5405e7b52b4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 21 Feb 2022 14:26:27 +0000 Subject: [PATCH 52/78] [main] Update dependencies from dotnet/aspnetcore (#1527) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c44f256c88b..560b74bd5f4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - ac27ce1905e239b504b7ffb170c2f5726c3b282f + f94c0aa7460f7ec63777b2e69d5464634673c6dc https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime ddb22ef2ac96ed31cfd85782d1c38b1523642aaa - + https://github.com/dotnet/aspnetcore - ac27ce1905e239b504b7ffb170c2f5726c3b282f + f94c0aa7460f7ec63777b2e69d5464634673c6dc https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 2b6f22eaa35..5dc8b2f213b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22117.2 - 7.0.0-preview.3.22117.7 - 7.0.0-preview.3.22117.7 + 7.0.0-preview.3.22120.1 + 7.0.0-preview.3.22120.1 5.0.0-preview.22117.1 5.0.0-preview.22117.1 From 8e01e5c54ba978fa109748259e5fdf5e0290f6c2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 14:24:22 +0000 Subject: [PATCH 53/78] Update dependencies from https://github.com/dotnet/symstore build 20220221.1 (#1530) [main] Update dependencies from dotnet/symstore --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 560b74bd5f4..1b7a3f0dfcf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -26,9 +26,9 @@ https://github.com/dotnet/arcade 49750c02e63d0ad3a77d035bba7498a0b1acd218 - + https://github.com/dotnet/symstore - 0733eb9a993ad0dc565a60c077afdb76b719fc92 + 66022c1c9778e69dcff6ab07f41d37eb64ebd386 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 5dc8b2f213b..adf623be969 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -53,7 +53,7 @@ 7.0.0-preview.3.22119.4 7.0.0-preview.3.22119.4 - 1.0.311401 + 1.0.312101 3.1.22 From f4320a8d0bf7ffaf361d6251c1d3e36cea0b664b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 22:33:44 +0000 Subject: [PATCH 54/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220221.3 (#1531) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1b7a3f0dfcf..9d04488678d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - f94c0aa7460f7ec63777b2e69d5464634673c6dc + 5760f2864016081a142642b417db17e5340a1d67 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime ddb22ef2ac96ed31cfd85782d1c38b1523642aaa - + https://github.com/dotnet/aspnetcore - f94c0aa7460f7ec63777b2e69d5464634673c6dc + 5760f2864016081a142642b417db17e5340a1d67 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index adf623be969..c2cd65e3f9f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22117.2 - 7.0.0-preview.3.22120.1 - 7.0.0-preview.3.22120.1 + 7.0.0-preview.3.22121.3 + 7.0.0-preview.3.22121.3 5.0.0-preview.22117.1 5.0.0-preview.22117.1 From fdf9df68636d3e12951ca86763e420d59fefe3ac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 22:34:39 +0000 Subject: [PATCH 55/78] [main] Update dependencies from dotnet/diagnostics (#1528) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9d04488678d..434840dbef0 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 2b173d87f335cfb6f78839c6d62dd2a8c78b304e + 5e079cb7f82a4054d7c1dc6100d70014040454d2 - + https://github.com/dotnet/diagnostics - 2b173d87f335cfb6f78839c6d62dd2a8c78b304e + 5e079cb7f82a4054d7c1dc6100d70014040454d2 diff --git a/eng/Versions.props b/eng/Versions.props index c2cd65e3f9f..da7b135adef 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22121.3 7.0.0-preview.3.22121.3 - 5.0.0-preview.22117.1 - 5.0.0-preview.22117.1 + 5.0.0-preview.22121.1 + 5.0.0-preview.22121.1 7.0.0-preview.3.22119.4 7.0.0-preview.3.22119.4 From 0d55b2e621f95ea3e55e8d0f00d4a4372a4234ac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 00:05:13 +0000 Subject: [PATCH 56/78] [main] Update dependencies from dotnet/runtime (#1529) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 434840dbef0..043eee256fa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - ddb22ef2ac96ed31cfd85782d1c38b1523642aaa + eeff29824557cbc3873c2d331d042a889310bac0 https://github.com/dotnet/aspnetcore 5760f2864016081a142642b417db17e5340a1d67 - + https://github.com/dotnet/runtime - ddb22ef2ac96ed31cfd85782d1c38b1523642aaa + eeff29824557cbc3873c2d331d042a889310bac0 diff --git a/eng/Versions.props b/eng/Versions.props index da7b135adef..02f5012536e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22121.1 5.0.0-preview.22121.1 - 7.0.0-preview.3.22119.4 - 7.0.0-preview.3.22119.4 + 7.0.0-preview.3.22121.13 + 7.0.0-preview.3.22121.13 1.0.312101 From 356990dcc023a1dc25c37b7f49e1f020581eac67 Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Tue, 22 Feb 2022 18:42:26 -0800 Subject: [PATCH 57/78] Update SDK to 7.0.0 Preview 1 (#1532) --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 874c2a4fb1f..06cdec1bbdb 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "7.0.100-alpha.1.22068.3", + "dotnet": "7.0.100-preview.1.22110.4", "runtimes": { "aspnetcore": [ "$(MicrosoftAspNetCoreApp31Version)", From a87ec68109fa47b181c0a3610499a18376073cb3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 24 Feb 2022 14:08:14 +0000 Subject: [PATCH 58/78] [main] Update dependencies from dotnet/diagnostics (#1533) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 043eee256fa..382883f7fb1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 5e079cb7f82a4054d7c1dc6100d70014040454d2 + 222e1ab32b8b0b68c86c205bc6e0b483e119f390 - + https://github.com/dotnet/diagnostics - 5e079cb7f82a4054d7c1dc6100d70014040454d2 + 222e1ab32b8b0b68c86c205bc6e0b483e119f390 diff --git a/eng/Versions.props b/eng/Versions.props index 02f5012536e..c53d3b646dd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22121.3 7.0.0-preview.3.22121.3 - 5.0.0-preview.22121.1 - 5.0.0-preview.22121.1 + 5.0.0-preview.22123.1 + 5.0.0-preview.22123.1 7.0.0-preview.3.22121.13 7.0.0-preview.3.22121.13 From 4ab5c59a6701fbabf317d34bdf87fcc94c2dc90f Mon Sep 17 00:00:00 2001 From: Justin Anderson Date: Thu, 24 Feb 2022 10:42:32 -0800 Subject: [PATCH 59/78] Refactor test result upload into loop (#1519) Add test result upload for net7.0 --- eng/build.yml | 65 +++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 41 deletions(-) diff --git a/eng/build.yml b/eng/build.yml index 52ac5dde942..0383a566b8c 100644 --- a/eng/build.yml +++ b/eng/build.yml @@ -12,6 +12,16 @@ parameters: dependsOn: '' # Flag to determine if files should be signed and published signAndPublishArtifacts: false + # TFMs for which test results are uploaded + testResultTfms: + - key: netcoreapp3.1 + value: Core 3.1 + - key: net5.0 + value: .NET 5 + - key: net6.0 + value: .NET 6 + - key: net7.0 + value: .NET 7 jobs: - template: /eng/common/templates/job/job.yml @@ -146,47 +156,20 @@ jobs: condition: succeeded() # # Publish test results to Azure Pipelines - - task: PublishTestResults@2 - displayName: Publish Test Results (Core 3.1) - inputs: - testResultsFormat: VSTest - testResultsFiles: '**/*Tests*netcoreapp3.1*.trx' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' - failTaskOnFailedTests: true - testRunTitle: '${{ coalesce(parameters.displayName, parameters.name) }} Core 3.1' - publishRunAttachments: true - mergeTestResults: true - buildConfiguration: ${{ parameters.name }} - continueOnError: true - condition: succeededOrFailed() - - - task: PublishTestResults@2 - displayName: Publish Test Results (NET 5.0) - inputs: - testResultsFormat: VSTest - testResultsFiles: '**/*Tests*net5.0*.trx' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' - failTaskOnFailedTests: true - testRunTitle: '${{ coalesce(parameters.displayName, parameters.name) }} NET 5.0' - publishRunAttachments: true - mergeTestResults: true - buildConfiguration: ${{ parameters.name }} - continueOnError: true - condition: succeededOrFailed() - - - task: PublishTestResults@2 - displayName: Publish Test Results (NET 6.0) - inputs: - testResultsFormat: VSTest - testResultsFiles: '**/*Tests*net6.0*.trx' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' - failTaskOnFailedTests: true - testRunTitle: '${{ coalesce(parameters.displayName, parameters.name) }} NET 6.0' - publishRunAttachments: true - mergeTestResults: true - buildConfiguration: ${{ parameters.name }} - continueOnError: true - condition: succeededOrFailed() + - ${{ each testResultTfm in parameters.testResultTfms }}: + - task: PublishTestResults@2 + displayName: Publish Test Results (${{ testResultTfm.value }}) + inputs: + testResultsFormat: VSTest + testResultsFiles: '**/*Tests*${{ testResultTfm.key }}*.trx' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' + failTaskOnFailedTests: true + testRunTitle: '${{ coalesce(parameters.displayName, parameters.name) }} ${{ testResultTfm.value }}' + publishRunAttachments: true + mergeTestResults: true + buildConfiguration: ${{ parameters.name }} + continueOnError: true + condition: succeededOrFailed() - ${{ if ne(variables['System.TeamProject'], 'public') }}: - task: PublishBuildArtifacts@1 From a3dfe526f9f15bfd16a8f18dc738e4cbf3d2cd03 Mon Sep 17 00:00:00 2001 From: Patrick Fenelon Date: Thu, 24 Feb 2022 19:34:02 -0800 Subject: [PATCH 60/78] Break out a setup guide for API Key auth (#1524) * Break out a setup guide for API Key auth * Change TOC to make a little more sense * Add Note for Auth header, fix spaces, punct. * pr feedback --- documentation/README.md | 1 + documentation/api-key-format.md | 4 +- documentation/api-key-setup.md | 146 ++++++++++++++++++++++++++++++++ documentation/authentication.md | 101 ++-------------------- 4 files changed, 155 insertions(+), 97 deletions(-) create mode 100644 documentation/api-key-setup.md diff --git a/documentation/README.md b/documentation/README.md index 087b0fc7cbd..42be4afd948 100644 --- a/documentation/README.md +++ b/documentation/README.md @@ -28,6 +28,7 @@ When running a dotnet application, differences in diverse local and production e - [JSON Schema](./schema.json) - [Authentication](./authentication.md) - [API Key (Recommended)](./authentication.md#api-key-authentication) + - [API Key Setup Guide](./api-key-setup.md) - [Windows](./authentication.md#windows-authentication) - [Collection Rules](./collectionrules.md) - [Egress Providers](./egress.md) diff --git a/documentation/api-key-format.md b/documentation/api-key-format.md index 0dc2db138f8..11979c16253 100644 --- a/documentation/api-key-format.md +++ b/documentation/api-key-format.md @@ -37,14 +37,14 @@ When using the `generatekey` command, the `sub` field will be a randomly-generat ``` ### Signature -JSON web tokens may be cryptographically signed; `dotnet monitor` requires all tokens to be signed and supports `RSA PKCS1` and `ECDSA` signed tokens, these are tokens with `RS*` and `ES*` as `alg` values. `dotnet monitor` needs the public key portion of this cryptographic material in order to validate the token. See the [Providing a Public Key](#providing-a-public-key) section for information on how to encode a key. +JSON web tokens may be cryptographically signed; `dotnet monitor` **requires all** tokens to be signed and supports `RSA PKCS1 v1.5` and `ECDSA` signed tokens, these are tokens with `RS*` and `ES*` as `alg` values. `dotnet monitor` needs the public key portion of this cryptographic material in order to validate the token. See the [Providing a Public Key](#providing-a-public-key) section for information on how to encode a key. ## Providing a Public Key The public key is provided to `dotnet monitor` as a JSON Web Key or JWK, as defined by [RFC 7517: JSON Web Key (JWK)](https://www.rfc-editor.org/rfc/rfc7517.html). This key must be serialized as JSON and then Base64 URL encoded into a single string. `dotnet monitor` imposes the following constraints on JWKs: -- The key should **not** have private key data. The key is only used for signature verification, and thus private key parameters are not needed. A warning message will be shown if the private key data is included. +- The key **should not** have private key data. The key is only used for signature verification, and thus private key parameters are not needed. A warning message will be shown if the private key data is included. - The `kty` (or [Key Type](https://www.rfc-editor.org/rfc/rfc7517.html#section-4.1)) must be `RSA` for a RSA public key or `EC` for an elliptic-curve public key. The key used for the token in this example is: diff --git a/documentation/api-key-setup.md b/documentation/api-key-setup.md new file mode 100644 index 00000000000..234a388bf7c --- /dev/null +++ b/documentation/api-key-setup.md @@ -0,0 +1,146 @@ +# Configuring API Key Authentication + +The API Key you use to secure `dotnet monitor` is a secret Json Web Token (JWT), cryptographically signed by a public/private key algorithm. You can **[Recommended]** use the integrated command to generate a key or you can generate the key yourself following the [format, documented here](./api-key-format.md). This guide will use the integrated command. + +## 1. Using the integrated `generatekey` command + +Run the command: + +```bash +> dotnet monitor generatekey +``` + +The output from this command will display the API key (a bearer JWT token) formatted as an `Authorization` header along with its corresponding configuration for `dotnet monitor`. You will need to store the `Subject` and `PublicKey` in the configuration for `dotnet monitor` and use the `Authorization` header value when making requests to the `dotnet monitor` HTTPS endpoint. + +>**Note:** The `Authorization` header value is the string `Bearer` (representing the type) + the JWT, separated by a space. In some applications (like Postman) have you fill in the `Authorization` header type in a separate field from the JWT. + +```yaml +Generated ApiKey for dotnet-monitor; use the following header for authorization: + +Authorization: Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU + +Settings in Json format: +{ + "Authentication": { + "MonitorApiKey": { + "Subject": "ae5473b6-8dad-498d-b915-ffffffffffff", + "PublicKey": "eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19" + } + } +} +``` + +>**Note:** The actual values provided in this document will never work as valid configuration. All values provided in this document are the correct length and format, but the raw values have been edited to prevent this public example being used to configure authentication for a dotnet-monitor installation. + +The `generatekey` command supports 1 parameter `--output`/`-o` to specify the configuration format. By default, `dotnet monitor generatekey` will use the `--output json` format. Currently, the values in the list below are supported values for `--output`. + +- `Json` output format will provide a json blob in the correct format to merge with a `settings.json` file that configures `dotnet-monitor`. See [Configuration Sources](./configuration.md#configuration-sources) for where to find or create a `settings.json` file. +- `Text` output format write the individual parameters in an easily human-readable format. +- `Cmd` output format in environment variables for a `cmd.exe` prompt. +- `PowerShell` output format in environment variables for a `powershell` or `pwsh` prompt. +- `Shell` output format in environment variables for a `bash` shell or another linux shell prompt. +- `MachineJson` output a single json blob designed to be easy to parse by other tools. The entire STDOUT from `dotnet-monitor` will be a parsable json object. + +## 2. Configure `dotnet-monitor` + +Once you have the key material from [step 1](#1-using-the-integrated-generatekey-command), you then must provide that configuration `dotnet-monitor`. There are several ways to [configure dotnet-monitor](./configuration.md) and the easiest method usually depends on your platform. + +### A local dev box (Windows, OSX or Linux) + +The easiest way to configure `dotnet-monitor` on a local dev box is by using the `settings.json` file loaded from the following directory (depending on platform): + +- Windows: `%USERPROFILE%\.dotnet-monitor\settings.json` +- Linux (and \*nix like): + - If `XDG_CONFIG_HOME` is defined: `$XDG_CONFIG_HOME/dotnet-monitor/settings.json` + - Otherwise: `$HOME/.config/dotnet-monitor/settings.json` + +> **Note:** You probably need to create the directory and `settings.json` file within. + +Run the command `dotnet monitor generatekey --output json` and copy the json blob into `settings.json`. A typical settings file might look like this: + +```json +{ + "$schema": "https://aka.ms/dotnet-monitor-schema", + "Authentication": { + "MonitorApiKey": { + "Subject": "ae5473b6-8dad-498d-b915-ffffffffffff", + "PublicKey": "eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19" + } + } +} +``` + +>**Note:** The example above is not valid configuration, use the provided command to get a unique authentication key. + +### Docker + +The easiest way to configure `docker` is to pass environment variables for the required configuration. First start by running `dotnet monitor generatekey --output Shell`. + +```bash +> docker run --rm --entrypoint dotnet-monitor mcr.microsoft.com/dotnet/monitor generatekey --output Text +``` + +>**Note:** You'll need 3 parameters from the above execution. Grab the value in `Subject` and `PublicKey` and fill in `` and `` in the command below; save the value in `Authorization` for [step 3](#3-using-an-api-key-to-access-the-http-api). + +```bash +> docker run --rm -p 127.0.0.1:52323:52323/tcp --entrypoint dotnet-monitor --env DOTNETMONITOR_Authentication__MonitorApiKey__Subject= --env DOTNETMONITOR_Authentication__MonitorApiKey__PublicKey= mcr.microsoft.com/dotnet/monitor collect --urls http://+:52323 --metricUrls http://+:52325 +``` + +>**Note:** This command disables TLS, and should only be used for testing. + +### Configuring an API Key in a Kubernetes Cluster + +If you're running in Kubernetes, we recommend creating secrets and mounting them into the `dotnet monitor` sidecar container via a deployment manifest. You can use this `kubectl` command to either create or rotate the API Key. + +```sh +kubectl create secret generic apikey \ + --from-literal=Authentication__MonitorApiKey__Subject='ae5473b6-8dad-498d-b915-ffffffffffff' \ + --from-literal=Authentication__MonitorApiKey__PublicKey='eyffffffffffff...19' \ + --dry-run=client -o yaml \ + | kubectl apply -f - +``` + +Mount the secret as a file into `/etc/dotnet-monitor` in the deployment manifest for your application (abbreviated for clarity). `dotnet monitor` only supports automatic key rotations for secrets mounted as volumes. For other kinds of secrets, the `dotnet monitor` process must be restarted for the new key to take effect. + +```yaml +spec: + volumes: + - name: apikey + secret: + secretName: apikey + containers: + - name: dotnetmonitoragent + image: mcr.microsoft.com/dotnet/monitor:6 + volumeMounts: + - name: apikey + mountPath: /etc/dotnet-monitor + +``` + +> **NOTE:** For a complete example of running dotnet-monitor in Kubernetes, see [Running in a Kubernetes Cluster](getting-started.md#running-in-a-kubernetes-cluster) in the Getting Started guide. + +## 3. Using an API Key to access the HTTP API + +When using API Key authentication, you must fill in the `Authorization` header in `Bearer` mode with the parameter given in `Authorization` from running the `generatekey` command. + +A valid authorization header value will look like this: + +```text +Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU +``` + +## From CURL + +If using Curl, you can use the `-H` parameter to specify the authorization header. The expected format for `-H` is `
:
`. Here is an example `curl` command: + +```sh +curl -H "Authorization: Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU" https://localhost:52323/processes +``` + +## From PowerShell + +If using PowerShell, you can use `Invoke-WebRequest` but it does not accept the same parameters. Specify the Authorization header in a Dictionary provided to the `-Headers` parameter like this: + +```powershell + (Invoke-WebRequest -Uri https://localhost:52323/processes -Headers @{ 'Authorization' = 'Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU' }).Content | ConvertFrom-Json +``` diff --git a/documentation/authentication.md b/documentation/authentication.md index 7c2c19991e1..e9f119e88f4 100644 --- a/documentation/authentication.md +++ b/documentation/authentication.md @@ -7,6 +7,7 @@ Authenticated requests to `dotnet monitor` help protect sensitive diagnostic art The recommended configuration for `dotnet monitor` is to use [API Key Authentication](#api-key-authentication) over a channel [secured with TLS](./enabling-ssl.md). ## Windows Authentication + We only recommend using Windows Authentication if you're running `dotnet monitor` as a local development tool on Windows; for all other environments using an [API Key](#api-key-authentication) is recommended. Windows authentication doesn't require explicit configuration and is enabled automatically when running `dotnet monitor` on Windows. When available, `dotnet monitor` will authorize any user authenticated as the same user that started the `dotnet monitor` process. It is not possible to disable Windows authentication. @@ -14,113 +15,23 @@ Windows authentication doesn't require explicit configuration and is enabled aut > **NOTE:** Windows authentication will not be attempted if you are running `dotnet monitor` as an Administrator ## API Key Authentication -An API Key is the recommended authentication mechanism for `dotnet monitor`. API Keys are referred to as `MonitorApiKey` in configuration and source code but we will shorten the term to "API key" in this document. To enable it, you will need to generate a secret token, update the configuration of `dotnet monitor`, and then specify the secret token in the `Authorization` header on all requests to `dotnet monitor`. - -> **NOTE:** API Key Authentication should only be used when [TLS is enabled](#) to protect the key while in transit. `dotnet monitor` will emit a warning if authentication is enabled over an insecure transport medium. - -### Generating an API Key - -The API Key you use to secure `dotnet monitor` is a secret JWT token, cryptographically signed by a public/private key algorithm. You can generate a key either using `dotnet monitor` or via your shell. To generate an API Key with `dotnet monitor`, simply invoke the `generatekey` command: - -```powershell -dotnet monitor generatekey -``` - -The output from this command will display the API key (a bearer JWT token) formatted as an `Authorization` header along with its corresponding configuration for `dotnet monitor`. You will need to store the `Subject` and `PublicKey` in the configuration for `dotnet monitor` and use the `Authorization` header value when making requests to the `dotnet monitor` HTTPS endpoint. - -```yaml -Generated ApiKey for dotnet-monitor; use the following header for authorization: - -Authorization: Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU - -Settings in Text format: -Subject: ae5473b6-8dad-498d-b915-ffffffffffff -Public Key: eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19 -``` ->**Note:** The actual values provided in this document will never work as valid configuration. All values provided in this document are the correct length and format, but the raw values have been edited to prevent this public example being used to configure authentication for a dotnet-monitor installation. - -The `generatekey` command supports 1 parameter `--output`/`-o` to specify the configuration format. By default, `dotnet monitor generatekey` will use the `--output json` format. Currently, the values in the list below are supported values for `--output`. - -- `Json` output format will provide a json blob in the correct format to merge with a `settings.json` file that configures `dotnet-monitor`. See [Configuration Sources](./configuration.md#configuration-sources) for where to find or create a `settings.json` file. -- `Text` output format write the individual parameters in an easily human-readable format. -- `Cmd` output format in environment variables for a `cmd.exe` prompt. -- `PowerShell` output format in environment variables for a `powershell` or `pwsh` prompt. -- `Shell` output format in environment variables for a `bash` shell or another linux shell prompt. -- `MachineJson` output a single json blob designed to be easy to parse by other tools. The entire STDOUT from `dotnet-monitor` will be a parsable json object. - -### Configuring dotnet-monitor to use an API Key - -Using the `generatekey` command does not automatically update the configuration of `dotnet monitor` to use the new key. You can update the configuration of `dotnet monitor` via settings file, environment variable or Kubernetes secrets. - -If you're running on Windows, you can save these settings to `%USERPROFILE%\.dotnet-monitor\settings.json`. If you're on other operating systems, you can save this file to `$XDG_CONFIG_HOME/dotnet-monitor/settings.json`. -> **NOTE:** If `$XDG_CONFIG_HOME` isn't defined, `dotnet monitor` will fall back to looking at `$HOME/.config/dotnet-monitor/settings.json` +An API Key is the recommended authentication mechanism for `dotnet monitor`. API Keys are referred to as `MonitorApiKey` in configuration and source code but we will shorten the term to "API key" in this document. To enable it, you will need to generate a secret token, update the configuration of `dotnet monitor`, and then specify the secret token in the `Authorization` header on all requests to `dotnet monitor`. To configure API Key authentication using the integrated `generatekey` command see: [API Key Setup](./api-key-setup.md). -```json -{ - "Authentication": { - "MonitorApiKey": { - "Subject": "ae5473b6-8dad-498d-b915-ffffffffffff", - "PublicKey": "eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19" - } - } -} -``` - -Alternatively, you can use environment variables to specify the configuration. Use `dotnet monitor generatekey --output shell` to get the format below. - -```sh -export Authentication__MonitorApiKey__Subject="ae5473b6-8dad-498d-b915-ffffffffffff" -export Authentication__MonitorApiKey__PublicKey="eyffffffffffffFsRGF0YSI6e30sIkNydiI6IlAtMzg0IiwiS2V5T3BzIjpbXSwiS3R5IjoiRUMiLCJYIjoiTnhIRnhVZ19QM1dhVUZWVzk0U3dUY3FzVk5zNlFLYjZxc3AzNzVTRmJfQ3QyZHdpN0RWRl8tUTVheERtYlJuWSIsIlg1YyI6W10sIlkiOiJmMXBDdmNoUkVpTWEtc1h6SlZQaS02YmViMHdrZmxfdUZBN0Vka2dwcjF5N251Wmk2cy1NcHl5RzhKdVFSNWZOIiwiS2V5U2l6ZSI6Mzg0LCJIYXNQcml2YXRlS2V5IjpmYWxzZSwiQ3J5cHRvUHJvdmlkZXJGYWN0b3J5Ijp7IkNyeXB0b1Byb3ZpZGVyQ2FjaGUiOnt9LCJDYWNoZVNpZ25hdHVyZVByb3ZpZGVycyI6dHJ1ZSwiU2lnbmF0dXJlUHJvdmlkZXJPYmplY3RQb29sQ2FjaGffffffffffff19" -``` - -> **NOTE:** When you use environment variables to configure the API Key, you must restart `dotnet monitor` for the changes to take effect. - -### Configuring an API Key in a Kubernetes Cluster -If you're running in Kubernetes, we recommend creating secrets and mounting them into the `dotnet monitor` sidecar container via a deployment manifest. You can use this `kubectl` command to either create or rotate the API Key. - -```sh -kubectl create secret generic apikey \ - --from-literal=Authentication__MonitorApiKey__Subject='ae5473b6-8dad-498d-b915-ffffffffffff' \ - --from-literal=Authentication__MonitorApiKey__PublicKey='eyffffffffffff...19' \ - --dry-run=client -o yaml \ - | kubectl apply -f - -``` - -Mount the secret as a file into `/etc/dotnet-monitor` in the deployment manifest for your application (abbreviated for clarity). `dotnet monitor` only supports automatic key rotations for secrets mounted as volumes. For other kinds of secrets, the `dotnet monitor` process must be restarted for the new key to take effect. - -```yaml -spec: - volumes: - - name: apikey - secret: - secretName: apikey - containers: - - name: dotnetmonitoragent - image: mcr.microsoft.com/dotnet/monitor:6 - volumeMounts: - - name: apikey - mountPath: /etc/dotnet-monitor - -``` - -> **NOTE:** For a complete example of running dotnet-monitor in Kubernetes, see [Running in a Kubernetes Cluster](getting-started.md#running-in-a-kubernetes-cluster) in the Getting Started guide. - -### Generate API Keys manually - -API keys for `dotnet monitor` are standard JSON Web Tokens or JWTs and can be generated without the `generatekey` command on `dotnet monitor`. For more details see [Api Key Format](api-key-format.md). +> **NOTE:** API Key Authentication should only be used when [TLS is enabled](#) to protect the key while in transit. `dotnet monitor` will emit a warning if authentication is enabled over an insecure transport medium. ## Authenticating requests + When using Windows Authentication, your browser will automatically handle the Windows authentication challenge. If you are using an API Key, you must specify it via the `Authorization` header. ```sh -curl -H "Authorization: Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU" https://localhost:52323/processes +curl -H "Authorization: Bearer " https://localhost:52323/processes ``` If using PowerShell, you can use `Invoke-WebRequest` but it does not accept the same parameters. ```powershell - (Invoke-WebRequest -Uri https://localhost:52323/processes -Headers @{ 'Authorization' = 'Bearer eyJhbGciOiJFUffffffffffffCI6IkpXVCJ9.eyJhdWQiOiJodffffffffffffGh1Yi5jb20vZG90bmV0L2RvdG5ldC1tb25pdG9yIiwiaXNzIjoiaHR0cHM6Ly9naXRodWIuY29tL2RvdG5ldC9kb3RuZXQtbW9uaXRvci9nZW5lcmF0ZWtleStNb25pdG9yQXBpS2V5Iiwic3ViIjoiYWU1NDczYjYtOGRhZC00OThkLWI5MTUtNTNiOWM2ODQwMDBlIn0.RZffffffffffff_yIyApvFKcxFpDJ65HJZek1_dt7jCTCMEEEffffffffffffR08OyhZZHs46PopwAsf_6fdTLKB1UGvLr95volwEwIFnHjdvMfTJ9ffffffffffffAU' }).Content | ConvertFrom-Json + (Invoke-WebRequest -Uri https://localhost:52323/processes -Headers @{ 'Authorization' = 'Bearer ' }).Content | ConvertFrom-Json ``` To use Windows authentication with PowerShell, you can specify the `-UseDefaultCredentials` flag for `Invoke-WebRequest` or `--negotiate` for `curl.exe` From 163c50ed7d08891c1c0f663f87355fbadb668604 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 25 Feb 2022 14:06:21 +0000 Subject: [PATCH 61/78] [main] Update dependencies from dotnet/arcade (#1534) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 382883f7fb1..fe2c9c7292d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore 5760f2864016081a142642b417db17e5340a1d67 - + https://github.com/dotnet/arcade - 49750c02e63d0ad3a77d035bba7498a0b1acd218 + eac1a3f1eb7404c0438664381b58d7238600aafc - + https://github.com/dotnet/arcade - 49750c02e63d0ad3a77d035bba7498a0b1acd218 + eac1a3f1eb7404c0438664381b58d7238600aafc https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index c53d3b646dd..914035d04f8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22117.2 + 7.0.0-beta.22124.1 7.0.0-preview.3.22121.3 7.0.0-preview.3.22121.3 diff --git a/global.json b/global.json index 06cdec1bbdb..a9e0d5e7680 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22117.2" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22124.1" } } From 671c30df68c94d960f5b10234a775afb84102643 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 25 Feb 2022 17:42:11 +0000 Subject: [PATCH 62/78] [main] Update dependencies from dotnet/runtime (#1536) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fe2c9c7292d..a855917e4c4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - eeff29824557cbc3873c2d331d042a889310bac0 + 05920e13af192144c3e9670f4616055f04e5f19a https://github.com/dotnet/aspnetcore 5760f2864016081a142642b417db17e5340a1d67 - + https://github.com/dotnet/runtime - eeff29824557cbc3873c2d331d042a889310bac0 + 05920e13af192144c3e9670f4616055f04e5f19a diff --git a/eng/Versions.props b/eng/Versions.props index 914035d04f8..20bd9eef0df 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22123.1 5.0.0-preview.22123.1 - 7.0.0-preview.3.22121.13 - 7.0.0-preview.3.22121.13 + 7.0.0-preview.3.22123.2 + 7.0.0-preview.3.22123.2 1.0.312101 From 2f41c983e9ea3b717412ca4e986ec01566fc6fc6 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Fri, 25 Feb 2022 16:17:03 -0500 Subject: [PATCH 63/78] Simplified Process Filter Schema (#1540) --- documentation/configuration.md | 37 +++++++++++++++-- documentation/schema.json | 33 +++++++++++---- .../OptionsDisplayStrings.Designer.cs | 36 +++++++++++++++++ .../OptionsDisplayStrings.resx | 16 ++++++++ .../ProcessFilterOptions.cs | 40 +++++++++++++++++-- .../DiagProcessFilter.cs | 23 +++++++++++ 6 files changed, 171 insertions(+), 14 deletions(-) diff --git a/documentation/configuration.md b/documentation/configuration.md index f38d49d5a2d..e9ff3769ad1 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -249,7 +249,7 @@ Unlike the other diagnostic artifacts (for example, traces), memory dumps aren't ## Default Process Configuration -Default process configuration is used to determine which process is used for metrics and in situations where the process is not specified in the query to retrieve an artifact. A process must match all the specified filters. +Default process configuration is used to determine which process is used for metrics and in situations where the process is not specified in the query to retrieve an artifact. A process must match all the specified filters. If a `Key` is not specified, the default is `ProcessId`. | Name | Type | Description | |---|---|---| @@ -257,6 +257,15 @@ Default process configuration is used to determine which process is used for met | Value | string | The value to match against the process. | | MatchType | string | The type of match to perform. Can be `Exact` or `Contains` for sub-string matching. Both are case-insensitive.| + +Optionally, a shorthand format allows you to omit the `Key` and `Value` terms and specify your Key/Value pair as a single line. + +| Name | Type | Description | +|---|---|---| +| ProcessId | string | Specifies that the corresponding value is the expected `ProcessId`. | +| ProcessName | string | Specifies that the corresponding value is the expected `ProcessName`. | +| CommandLine | string | Specifies that the corresponding value is the expected `CommandLine`.| + ### Examples Match the iisexpress process by name @@ -272,6 +281,18 @@ Match the iisexpress process by name } ``` +Match the iisexpress process by name (Shorthand) + +```json +{ + "DefaultProcess": { + "Filters": [{ + "ProcessName": "iisexpress" + }] + }, +} +``` + Match pid 1 ```json { @@ -284,6 +305,17 @@ Match pid 1 } ``` +Match pid 1 (Shorthand) +```json +{ + "DefaultProcess": { + "Filters": [{ + "ProcessId": "1" + }] + }, +} +``` + ## Cross-Origin Resource Sharing (CORS) Configuration // TODO @@ -490,8 +522,7 @@ The following example shows the `Filters` portion of a collection rule that has "Value": "dotnet", "MatchType": "Exact" },{ - "Key": "CommandLine", - "Value": "myapp.dll", + "CommandLine": "myapp.dll", "MatchType": "Contains" }] } diff --git a/documentation/schema.json b/documentation/schema.json index 243cf28a6a1..54a08bd6c30 100644 --- a/documentation/schema.json +++ b/documentation/schema.json @@ -449,10 +449,6 @@ "ProcessFilterDescriptor": { "type": "object", "additionalProperties": false, - "required": [ - "Key", - "Value" - ], "properties": { "Key": { "description": "The criteria used to compare against the target process.", @@ -463,9 +459,11 @@ ] }, "Value": { - "type": "string", - "description": "The value of the criteria used to compare against the target process.", - "minLength": 1 + "type": [ + "null", + "string" + ], + "description": "The value of the criteria used to compare against the target process." }, "MatchType": { "description": "Type of match to use against the process criteria.", @@ -475,6 +473,27 @@ "$ref": "#/definitions/ProcessFilterType" } ] + }, + "ProcessName": { + "type": [ + "null", + "string" + ], + "description": "Performs a match based on the name of a process on the system." + }, + "ProcessId": { + "type": [ + "null", + "string" + ], + "description": "Performs a match based on the numerical ID of a process on the system." + }, + "CommandLine": { + "type": [ + "null", + "string" + ], + "description": "Performs a match based on the contents of the command passed to launch the process on the system; this typically includes the executable path and arguments to the process." } } }, diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs index b8f089a6cc3..caa3e5fc2fe 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs +++ b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs @@ -945,6 +945,15 @@ public static string DisplayAttributeDescription_MonitorApiKeyOptions_Subject { } } + /// + /// Looks up a localized string similar to Performs a match based on the contents of the command passed to launch the process on the system; this typically includes the executable path and arguments to the process.. + /// + public static string DisplayAttributeDescription_ProcessFilterDescriptor_CommandLine { + get { + return ResourceManager.GetString("DisplayAttributeDescription_ProcessFilterDescriptor_CommandLine", resourceCulture); + } + } + /// /// Looks up a localized string similar to The criteria used to compare against the target process.. /// @@ -963,6 +972,24 @@ public static string DisplayAttributeDescription_ProcessFilterDescriptor_MatchTy } } + /// + /// Looks up a localized string similar to Performs a match based on the numerical ID of a process on the system.. + /// + public static string DisplayAttributeDescription_ProcessFilterDescriptor_ProcessId { + get { + return ResourceManager.GetString("DisplayAttributeDescription_ProcessFilterDescriptor_ProcessId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Performs a match based on the name of a process on the system.. + /// + public static string DisplayAttributeDescription_ProcessFilterDescriptor_ProcessName { + get { + return ResourceManager.GetString("DisplayAttributeDescription_ProcessFilterDescriptor_ProcessName", resourceCulture); + } + } + /// /// Looks up a localized string similar to The value of the criteria used to compare against the target process.. /// @@ -1071,6 +1098,15 @@ public static string DisplayAttributeDescription_StorageOptions_DumpTempFolder { } } + /// + /// Looks up a localized string similar to A value is required for the process filter.. + /// + public static string ErrorMessage_FilterValueMissing { + get { + return ResourceManager.GetString("ErrorMessage_FilterValueMissing", resourceCulture); + } + } + /// /// Looks up a localized string similar to The {0} field or the {1} field is required.. /// diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx index 7daca7d9914..a384bd149b1 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx +++ b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx @@ -571,4 +571,20 @@ The name of the environment variable to get. The description provided for the Name parameter on GetEnvironmentVariableOptions. + + Performs a match based on the contents of the command passed to launch the process on the system; this typically includes the executable path and arguments to the process. + The description provided for the CommandLine parameter on ProcessFilterDescriptor. + + + Performs a match based on the numerical ID of a process on the system. + The description provided for the ProcessId parameter on ProcessFilterDescriptor. + + + Performs a match based on the name of a process on the system. + The description provided for the ProcessName parameter on ProcessFilterDescriptor. + + + A value is required for the process filter. + Gets the format string for rejecting validation due to no value being provided for a process filter. + \ No newline at end of file diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs b/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs index ec95398e6ce..a62b12eaaf1 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.Options/ProcessFilterOptions.cs @@ -45,18 +45,16 @@ public sealed class ProcessFilterOptions public List Filters { get; set; } = new List(0); } - public sealed class ProcessFilterDescriptor + public sealed partial class ProcessFilterDescriptor { [Display( ResourceType = typeof(OptionsDisplayStrings), Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_Key))] - [Required] - public ProcessFilterKey Key { get;set; } + public ProcessFilterKey Key { get; set; } [Display( ResourceType = typeof(OptionsDisplayStrings), Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_Value))] - [Required] public string Value { get; set; } [Display( @@ -64,5 +62,39 @@ public sealed class ProcessFilterDescriptor Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_MatchType))] [DefaultValue(ProcessFilterType.Exact)] public ProcessFilterType MatchType { get; set; } = ProcessFilterType.Exact; + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_ProcessName))] + public string ProcessName { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_ProcessId))] + public string ProcessId { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_ProcessFilterDescriptor_CommandLine))] + public string CommandLine { get; set; } + } + + partial class ProcessFilterDescriptor : IValidatableObject + { + IEnumerable IValidatableObject.Validate(ValidationContext validationContext) + { + List results = new(); + + if (string.IsNullOrWhiteSpace(CommandLine) && string.IsNullOrWhiteSpace(ProcessId) && string.IsNullOrWhiteSpace(ProcessName)) + { + if (string.IsNullOrWhiteSpace(Value)) + { + results.Add(new ValidationResult( + string.Format(OptionsDisplayStrings.ErrorMessage_FilterValueMissing))); + } + } + + return results; + } } } diff --git a/src/Microsoft.Diagnostics.Monitoring.WebApi/DiagProcessFilter.cs b/src/Microsoft.Diagnostics.Monitoring.WebApi/DiagProcessFilter.cs index f53d6d68bcf..a1529788b34 100644 --- a/src/Microsoft.Diagnostics.Monitoring.WebApi/DiagProcessFilter.cs +++ b/src/Microsoft.Diagnostics.Monitoring.WebApi/DiagProcessFilter.cs @@ -74,6 +74,29 @@ private static List TransformKey(ProcessKey processKey) private static DiagProcessFilterEntry TransformDescriptor(ProcessFilterDescriptor processFilterDescriptor) { + if (!string.IsNullOrWhiteSpace(processFilterDescriptor.ProcessId)) + { + return new DiagProcessFilterEntry { Criteria = DiagProcessFilterCriteria.ProcessId, MatchType = DiagProcessFilterMatchType.Exact, Value = processFilterDescriptor.ProcessId }; + } + else if (!string.IsNullOrWhiteSpace(processFilterDescriptor.ProcessName)) + { + return new DiagProcessFilterEntry + { + Criteria = DiagProcessFilterCriteria.ProcessName, + MatchType = (processFilterDescriptor.MatchType == ProcessFilterType.Exact) ? DiagProcessFilterMatchType.Exact : DiagProcessFilterMatchType.Contains, + Value = processFilterDescriptor.ProcessName + }; + } + else if (!string.IsNullOrWhiteSpace(processFilterDescriptor.CommandLine)) + { + return new DiagProcessFilterEntry + { + Criteria = DiagProcessFilterCriteria.CommandLine, + MatchType = (processFilterDescriptor.MatchType == ProcessFilterType.Exact) ? DiagProcessFilterMatchType.Exact : DiagProcessFilterMatchType.Contains, + Value = processFilterDescriptor.CommandLine + }; + } + switch (processFilterDescriptor.Key) { case ProcessFilterKey.ProcessId: From 2b3214f4a38c44af587139e453a9d9cd4e0e7309 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 00:09:42 +0000 Subject: [PATCH 64/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220224.1 (#1541) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a855917e4c4..31d1ceee28b 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 222e1ab32b8b0b68c86c205bc6e0b483e119f390 + 5cf472e34602be0df49a1891b65a63859e1c2ebf - + https://github.com/dotnet/diagnostics - 222e1ab32b8b0b68c86c205bc6e0b483e119f390 + 5cf472e34602be0df49a1891b65a63859e1c2ebf diff --git a/eng/Versions.props b/eng/Versions.props index 20bd9eef0df..f8ebb769652 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22121.3 7.0.0-preview.3.22121.3 - 5.0.0-preview.22123.1 - 5.0.0-preview.22123.1 + 5.0.0-preview.22124.1 + 5.0.0-preview.22124.1 7.0.0-preview.3.22123.2 7.0.0-preview.3.22123.2 From a59cbb69d9b84e2fb773d1b319d376518893ad5f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 00:12:18 +0000 Subject: [PATCH 65/78] [main] Update dependencies from dotnet/aspnetcore (#1537) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 31d1ceee28b..e4f3c9272e7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 5760f2864016081a142642b417db17e5340a1d67 + 1852bb78776cbcf0c6f6daaa238e4a0c525366fc https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 05920e13af192144c3e9670f4616055f04e5f19a - + https://github.com/dotnet/aspnetcore - 5760f2864016081a142642b417db17e5340a1d67 + 1852bb78776cbcf0c6f6daaa238e4a0c525366fc https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index f8ebb769652..bab2d4540b4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22124.1 - 7.0.0-preview.3.22121.3 - 7.0.0-preview.3.22121.3 + 7.0.0-preview.3.22124.7 + 7.0.0-preview.3.22124.7 5.0.0-preview.22124.1 5.0.0-preview.22124.1 From f58a3e0f86a9ea857df4e3dbb5e86e6b8f19b943 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 14:04:51 +0000 Subject: [PATCH 66/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220225.1 (#1543) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e4f3c9272e7..85e266c9e92 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,11 +4,11 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics 5cf472e34602be0df49a1891b65a63859e1c2ebf - + https://github.com/dotnet/diagnostics 5cf472e34602be0df49a1891b65a63859e1c2ebf diff --git a/eng/Versions.props b/eng/Versions.props index bab2d4540b4..cfd899ae19d 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22124.7 7.0.0-preview.3.22124.7 - 5.0.0-preview.22124.1 - 5.0.0-preview.22124.1 + 5.0.0-preview.22125.1 + 5.0.0-preview.22125.1 7.0.0-preview.3.22123.2 7.0.0-preview.3.22123.2 From 2f50936cad3dc735921e1f37000f20c414763cba Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 26 Feb 2022 14:22:55 +0000 Subject: [PATCH 67/78] Update dependencies from https://github.com/dotnet/runtime build 20220225.10 (#1544) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 85e266c9e92..0b4d28d64cf 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - 05920e13af192144c3e9670f4616055f04e5f19a + c8da2fd5d8b841fc34845218158399cf35eb8bcf https://github.com/dotnet/aspnetcore 1852bb78776cbcf0c6f6daaa238e4a0c525366fc - + https://github.com/dotnet/runtime - 05920e13af192144c3e9670f4616055f04e5f19a + c8da2fd5d8b841fc34845218158399cf35eb8bcf diff --git a/eng/Versions.props b/eng/Versions.props index cfd899ae19d..149e4cc26da 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22125.1 5.0.0-preview.22125.1 - 7.0.0-preview.3.22123.2 - 7.0.0-preview.3.22123.2 + 7.0.0-preview.3.22125.10 + 7.0.0-preview.3.22125.10 1.0.312101 From 6e19de92d63153a8ec5aea3286eb14795ff990a3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 27 Feb 2022 14:26:58 +0000 Subject: [PATCH 68/78] Update dependencies from https://github.com/dotnet/runtime build 20220226.3 (#1547) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0b4d28d64cf..8ac27a3e101 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - c8da2fd5d8b841fc34845218158399cf35eb8bcf + ad3847caad8ac64afa64486cf61d3be45da5264f https://github.com/dotnet/aspnetcore 1852bb78776cbcf0c6f6daaa238e4a0c525366fc - + https://github.com/dotnet/runtime - c8da2fd5d8b841fc34845218158399cf35eb8bcf + ad3847caad8ac64afa64486cf61d3be45da5264f diff --git a/eng/Versions.props b/eng/Versions.props index 149e4cc26da..2a547ea8da6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22125.1 5.0.0-preview.22125.1 - 7.0.0-preview.3.22125.10 - 7.0.0-preview.3.22125.10 + 7.0.0-preview.3.22126.3 + 7.0.0-preview.3.22126.3 1.0.312101 From 4f64e502585787787e03bbea7266368923b91abc Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 14:23:14 +0000 Subject: [PATCH 69/78] Update dependencies from https://github.com/dotnet/runtime build 20220227.1 (#1548) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8ac27a3e101..dc21776cf1e 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - ad3847caad8ac64afa64486cf61d3be45da5264f + 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e https://github.com/dotnet/aspnetcore 1852bb78776cbcf0c6f6daaa238e4a0c525366fc - + https://github.com/dotnet/runtime - ad3847caad8ac64afa64486cf61d3be45da5264f + 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e diff --git a/eng/Versions.props b/eng/Versions.props index 2a547ea8da6..f050506d799 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22125.1 5.0.0-preview.22125.1 - 7.0.0-preview.3.22126.3 - 7.0.0-preview.3.22126.3 + 7.0.0-preview.3.22127.1 + 7.0.0-preview.3.22127.1 1.0.312101 From 953162656122bf54ae65a66eec604031ff9b67ce Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:10:54 +0000 Subject: [PATCH 70/78] [main] Update dependencies from dotnet/diagnostics (#1549) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dc21776cf1e..98e244b2771 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - 5cf472e34602be0df49a1891b65a63859e1c2ebf + f5c9c9258ed2a7f3ef783f523551c6bc25b3c463 - + https://github.com/dotnet/diagnostics - 5cf472e34602be0df49a1891b65a63859e1c2ebf + f5c9c9258ed2a7f3ef783f523551c6bc25b3c463 diff --git a/eng/Versions.props b/eng/Versions.props index f050506d799..8f292797b0e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22124.7 7.0.0-preview.3.22124.7 - 5.0.0-preview.22125.1 - 5.0.0-preview.22125.1 + 5.0.0-preview.22152.1 + 5.0.0-preview.22152.1 7.0.0-preview.3.22127.1 7.0.0-preview.3.22127.1 From ee7fc358a193ff6f39d6e1aaf24ac8a3fc45f978 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Thu, 3 Mar 2022 12:45:38 -0500 Subject: [PATCH 71/78] Push a Message to a Queue When Writing to Azure Egress (#1464) --- documentation/configuration.md | 48 +++++-- documentation/schema.json | 15 +++ eng/Versions.props | 3 +- .../AzureBlobEgressProviderOptions.cs | 10 ++ .../OptionsDisplayStrings.Designer.cs | 18 +++ .../OptionsDisplayStrings.resx | 10 +- .../EgressRedacted.json | 2 + .../EgressRedacted.json | 2 + .../dotnet-monitor/ConfigurationJsonWriter.cs | 2 + .../AzureBlob/AzureBlobEgressProvider.cs | 118 +++++++++++++++++- src/Tools/dotnet-monitor/LoggingEventIds.cs | 3 + src/Tools/dotnet-monitor/LoggingExtensions.cs | 34 +++++ src/Tools/dotnet-monitor/Strings.Designer.cs | 27 ++++ src/Tools/dotnet-monitor/Strings.resx | 21 ++++ .../dotnet-monitor/dotnet-monitor.csproj | 1 + 15 files changed, 298 insertions(+), 16 deletions(-) diff --git a/documentation/configuration.md b/documentation/configuration.md index e9ff3769ad1..3f357aa771b 100644 --- a/documentation/configuration.md +++ b/documentation/configuration.md @@ -411,16 +411,18 @@ In addition to enabling custom providers, `dotnet monitor` also allows you to di ### Azure blob storage egress provider -| Name | Type | Description | -|---|---|---| -| accountUri | string | The URI of the Azure blob storage account.| -| containerName | string | The name of the container to which the blob will be egressed. If egressing to the root container, use the "$root" sentinel value.| -| blobPrefix | string | Optional path prefix for the artifacts to egress.| -| copyBufferSize | string | The buffer size to use when copying data from the original artifact to the blob stream.| -| accountKey | string | The account key used to access the Azure blob storage account.| -| sharedAccessSignature | string | The shared access signature (SAS) used to access the azure blob storage account.| -| accountKeyName | string | Name of the property in the Properties section that will contain the account key.| -| sharedAccessSignatureName | string | Name of the property in the Properties section that will contain the SAS token.| +| Name | Type | Required | Description | +|---|---|---|---| +| accountUri | string | true | The URI of the Azure blob storage account.| +| containerName | string | true | The name of the container to which the blob will be egressed. If egressing to the root container, use the "$root" sentinel value.| +| blobPrefix | string | false | Optional path prefix for the artifacts to egress.| +| copyBufferSize | string | false | The buffer size to use when copying data from the original artifact to the blob stream.| +| accountKey | string | false | The account key used to access the Azure blob storage account; must be specified if `accountKeyName` is not specified.| +| sharedAccessSignature | string | false | The shared access signature (SAS) used to access the azure blob storage account; if using SAS, must be specified if `sharedAccessSignatureName` is not specified.| +| accountKeyName | string | false | Name of the property in the Properties section that will contain the account key; must be specified if `accountKey` is not specified.| +| sharedAccessSignatureName | string | false | Name of the property in the Properties section that will contain the SAS token; if using SAS, must be specified if `sharedAccessSignature` is not specified.| +| queueName | string | false | The name of the queue to which a message will be dispatched upon writing to a blob.| +| queueAccountUri | string | false | The URI of the Azure queue account.| ### Example azureBlobStorage provider @@ -442,6 +444,32 @@ In addition to enabling custom providers, `dotnet monitor` also allows you to di } ``` +### Example azureBlobStorage provider with queue + +```json +{ + "Egress": { + "AzureBlobStorage": { + "monitorBlob": { + "accountUri": "https://exampleaccount.blob.core.windows.net", + "containerName": "dotnet-monitor", + "blobPrefix": "artifacts", + "accountKeyName": "MonitorBlobAccountKey", + "queueAccountUri": "https://exampleaccount.queue.core.windows.net", + "queueName": "dotnet-monitor-queue" + } + }, + "Properties": { + "MonitorBlobAccountKey": "accountKey" + } + } +} +``` + +#### azureBlobStorage Queue Message Format + +The Queue Message's payload will be the blob name (`/`; using the above example with an artifact named `mydump.dmp`, this would be `artifacts/mydump.dmp`) that is being egressed to blob storage. This is designed to be easily integrated into an Azure Function that triggers whenever a new message is added to the queue, providing you with the contents of the artifact as a stream. See [Azure Blob storage input binding for Azure Functions](https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob-input?tabs=csharp#example) for an example. + ### Filesystem egress provider | Name | Type | Description | diff --git a/documentation/schema.json b/documentation/schema.json index 54a08bd6c30..c0832271e11 100644 --- a/documentation/schema.json +++ b/documentation/schema.json @@ -971,6 +971,21 @@ ], "description": "Buffer size used when copying data from an egress callback returning a stream to the egress callback that is provided a stream to which data is written.", "format": "int32" + }, + "QueueName": { + "type": [ + "null", + "string" + ], + "description": "The name of the queue to which a message will be dispatched upon writing to a blob." + }, + "QueueAccountUri": { + "type": [ + "null", + "string" + ], + "description": "The URI of the Azure queue account.", + "format": "uri" } } }, diff --git a/eng/Versions.props b/eng/Versions.props index 8f292797b0e..6e6e42aeefd 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -66,7 +66,8 @@ $(MicrosoftAspNetCoreAppRuntimewinx64Version) - 12.6.0 + 12.10.0 + 12.8.0 6.0.0 6.0.0 6.0.0 diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/AzureBlobEgressProviderOptions.cs b/src/Microsoft.Diagnostics.Monitoring.Options/AzureBlobEgressProviderOptions.cs index 142af1b4eff..2fa43adcf95 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/AzureBlobEgressProviderOptions.cs +++ b/src/Microsoft.Diagnostics.Monitoring.Options/AzureBlobEgressProviderOptions.cs @@ -55,5 +55,15 @@ internal sealed partial class AzureBlobEgressProviderOptions : ResourceType = typeof(OptionsDisplayStrings), Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_CommonEgressProviderOptions_CopyBufferSize))] public int? CopyBufferSize { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueName))] + public string QueueName { get; set; } + + [Display( + ResourceType = typeof(OptionsDisplayStrings), + Description = nameof(OptionsDisplayStrings.DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueAccountUri))] + public Uri QueueAccountUri { get; set; } } } diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs index caa3e5fc2fe..fe0329cff7f 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs +++ b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.Designer.cs @@ -240,6 +240,24 @@ public static string DisplayAttributeDescription_AzureBlobEgressProviderOptions_ } } + /// + /// Looks up a localized string similar to The URI of the Azure queue account.. + /// + public static string DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueAccountUri { + get { + return ResourceManager.GetString("DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueAccountUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The name of the queue to which a message will be dispatched upon writing to a blob.. + /// + public static string DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueName { + get { + return ResourceManager.GetString("DisplayAttributeDescription_AzureBlobEgressProviderOptions_QueueName", resourceCulture); + } + } + /// /// Looks up a localized string similar to The shared access signature (SAS) used to access the azure blob storage account.. /// diff --git a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx index a384bd149b1..c439302e204 100644 --- a/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx +++ b/src/Microsoft.Diagnostics.Monitoring.Options/OptionsDisplayStrings.resx @@ -571,6 +571,14 @@ The name of the environment variable to get. The description provided for the Name parameter on GetEnvironmentVariableOptions. + + The URI of the Azure queue account. + The description provided for the QueueAccountUri parameter on AzureBlobEgressProviderOptions. + + + The name of the queue to which a message will be dispatched upon writing to a blob. + The description provided for the QueueName parameter on AzureBlobEgressProviderOptions. + Performs a match based on the contents of the command passed to launch the process on the system; this typically includes the executable path and arguments to the process. The description provided for the CommandLine parameter on ProcessFilterDescriptor. @@ -587,4 +595,4 @@ A value is required for the process filter. Gets the format string for rejecting validation due to no value being provided for a process filter. - \ No newline at end of file + diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/EgressRedacted.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/EgressRedacted.json index fdb4ae09f6f..117d636d057 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/EgressRedacted.json +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedConfigurations/EgressRedacted.json @@ -8,6 +8,8 @@ "BlobPrefix": "artifacts", "ContainerName": "dotnet-monitor", "CopyBufferSize": ":NOT PRESENT:", + "QueueName": ":NOT PRESENT:", + "QueueAccountUri": ":NOT PRESENT:", "SharedAccessSignature": ":NOT PRESENT:", "AccountKey": ":NOT PRESENT:", "SharedAccessSignatureName": ":NOT PRESENT:", diff --git a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json index 999ba2eb26f..3d1759cb59a 100644 --- a/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json +++ b/src/Tests/Microsoft.Diagnostics.Monitoring.Tool.UnitTests/ExpectedShowSourcesConfigurations/EgressRedacted.json @@ -8,6 +8,8 @@ "BlobPrefix": "artifacts" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, "ContainerName": "dotnet-monitor" /*JsonConfigurationProvider for 'settings.json' (Optional)*/, "CopyBufferSize": ":NOT PRESENT:", + "QueueName": ":NOT PRESENT:", + "QueueAccountUri": ":NOT PRESENT:", "SharedAccessSignature": ":NOT PRESENT:", "AccountKey": ":NOT PRESENT:", "SharedAccessSignatureName": ":NOT PRESENT:", diff --git a/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs b/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs index d4949f45232..425f12c66ab 100644 --- a/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs +++ b/src/Tools/dotnet-monitor/ConfigurationJsonWriter.cs @@ -140,6 +140,8 @@ private void ProcessEgressSection(IConfiguration egress, bool skipNotPresent, bo ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.BlobPrefix), skipNotPresent, includeChildSections: false, showSources: showSources); ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.ContainerName), skipNotPresent, includeChildSections: false, showSources: showSources); ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.CopyBufferSize), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.QueueName), skipNotPresent, includeChildSections: false, showSources: showSources); + ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.QueueAccountUri), skipNotPresent, includeChildSections: false, showSources: showSources); ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignature), skipNotPresent, includeChildSections: false, redact: true, showSources: showSources); ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.AccountKey), skipNotPresent, includeChildSections: false, redact: true, showSources: showSources); ProcessChildSection(optionsSection, nameof(AzureBlobEgressProviderOptions.SharedAccessSignatureName), skipNotPresent, includeChildSections: false, redact: false, showSources: showSources); diff --git a/src/Tools/dotnet-monitor/Egress/AzureBlob/AzureBlobEgressProvider.cs b/src/Tools/dotnet-monitor/Egress/AzureBlob/AzureBlobEgressProvider.cs index e0f1d203fcc..68627576607 100644 --- a/src/Tools/dotnet-monitor/Egress/AzureBlob/AzureBlobEgressProvider.cs +++ b/src/Tools/dotnet-monitor/Egress/AzureBlob/AzureBlobEgressProvider.cs @@ -7,10 +7,13 @@ using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; using Azure.Storage.Blobs.Specialized; +using Azure.Storage.Queues; using Microsoft.Extensions.Logging; using System; using System.Globalization; using System.IO; +using System.Text; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -42,7 +45,9 @@ public override async Task EgressAsync( { var containerClient = await GetBlobContainerClientAsync(options, token); - BlobClient blobClient = containerClient.GetBlobClient(GetBlobName(options, artifactSettings)); + string blobName = GetBlobName(options, artifactSettings); + + BlobClient blobClient = containerClient.GetBlobClient(blobName); Logger?.EgressProviderInvokeStreamAction(EgressProviderTypes.AzureBlobStorage); using var stream = await action(token); @@ -52,6 +57,12 @@ public override async Task EgressAsync( string blobUriString = GetBlobUri(blobClient); Logger?.EgressProviderSavedStream(EgressProviderTypes.AzureBlobStorage, blobUriString); + + if (CheckQueueEgressOptions(options)) + { + await EgressMessageToQueue(blobName, options, token); + } + return blobUriString; } catch (AggregateException ex) when (ex.InnerException is RequestFailedException innerException) @@ -74,7 +85,9 @@ public override async Task EgressAsync( { var containerClient = await GetBlobContainerClientAsync(options, token); - BlockBlobClient blobClient = containerClient.GetBlockBlobClient(GetBlobName(options, artifactSettings)); + string blobName = GetBlobName(options, artifactSettings); + + BlockBlobClient blobClient = containerClient.GetBlockBlobClient(blobName); // Write blob content @@ -105,6 +118,12 @@ public override async Task EgressAsync( string blobUriString = GetBlobUri(blobClient); Logger?.EgressProviderSavedStream(EgressProviderTypes.AzureBlobStorage, blobUriString); + + if (CheckQueueEgressOptions(options)) + { + await EgressMessageToQueue(blobName, options, token); + } + return blobUriString; } catch (AggregateException ex) when (ex.InnerException is RequestFailedException innerException) @@ -117,7 +136,20 @@ public override async Task EgressAsync( } } - private Uri GetAccountUri(AzureBlobEgressProviderOptions options, out string accountName) + private bool CheckQueueEgressOptions(AzureBlobEgressProviderOptions options) + { + bool queueNameSet = !string.IsNullOrEmpty(options.QueueName); + bool queueAccountUriSet = null != options.QueueAccountUri; + + if (queueNameSet ^ queueAccountUriSet) + { + Logger.QueueOptionsPartiallySet(); + } + + return queueNameSet && queueAccountUriSet; + } + + private Uri GetBlobAccountUri(AzureBlobEgressProviderOptions options, out string accountName) { var blobUriBuilder = new BlobUriBuilder(options.AccountUri); blobUriBuilder.Query = null; @@ -129,6 +161,84 @@ private Uri GetAccountUri(AzureBlobEgressProviderOptions options, out string acc return blobUriBuilder.ToUri(); } + private Uri GetQueueAccountUri(AzureBlobEgressProviderOptions options, out string accountName) + { + var queueUriBuilder = new QueueUriBuilder(options.QueueAccountUri); + + queueUriBuilder.Query = null; + queueUriBuilder.QueueName = null; + + accountName = queueUriBuilder.AccountName; + + return queueUriBuilder.ToUri(); + } + + private async Task EgressMessageToQueue(string blobName, AzureBlobEgressProviderOptions options, CancellationToken token) + { + try + { + QueueClient queueClient = await GetQueueClientAsync(options, token); + + if (queueClient.Exists()) + { + await queueClient.SendMessageAsync(blobName, cancellationToken: token); + } + else + { + Logger.QueueDoesNotExist(options.QueueName); + } + } + catch (Exception ex) + { + Logger.WritingMessageToQueueFailed(options.QueueName, ex); + } + } + + private async Task GetQueueClientAsync(AzureBlobEgressProviderOptions options, CancellationToken token) + { + QueueClientOptions clientOptions = new() + { + MessageEncoding = QueueMessageEncoding.Base64 + }; + + QueueServiceClient serviceClient; + if (!string.IsNullOrWhiteSpace(options.SharedAccessSignature)) + { + var serviceUriBuilder = new UriBuilder(options.QueueAccountUri) + { + Query = options.SharedAccessSignature + }; + + serviceClient = new QueueServiceClient(serviceUriBuilder.Uri, clientOptions); + } + else if (!string.IsNullOrEmpty(options.AccountKey)) + { + // Remove Query in case SAS token was specified + Uri accountUri = GetQueueAccountUri(options, out string accountName); + + StorageSharedKeyCredential credential = new StorageSharedKeyCredential( + accountName, + options.AccountKey); + + serviceClient = new QueueServiceClient(accountUri, credential, clientOptions); + } + else + { + throw CreateException(Strings.ErrorMessage_EgressMissingSasOrKey); + } + + QueueClient queueClient = serviceClient.GetQueueClient(options.QueueName); + + // This is done for instances where a SAS token may not have permission to create queues, + // but is allowed to write a message out to one that already exists + if (!await queueClient.ExistsAsync()) + { + await queueClient.CreateIfNotExistsAsync(cancellationToken: token); + } + + return queueClient; + } + private async Task GetBlobContainerClientAsync(AzureBlobEgressProviderOptions options, CancellationToken token) { BlobServiceClient serviceClient; @@ -144,7 +254,7 @@ private async Task GetBlobContainerClientAsync(AzureBlobEgr else if (!string.IsNullOrEmpty(options.AccountKey)) { // Remove Query in case SAS token was specified - Uri accountUri = GetAccountUri(options, out string accountName); + Uri accountUri = GetBlobAccountUri(options, out string accountName); StorageSharedKeyCredential credential = new StorageSharedKeyCredential( accountName, diff --git a/src/Tools/dotnet-monitor/LoggingEventIds.cs b/src/Tools/dotnet-monitor/LoggingEventIds.cs index 9a61250d392..faa5c4d5009 100644 --- a/src/Tools/dotnet-monitor/LoggingEventIds.cs +++ b/src/Tools/dotnet-monitor/LoggingEventIds.cs @@ -67,6 +67,9 @@ internal enum LoggingEventIds SetEnvironmentVariable = 54, GetEnvironmentVariable = 55, MonitorApiKeyNotConfigured = 56, + QueueDoesNotExist = 57, + QueueOptionsPartiallySet = 58, + WritingMessageToQueueFailed = 59 } internal static class LoggingEventIdsExtensions diff --git a/src/Tools/dotnet-monitor/LoggingExtensions.cs b/src/Tools/dotnet-monitor/LoggingExtensions.cs index 1acb86870f4..0a7fafb4326 100644 --- a/src/Tools/dotnet-monitor/LoggingExtensions.cs +++ b/src/Tools/dotnet-monitor/LoggingExtensions.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.Diagnostics.Tools.Monitor.Egress.AzureBlob; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; @@ -308,6 +309,24 @@ internal static class LoggingExtensions logLevel: LogLevel.Warning, formatString: Strings.LogFormatString_ApiKeyNotConfigured); + private static readonly Action _queueDoesNotExist = + LoggerMessage.Define( + eventId: LoggingEventIds.QueueDoesNotExist.EventId(), + logLevel: LogLevel.Warning, + formatString: Strings.LogFormatString_QueueDoesNotExist); + + private static readonly Action _queueOptionsPartiallySet = + LoggerMessage.Define( + eventId: LoggingEventIds.QueueOptionsPartiallySet.EventId(), + logLevel: LogLevel.Warning, + formatString: Strings.LogFormatString_QueueOptionsPartiallySet); + + private static readonly Action _writingMessageToQueueFailed = + LoggerMessage.Define( + eventId: LoggingEventIds.WritingMessageToQueueFailed.EventId(), + logLevel: LogLevel.Warning, + formatString: Strings.LogFormatString_WritingMessageToQueueFailed); + public static void EgressProviderInvalidOptions(this ILogger logger, string providerName) { _egressProviderInvalidOptions(logger, providerName, null); @@ -567,5 +586,20 @@ private static string GetFwLinkWithCurrentLcidUri(long fwlinkId) fwlinkId, CultureInfo.CurrentUICulture.LCID); } + + public static void QueueDoesNotExist(this ILogger logger, string queueName) + { + _queueDoesNotExist(logger, queueName, nameof(AzureBlobEgressProviderOptions.QueueName), nameof(AzureBlobEgressProviderOptions.QueueAccountUri), null); + } + + public static void QueueOptionsPartiallySet(this ILogger logger) + { + _queueOptionsPartiallySet(logger, nameof(AzureBlobEgressProviderOptions.QueueName), nameof(AzureBlobEgressProviderOptions.QueueAccountUri), null); + } + + public static void WritingMessageToQueueFailed(this ILogger logger, string queueName, Exception ex) + { + _writingMessageToQueueFailed(logger, queueName, ex); + } } } diff --git a/src/Tools/dotnet-monitor/Strings.Designer.cs b/src/Tools/dotnet-monitor/Strings.Designer.cs index 4c4682ea288..f79eb1a3a68 100644 --- a/src/Tools/dotnet-monitor/Strings.Designer.cs +++ b/src/Tools/dotnet-monitor/Strings.Designer.cs @@ -951,6 +951,24 @@ internal static string LogFormatString_OptionsValidationFailure { } } + /// + /// Looks up a localized string similar to The queue {0} does not exist; ensure that the {queueName} and {queueAccountUri} fields are set correctly.. + /// + internal static string LogFormatString_QueueDoesNotExist { + get { + return ResourceManager.GetString("LogFormatString_QueueDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Queue message egress requires {queueName} and {queueAccountUri} to be set. + /// + internal static string LogFormatString_QueueOptionsPartiallySet { + get { + return ResourceManager.GetString("LogFormatString_QueueOptionsPartiallySet", resourceCulture); + } + } + /// /// Looks up a localized string similar to The process was launched elevated and will have access to all processes on the system. Do not run elevated unless you need to monitor processes launched by another user (e.g., IIS worker processes). /// @@ -978,6 +996,15 @@ internal static string LogFormatString_UnableToListenToAddress { } } + /// + /// Looks up a localized string similar to Unable to send message to the queue {0}.. + /// + internal static string LogFormatString_WritingMessageToQueueFailed { + get { + return ResourceManager.GetString("LogFormatString_WritingMessageToQueueFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Generated ApiKey for dotnet-monitor; use the following header for authorization:. /// diff --git a/src/Tools/dotnet-monitor/Strings.resx b/src/Tools/dotnet-monitor/Strings.resx index 64826bed677..880fc8f4eb1 100644 --- a/src/Tools/dotnet-monitor/Strings.resx +++ b/src/Tools/dotnet-monitor/Strings.resx @@ -589,6 +589,21 @@ Gets the format string that is printed in the 18:OptionsValidationFailure event. 1 Format Parameter: 1. failure: The failure message from validation + + + The queue {0} does not exist; ensure that the {queueName} and {queueAccountUri} fields are set correctly. + Gets the format string that is printed in the 57:QueueDoesNotExist event. +3 Format Parameters: +1. queueName: The name of the Azure Queue where messages are egressed +2. nameof(queueName) +3. nameof(queueAccountUri) + + + Queue message egress requires {queueName} and {queueAccountUri} to be set + Gets the format string that is printed in the 58:QueueOptions event. +2 Format Parameters: +1. nameof(queueName) +2. nameof(queueAccountUri) The process was launched elevated and will have access to all processes on the system. Do not run elevated unless you need to monitor processes launched by another user (e.g., IIS worker processes) @@ -607,6 +622,12 @@ Gets the format string that is printed in the 15:UnableToListenToAddress event. 1 Format Parameter: 1. url: The URL that could not have a listener attached to it + + + Unable to send message to the queue {0}. + Gets the format string that is printed in the 59:WritingMessageToQueueFailed event. +1 Format Parameter: +1. queueName: The name of the Azure Queue where messages are egressed Generated ApiKey for dotnet-monitor; use the following header for authorization: diff --git a/src/Tools/dotnet-monitor/dotnet-monitor.csproj b/src/Tools/dotnet-monitor/dotnet-monitor.csproj index 54f3b4e5500..e7952a94181 100644 --- a/src/Tools/dotnet-monitor/dotnet-monitor.csproj +++ b/src/Tools/dotnet-monitor/dotnet-monitor.csproj @@ -15,6 +15,7 @@ + From bad8bcf2e39a72452e108e16300be4f0bf65daa4 Mon Sep 17 00:00:00 2001 From: kkeirstead <85592574+kkeirstead@users.noreply.github.com> Date: Thu, 3 Mar 2022 14:45:12 -0500 Subject: [PATCH 72/78] Update releaseNotes.md (#1554) --- documentation/releaseNotes/releaseNotes.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/documentation/releaseNotes/releaseNotes.md b/documentation/releaseNotes/releaseNotes.md index f38e75eb581..73ed396a5f0 100644 --- a/documentation/releaseNotes/releaseNotes.md +++ b/documentation/releaseNotes/releaseNotes.md @@ -1,6 +1,7 @@ -Today we are releasing the next preview of the `dotnet monitor` tool. This release includes: +Today we are releasing the next official preview of the `dotnet monitor` tool. This release includes: -- ⚠️ [Here is a breaking change we did and its work item] (#737) -- [Here is a new feature we added and its work item] (#737) +- Allow for pushing a message to a queue when writing to Azure egress (#163) +- Allow for simplified process filter configuration (#636) +- Allow `config show` command to list configuration sources (#277) \*⚠️ **_indicates a breaking change_** From ed3e7247367658179c11f3bca4e1b761d5bea06c Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 23:38:47 +0000 Subject: [PATCH 73/78] [main] Update dependencies from dotnet/runtime (#1550) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 98e244b2771..564a9476dfe 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 73471b51fb55198bc089f342cd75e077cc4762a8 https://github.com/dotnet/aspnetcore 1852bb78776cbcf0c6f6daaa238e4a0c525366fc - + https://github.com/dotnet/runtime - 68fb7fc68cc1af800bee1d38af22b5027bf4ab4e + 73471b51fb55198bc089f342cd75e077cc4762a8 diff --git a/eng/Versions.props b/eng/Versions.props index 6e6e42aeefd..b966029ae3b 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22152.1 5.0.0-preview.22152.1 - 7.0.0-preview.3.22127.1 - 7.0.0-preview.3.22127.1 + 7.0.0-preview.3.22152.5 + 7.0.0-preview.3.22152.5 1.0.312101 From c7a6f9a364eb06f83152a097109717b16b67f2d1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 3 Mar 2022 23:47:53 +0000 Subject: [PATCH 74/78] [main] Update dependencies from dotnet/aspnetcore (#1545) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 564a9476dfe..14ef8104c06 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - 1852bb78776cbcf0c6f6daaa238e4a0c525366fc + c9628273f5e37a9a07b174960ff2228de8b7d4dc https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime 73471b51fb55198bc089f342cd75e077cc4762a8 - + https://github.com/dotnet/aspnetcore - 1852bb78776cbcf0c6f6daaa238e4a0c525366fc + c9628273f5e37a9a07b174960ff2228de8b7d4dc https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index b966029ae3b..2dcf754e536 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22124.1 - 7.0.0-preview.3.22124.7 - 7.0.0-preview.3.22124.7 + 7.0.0-preview.3.22152.8 + 7.0.0-preview.3.22152.8 5.0.0-preview.22152.1 5.0.0-preview.22152.1 From 85141dd433f9cf8222bd4c200992b75df49e0c4b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 14:44:52 +0000 Subject: [PATCH 75/78] Update dependencies from https://github.com/dotnet/runtime build 20220304.1 (#1557) [main] Update dependencies from dotnet/runtime --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 14ef8104c06..6228768f02d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -30,17 +30,17 @@ https://github.com/dotnet/symstore 66022c1c9778e69dcff6ab07f41d37eb64ebd386 - + https://github.com/dotnet/runtime - 73471b51fb55198bc089f342cd75e077cc4762a8 + d832befeb0edf5e7b5685beb5b7e3d7932a1fa28 https://github.com/dotnet/aspnetcore c9628273f5e37a9a07b174960ff2228de8b7d4dc - + https://github.com/dotnet/runtime - 73471b51fb55198bc089f342cd75e077cc4762a8 + d832befeb0edf5e7b5685beb5b7e3d7932a1fa28 diff --git a/eng/Versions.props b/eng/Versions.props index 2dcf754e536..8fc9a7cf3d8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -50,8 +50,8 @@ 5.0.0-preview.22152.1 5.0.0-preview.22152.1 - 7.0.0-preview.3.22152.5 - 7.0.0-preview.3.22152.5 + 7.0.0-preview.3.22154.1 + 7.0.0-preview.3.22154.1 1.0.312101 From e7ed905667ba5f702fb87404b5e928c255270a71 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 17:27:56 +0000 Subject: [PATCH 76/78] [main] Update dependencies from dotnet/arcade (#1546) [main] Update dependencies from dotnet/arcade --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 2 +- global.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6228768f02d..aeafc958752 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -18,13 +18,13 @@ https://github.com/dotnet/aspnetcore c9628273f5e37a9a07b174960ff2228de8b7d4dc - + https://github.com/dotnet/arcade - eac1a3f1eb7404c0438664381b58d7238600aafc + a19c29a391b292519a08217314bc53de6fb2d12c - + https://github.com/dotnet/arcade - eac1a3f1eb7404c0438664381b58d7238600aafc + a19c29a391b292519a08217314bc53de6fb2d12c https://github.com/dotnet/symstore diff --git a/eng/Versions.props b/eng/Versions.props index 8fc9a7cf3d8..a7e563b56b0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -42,7 +42,7 @@ --> - 7.0.0-beta.22124.1 + 7.0.0-beta.22153.1 7.0.0-preview.3.22152.8 7.0.0-preview.3.22152.8 diff --git a/global.json b/global.json index a9e0d5e7680..fb8749031ed 100644 --- a/global.json +++ b/global.json @@ -18,6 +18,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "2.0.1", - "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22124.1" + "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22153.1" } } From b39d0854b8e34e412ad4956f335e8fff1b8cf4a1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 17:35:49 +0000 Subject: [PATCH 77/78] Update dependencies from https://github.com/dotnet/diagnostics build 20220303.1 (#1556) [main] Update dependencies from dotnet/diagnostics --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index aeafc958752..50bb5394c78 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -4,13 +4,13 @@ https://github.com/dotnet/command-line-api 166610c56ff732093f0145a2911d4f6c40b786da - + https://github.com/dotnet/diagnostics - f5c9c9258ed2a7f3ef783f523551c6bc25b3c463 + 4bed4e5cf61e738e015d0ce8116fa4a8b153836b - + https://github.com/dotnet/diagnostics - f5c9c9258ed2a7f3ef783f523551c6bc25b3c463 + 4bed4e5cf61e738e015d0ce8116fa4a8b153836b diff --git a/eng/Versions.props b/eng/Versions.props index a7e563b56b0..69db4e2ec4f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -47,8 +47,8 @@ 7.0.0-preview.3.22152.8 7.0.0-preview.3.22152.8 - 5.0.0-preview.22152.1 - 5.0.0-preview.22152.1 + 5.0.0-preview.22153.1 + 5.0.0-preview.22153.1 7.0.0-preview.3.22154.1 7.0.0-preview.3.22154.1 From 01d81e52b86084fd37fae11ce086aafc6c0f1717 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 4 Mar 2022 17:36:59 +0000 Subject: [PATCH 78/78] Update dependencies from https://github.com/dotnet/aspnetcore build 20220304.1 (#1558) [main] Update dependencies from dotnet/aspnetcore --- eng/Version.Details.xml | 8 ++++---- eng/Versions.props | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 50bb5394c78..f5e3b5fe851 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -14,9 +14,9 @@ - + https://github.com/dotnet/aspnetcore - c9628273f5e37a9a07b174960ff2228de8b7d4dc + 53baae11e362b65dce5b3594d1ee3a497b186068 https://github.com/dotnet/arcade @@ -34,9 +34,9 @@ https://github.com/dotnet/runtime d832befeb0edf5e7b5685beb5b7e3d7932a1fa28 - + https://github.com/dotnet/aspnetcore - c9628273f5e37a9a07b174960ff2228de8b7d4dc + 53baae11e362b65dce5b3594d1ee3a497b186068 https://github.com/dotnet/runtime diff --git a/eng/Versions.props b/eng/Versions.props index 69db4e2ec4f..77e35afa546 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -44,8 +44,8 @@ 7.0.0-beta.22153.1 - 7.0.0-preview.3.22152.8 - 7.0.0-preview.3.22152.8 + 7.0.0-preview.3.22154.1 + 7.0.0-preview.3.22154.1 5.0.0-preview.22153.1 5.0.0-preview.22153.1