Skip to content

Commit

Permalink
Add warning message to old unused package (#2064)
Browse files Browse the repository at this point in the history
The original way of reading *.json under `PackageInfo` is not working at the case which artifact is under ci.yml but old mgmt which is not used anymore.
The PR is to skip the old unused package and throw warning message.

The test pipeline:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=1127833&view=results
  • Loading branch information
sima-zhu authored Oct 6, 2021
1 parent d7b1bf4 commit e8a895e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ steps:
DefaultBranchVariableName: TargetBranchName

- pwsh: |
$packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"')
$packageInfoJson = '${{ convertToJson(parameters.PackageInfoLocations) }}'.Trim('"').Replace("\\", "/")
$packageInfoLocations = ConvertFrom-Json $packageInfoJson
${{ parameters.ScriptDirectory }}/Update-DocsMsMetadata.ps1 `
-PackageInfoJsonLocations $packageInfoLocations `
Expand Down
7 changes: 6 additions & 1 deletion eng/common/scripts/Update-DocsMsMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function GetAdjustedReadmeContent($ReadmeContent, $PackageInfo, $PackageMetadata

# Generate the release tag for use in link substitution
$tag = "$($PackageInfo.Name)_$($PackageInfo.Version)"
Write-Host "The tag of package: $tag"
$date = Get-Date -Format "MM/dd/yyyy"


Expand Down Expand Up @@ -97,9 +98,13 @@ ms.service: $service
}

function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
if (!(Test-Path $packageInfoJsonLocation)) {
LogWarning "Package metadata not found for $packageInfoJsonLocation"
return
}

$packageInfoJson = Get-Content $packageInfoJsonLocation -Raw
$packageInfo = ConvertFrom-Json $packageInfoJson

$originalVersion = [AzureEngSemanticVersion]::ParseVersionString($packageInfo.Version)
if ($packageInfo.DevVersion) {
# If the package is of a dev version there may be language-specific needs to
Expand Down

0 comments on commit e8a895e

Please sign in to comment.