Skip to content

Commit

Permalink
Skip creating automatic API review for ci disabled packages
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenkuttappan committed Mar 28, 2024
1 parent 66b1e7d commit 3a4155f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ function Find-python-Artifacts-For-Apireview($artifactDir, $artifactName)
return $null
}

$whlDirectory = (Join-Path -Path $artifactDir -ChildPath $artifactName.Replace("_","-"))
$packageName = $artifactName.Replace("_","-")
$whlDirectory = (Join-Path -Path $artifactDir -ChildPath $packageName)

Write-Host "Searching for $($artifactName) wheel in artifact path $($whlDirectory)"
$files = @(Get-ChildItem $whlDirectory | ? {$_.Name.EndsWith(".whl")})
Expand All @@ -539,6 +540,19 @@ function Find-python-Artifacts-For-Apireview($artifactDir, $artifactName)
return $null
}

# Python requires pregenerated token file in addition to wheel to generate API review.
# Make sure that token file exists in same path as wheel file.
$tokenFile = Join-Path -Path $whlDirectory -ChildPath "${packageName}_Python.json"
if (!(Test-Path $tokenFile))
{
Write-Host "API review token file for $($artifactName) does not exist in path $($whlDirectory). Skipping API review for $packageName"
return $null
}
else
{
Write-Host "Found API review token file for $($tokenFile)"
}

$packages = @{
$files[0].Name = $files[0].FullName
}
Expand Down

0 comments on commit 3a4155f

Please sign in to comment.