diff --git a/packages/http-client-csharp/eng/pipeline/publish.yml b/packages/http-client-csharp/eng/pipeline/publish.yml index 5790b0ea881..c0ba9c6f201 100644 --- a/packages/http-client-csharp/eng/pipeline/publish.yml +++ b/packages/http-client-csharp/eng/pipeline/publish.yml @@ -131,9 +131,17 @@ extends: $commitSha = '$(Build.SourceVersion)' $typeSpecCommitUrl = "$repoUrl/commit/$commitSha" + # Compute the URL to this pipeline run for inclusion in the generated PR + $collectionUri = '$(System.CollectionUri)'.TrimEnd('/') + $teamProject = '$(System.TeamProject)' + $buildId = '$(Build.BuildId)' + $pipelineRunUrl = "$collectionUri/$teamProject/_build/results?buildId=$buildId&view=results" + Write-Host "Commit SHA: $commitSha" Write-Host "TypeSpec Commit URL: $typeSpecCommitUrl" + Write-Host "Pipeline Run URL: $pipelineRunUrl" Write-Host "##vso[task.setvariable variable=TypeSpecCommitUrl]$typeSpecCommitUrl" + Write-Host "##vso[task.setvariable variable=PipelineRunUrl]$pipelineRunUrl" displayName: Set variables for PR creation - task: UseNode@1 @@ -233,6 +241,7 @@ extends: -TypeSpecCommitUrl '$(TypeSpecCommitUrl)' -AuthToken '$(GH_TOKEN)' -TypeSpecSourcePackageJsonPath '$(Build.SourcesDirectory)/packages/http-client-csharp/package.json' + -PipelineRunUrl '$(PipelineRunUrl)' ${{ replace(replace('True', eq(variables['Build.SourceBranchName'], 'main'), ''), 'True', '-Internal') }} ${{ replace(replace('True', eq(parameters.RegenerateAzureLibraries, false), ''), 'True', '-RegenerateAzureLibraries') }} ${{ replace(replace('True', eq(parameters.RegenerateMgmtLibraries, false), ''), 'True', '-RegenerateMgmtLibraries') }} diff --git a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 index c76a17c7326..17203ca0cc1 100755 --- a/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 +++ b/packages/http-client-csharp/eng/scripts/Submit-AzureSdkForNetPr.ps1 @@ -19,6 +19,8 @@ When specified, builds the Azure emitter locally and regenerates Azure data plan When specified, builds the management plane emitter locally and regenerates mgmt SDK libraries. Implies Azure emitter build since mgmt depends on it. .PARAMETER BuildArtifactsPath Path to the build artifacts directory containing the published .tgz and .nupkg files. Required when RegenerateAzureLibraries or RegenerateMgmtLibraries is specified. +.PARAMETER PipelineRunUrl +The URL of the pipeline run that triggered this PR. When provided, it is included in the PR description for traceability. #> [CmdletBinding(SupportsShouldProcess = $true)] param( @@ -49,6 +51,9 @@ param( [Parameter(Mandatory = $false)] [string]$BuildArtifactsPath, + [Parameter(Mandatory = $false)] + [string]$PipelineRunUrl, + [Parameter(Mandatory = $false)] [switch]$UseTypeSpecNext ) @@ -80,7 +85,12 @@ This PR updates the UnbrandedGeneratorVersion property in eng/centralpackagemana ## Details -- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl +- TypeSpec commit that triggered this PR: $TypeSpecCommitUrl$(if ($PipelineRunUrl) { +@" + +- Pipeline run that produced this PR: $PipelineRunUrl +"@ +}) ## Changes