Skip to content

Commit ac58155

Browse files
raych1azure-sdk
authored andcommitted
Used the original BuildHashKey to return hash from non-null args
1 parent 83e97d1 commit ac58155

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,14 @@ function Invoke-Query($fields, $wiql, $output = $true)
139139
return $workItems
140140
}
141141

142-
function BuildHashKeyFromNonNullArgs()
142+
function BuildHashKeyNoNull()
143143
{
144144
$filterNulls = $args | Where-Object { $_ }
145-
# if we had any non-nulls then return it
146-
if (!$filterNulls) {
145+
# if we had any nulls then return null
146+
if (!$filterNulls -or $args.Count -ne $filterNulls.Count) {
147147
return $null
148148
}
149-
return BuildHashKey @filterNulls
149+
return BuildHashKey $args
150150
}
151151

152152
function BuildHashKey()
@@ -241,7 +241,7 @@ function FindLatestPackageWorkItem($lang, $packageName, $groupId = $null, $outpu
241241

242242
function FindPackageWorkItem($lang, $packageName, $version, $groupId = $null, $outputCommand = $true, $includeClosed = $false, $ignoreReleasePlannerTests = $true, $tag = $null)
243243
{
244-
$key = BuildHashKeyFromNonNullArgs $lang $packageName $version $groupId
244+
$key = BuildHashKey $lang $packageName $version $groupId
245245
if ($key -and $packageWorkItems.ContainsKey($key)) {
246246
return $packageWorkItems[$key]
247247
}
@@ -300,7 +300,7 @@ function FindPackageWorkItem($lang, $packageName, $version, $groupId = $null, $o
300300

301301
foreach ($wi in $workItems)
302302
{
303-
$localKey = BuildHashKeyFromNonNullArgs $wi.fields["Custom.Language"] $wi.fields["Custom.Package"] $wi.fields["Custom.PackageVersionMajorMinor"] $wi.fields["Custom.GroupId"]
303+
$localKey = BuildHashKey $wi.fields["Custom.Language"] $wi.fields["Custom.Package"] $wi.fields["Custom.PackageVersionMajorMinor"] $wi.fields["Custom.GroupId"]
304304
if (!$localKey) {
305305
$packageWorkItemWithoutKeyFields[$wi.id] = $wi
306306
Write-Host "Skipping package [$($wi.id)]$($wi.fields['System.Title']) which is missing required fields language, package, or version."

0 commit comments

Comments
 (0)