Support debug output in vmr-sync.ps1 (#18516)

This commit is contained in:
Alexander Köplinger 2024-02-06 14:16:02 +01:00 committed by GitHub
parent 411175156e
commit 198b5a8a9d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View file

@ -88,7 +88,7 @@ steps:
# -remote "installer:$(Agent.BuildDirectory)/installer" # -remote "installer:$(Agent.BuildDirectory)/installer"
-componentTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/Component.template.md ` -componentTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/Component.template.md `
-tpnTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt ` -tpnTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt `
-debug -debugOutput
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
echo "##vso[task.logissue type=error]Failed to synchronize the VMR" echo "##vso[task.logissue type=error]Failed to synchronize the VMR"

View file

@ -62,6 +62,9 @@ Optional. Azure DevOps PAT to use for cloning private repositories.
.PARAMETER vmrDir .PARAMETER vmrDir
Optional. Path to the dotnet/dotnet repository. When null, gets cloned to the temporary folder Optional. Path to the dotnet/dotnet repository. When null, gets cloned to the temporary folder
.PARAMETER debugOutput
Optional. Enables debug logging in the darc vmr command.
#> #>
param ( param (
[Parameter(Mandatory=$true, HelpMessage="Path to the temporary folder where repositories will be cloned")] [Parameter(Mandatory=$true, HelpMessage="Path to the temporary folder where repositories will be cloned")]
@ -73,7 +76,8 @@ param (
[string][Alias('r')]$repository, [string][Alias('r')]$repository,
[string]$tpnTemplate = "src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt", [string]$tpnTemplate = "src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt",
[string]$azdevPat, [string]$azdevPat,
[string][Alias('v', 'vmr')]$vmrDir [string][Alias('v', 'vmr')]$vmrDir,
[switch]$debugOutput
) )
$scriptRoot = $PSScriptRoot $scriptRoot = $PSScriptRoot
@ -98,7 +102,7 @@ if ($remote) {
} }
$verbosity = 'verbose' $verbosity = 'verbose'
if ($debug) { if ($debugOutput) {
$verbosity = 'debug' $verbosity = 'debug'
} }
# Validation # Validation
@ -206,7 +210,7 @@ if ($LASTEXITCODE -eq 0) {
else { else {
Fail "Synchronization of dotnet/dotnet to '$repository' failed!" Fail "Synchronization of dotnet/dotnet to '$repository' failed!"
Fail "'$vmrDir' is left in its last state (re-run of this script will reset it)." Fail "'$vmrDir' is left in its last state (re-run of this script will reset it)."
Fail "Please inspect the logs which contain path to the failing patch file (use --debug to get all the details)." Fail "Please inspect the logs which contain path to the failing patch file (use -debugOutput to get all the details)."
Fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script." Fail "Once you make changes to the conflicting VMR patch, commit it locally and re-run this script."
exit 1 exit 1
} }