Skip to content

Commit

Permalink
Taking the parameters literally (#22047)
Browse files Browse the repository at this point in the history
  • Loading branch information
sima-zhu authored Dec 8, 2021
1 parent dece4d7 commit a6a85f0
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ $PackageExclusions = @{
'azure-mgmt-network' = 'Manual process used to build';
}

function Update-python-DocsMsPackages($DocsRepoLocation, $DocsMetadata) {
function Update-python-DocsMsPackages($DocsRepoLocation, $DocsMetadata, $PackageSourceOverride, $DocValidationImageId) {
Write-Host "Excluded packages:"
foreach ($excludedPackage in $PackageExclusions.Keys) {
Write-Host " $excludedPackage - $($PackageExclusions[$excludedPackage])"
Expand All @@ -299,15 +299,19 @@ function Update-python-DocsMsPackages($DocsRepoLocation, $DocsMetadata) {
UpdateDocsMsPackages `
(Join-Path $DocsRepoLocation 'ci-configs/packages-preview.json') `
'preview' `
$FilteredMetadata
$FilteredMetadata `
$PackageSourceOverride `
$DocValidationImageId

UpdateDocsMsPackages `
(Join-Path $DocsRepoLocation 'ci-configs/packages-latest.json') `
'latest' `
$FilteredMetadata
$FilteredMetadata `
$PackageSourceOverride `
$DocValidationImageId
}

function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) {
function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata, $PackageSourceOverride, $DocValidationImageId) {
Write-Host "Updating configuration: $DocConfigFile with mode: $Mode"
$packageConfig = Get-Content $DocConfigFile -Raw | ConvertFrom-Json

Expand Down Expand Up @@ -370,7 +374,7 @@ function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) {
# If upgrading the package, run basic sanity checks against the package
if ($package.package_info.version -ne $packageVersion) {
Write-Host "New version detected for $packageName ($packageVersion)"
if (!(ValidatePackage -packageName $packageName -packageVersion $packageVersion)) {
if (!(ValidatePackage -packageName $packageName -packageVersion $packageVersion -PackageSourceOverride $PackageSourceOverride -DocValidationImageId $DocValidationImageId)) {
LogWarning "Package is not valid: $packageName. Keeping old version."
$outputPackages += $package
continue
Expand Down Expand Up @@ -425,7 +429,7 @@ function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) {
if ($Mode -eq 'preview') {
$packageVersion = "==$($package.VersionPreview)"
}
if (!(ValidatePackage -packageName $packageName -packageVersion $packageVersion)) {
if (!(ValidatePackage -packageName $packageName -packageVersion $packageVersion -PackageSourceOverride $PackageSourceOverride -DocValidationImageId $DocValidationImageId)) {
LogWarning "Package is not valid: $packageName. Cannot onboard."
continue
}
Expand Down

0 comments on commit a6a85f0

Please sign in to comment.