Only update deprecation status once a week on Sunday (#5913)

This commit is contained in:
Wes Haggard 2023-04-11 09:10:15 -07:00 коммит произвёл GitHub
Родитель 67e027f00a
Коммит 3bc2988500
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -10,6 +10,11 @@ resources:
endpoint: azure
ref: refs/tags/azure-sdk-tools_20220404.3
parameters:
- name: UpdateDeprecated
type: boolean
default: false
variables:
AzureSDKClonePath: $(System.DefaultWorkingDirectory)/azure-sdk
AzureSDKReleaseNotesClonePath: $(System.DefaultWorkingDirectory)/azure-sdk-notes
@ -27,6 +32,7 @@ steps:
arguments: >
-github_pat '$(azuresdk-github-pat)'
-nuget_pat '$(azure-sdk-nuget-pat)'
-updateDeprecated $${{ parameters.UpdateDeprecated }} -or ((Get-Date).DayOfWeek -eq "Sunday")
- task: PowerShell@2
displayName: Update packages from sdk release data

Просмотреть файл

@ -2,7 +2,8 @@
param (
[string] $language = "all",
[string] $github_pat = $env:GITHUB_PAT,
[string] $nuget_pat = $env:NUGET_PAT
[string] $nuget_pat = $env:NUGET_PAT,
[boolean] $updateDeprecated = $false
)
Set-StrictMode -Version 3
@ -314,12 +315,10 @@ function Write-Latest-Versions($lang)
}
# Keep package managers up to date with package deprecations
# TODO: Commenting out till we can figure out how to run this
# function on an infrequent basis so it doesn't slow things down.
#if($lang -eq 'dotnet')
#{
# Write-Nuget-Deprecated-Packages($packageList)
#}
if($updateDeprecated -eq $true -and $lang -eq 'dotnet')
{
Write-Nuget-Deprecated-Packages($packageList)
}
# Clean out packages that are no longer in the query we use for the package manager
foreach ($existingPkg in $packageList)
@ -492,7 +491,7 @@ function Write-Nuget-Deprecated-Packages($packageList)
Start-Sleep -Seconds 60
}
}
}
}
}
switch($language)