Skip to content

Commit 360e300

Browse files
azure-sdkraych1
andauthored
Sync eng/common directory with azure-sdk-tools for PR 13009 (Azure#3369)
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#13009 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: ray chen <[email protected]>
1 parent 1bef1b5 commit 360e300

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

eng/common/pipelines/templates/steps/create-apireview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ steps:
4141
inputs:
4242
filePath: ${{ parameters.SourceRootPath }}/eng/common/scripts/Create-APIReview.ps1
4343
arguments: >
44-
-PackageInfoFiles ('${{ convertToJson(parameters.PackageInfoFiles) }}' | ConvertFrom-Json -NoEnumerate)
44+
-PackageInfoFiles @('${{ join(''',''', parameters.PackageInfoFiles) }}')
4545
-ArtifactList ('${{ convertToJson(parameters.Artifacts) }}' | ConvertFrom-Json | Select-Object Name)
4646
-ArtifactPath '${{parameters.ArtifactPath}}'
4747
-ArtifactName ${{ parameters.ArtifactName }}

eng/common/pipelines/templates/steps/validate-all-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ steps:
3434
-BuildDefinition $(System.CollectionUri)$(System.TeamProject)/_build?definitionId=$(System.DefinitionId) `
3535
-PipelineUrl $(System.CollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId) `
3636
-IsReleaseBuild $$(SetAsReleaseBuild) `
37-
-PackageInfoFiles ('${{ convertToJson(parameters.PackageInfoFiles) }}' | ConvertFrom-Json -NoEnumerate)
37+
-PackageInfoFiles @('${{ join(''',''', parameters.PackageInfoFiles) }}')
3838
workingDirectory: $(Pipeline.Workspace)
3939
displayName: Validate packages and update work items
4040
continueOnError: true

eng/common/scripts/Create-APIReview.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ elseif ($ArtifactList -and $ArtifactList.Count -gt 0) {
373373
elseif ($PackageInfoFiles -and $PackageInfoFiles.Count -gt 0) {
374374
# Lowest Priority: Direct PackageInfoFiles (new method)
375375
Write-Host "Using PackageInfoFiles parameter with $($PackageInfoFiles.Count) files"
376-
$ProcessedPackageInfoFiles = $PackageInfoFiles # Use as-is
376+
# Filter out empty strings or whitespace-only entries
377+
$ProcessedPackageInfoFiles = $PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
377378
}
378379
else {
379380
Write-Error "No package information provided. Please provide either 'PackageName', 'ArtifactList', or 'PackageInfoFiles' parameters."
@@ -382,7 +383,7 @@ else {
382383

383384
# Validate that we have package info files to process
384385
if (-not $ProcessedPackageInfoFiles -or $ProcessedPackageInfoFiles.Count -eq 0) {
385-
Write-Error "No package info files found after processing parameters."
386+
Write-Error "No package info files found after processing parameters. Or PackageInfoFiles parameter contains only empty or whitespace entries, please check the artifact settings."
386387
exit 1
387388
}
388389

eng/common/scripts/Validate-All-Packages.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,13 @@ elseif ($PackageInfoFiles -and $PackageInfoFiles.Count -gt 0)
282282
{
283283
# Direct PackageInfoFiles (new method)
284284
Write-Host "Using PackageInfoFiles parameter with $($PackageInfoFiles.Count) files"
285-
$ProcessedPackageInfoFiles = $PackageInfoFiles
285+
# Filter out empty strings or whitespace-only entries
286+
$ProcessedPackageInfoFiles = $PackageInfoFiles | Where-Object { -not [string]::IsNullOrWhiteSpace($_) }
286287
}
287288

288289
# Validate that we have package info files to process
289290
if (-not $ProcessedPackageInfoFiles -or $ProcessedPackageInfoFiles.Count -eq 0) {
290-
Write-Error "No package info files found after processing parameters."
291+
Write-Error "No package info files found after processing parameters. Or PackageInfoFiles parameter contains only empty or whitespace entries, please check the artifact settings."
291292
exit 1
292293
}
293294

0 commit comments

Comments
 (0)