diff --git a/eng/common/CHANGELOG.md b/eng/common/CHANGELOG.md new file mode 100644 index 0000000000000..1fb3e6ac1e8ee --- /dev/null +++ b/eng/common/CHANGELOG.md @@ -0,0 +1,7 @@ +# Common engineering release history + +## Unreleased + +### Bugs Fixed + +- Release-plan completion uses the job's `AutoReleaseSdkPullRequestUrl` when no explicit `SdkPullRequest` is supplied. An absent or empty variable is initialized to an empty string at runtime before macro expansion, so manual runs do not pass an unresolved variable. Empty initialization is logged. Existing runtime values and explicit parameters are preserved. diff --git a/eng/common/pipelines/templates/steps/mark-release-completion.yml b/eng/common/pipelines/templates/steps/mark-release-completion.yml index 7f6e1c5f2a424..1bb3f01c37be9 100644 --- a/eng/common/pipelines/templates/steps/mark-release-completion.yml +++ b/eng/common/pipelines/templates/steps/mark-release-completion.yml @@ -10,6 +10,15 @@ steps: parameters: SourceRootPath: ${{ parameters.SourceRootPath }} + # Runtime output variables must not be tested at template-expansion time. + # Initialize the optional macro before use on manual runs that have no SDK PR. + - ${{ if eq(parameters.SdkPullRequest, '') }}: + - pwsh: | + Write-Host '##vso[task.setvariable variable=AutoReleaseSdkPullRequestUrl]' + Write-Host 'AutoReleaseSdkPullRequestUrl is set to an empty string.' + displayName: Initialize optional auto-release SDK PR + condition: and(succeeded(), ne(variables['Skip.MarkReleaseCompletion'], 'true'), eq(variables['AutoReleaseSdkPullRequestUrl'], '')) + - task: AzureCLI@2 inputs: azureSubscription: opensource-api-connection @@ -19,7 +28,7 @@ steps: arguments: > -PackageInfoFilePath '${{ parameters.ConfigFileDir }}/${{ parameters.PackageArtifactName }}.json' -AzsdkExePath '$(AZSDK)' -ReleasePlanId '${{ parameters.ReleasePlanId }}' - -SdkPullRequest '${{ parameters.SdkPullRequest }}' + -SdkPullRequest '${{ coalesce(parameters.SdkPullRequest, '$(AutoReleaseSdkPullRequestUrl)') }}' -PipelineUrl "$(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId)" workingDirectory: $(Pipeline.Workspace) displayName: Mark package as released