Skip to content

Commit 8232d40

Browse files
Update common tool to support go
1 parent 25226b7 commit 8232d40

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

Diff for: eng/common/scripts/Detect-Api-Changes.ps1

+8-7
Original file line numberDiff line numberDiff line change
@@ -109,32 +109,33 @@ $packageProperties = Get-ChildItem -Recurse -Force "$configFileDir" `
109109
foreach ($packagePropFile in $packageProperties)
110110
{
111111
$packageMetadata = Get-Content $packagePropFile | ConvertFrom-Json
112-
Write-Host "Processing $($packageMetadata.ArtifactName)"
112+
$artifactOrModuleName = $packageMetadata.ArtifactName ?? $packageMetadata.ModuleName
113+
Write-Host "Processing $($artifactOrModuleName)"
113114

114-
$packages = &$FindArtifactForApiReviewFn $ArtifactPath $packageMetadata.ArtifactName
115+
$packages = &$FindArtifactForApiReviewFn $ArtifactPath $artifactOrModuleName
115116

116117
if ($packages)
117118
{
118119
$pkgPath = $packages.Values[0]
119-
$isRequired = Should-Process-Package -pkgPath $pkgPath -packageName $($packageMetadata.ArtifactName)
120+
$isRequired = Should-Process-Package -pkgPath $pkgPath -packageName $($artifactOrModuleName)
120121
Write-Host "Is API change detect required for $($packages.ArtifactName):$($isRequired)"
121122
if ($isRequired -eq $True)
122123
{
123124
$filePath = $pkgPath.Replace($ArtifactPath , "").Replace("\", "/")
124-
$respCode = Submit-Request -filePath $filePath -packageName $($packageMetadata.ArtifactName)
125+
$respCode = Submit-Request -filePath $filePath -packageName $($artifactOrModuleName)
125126
if ($respCode -ne '200')
126127
{
127-
$responses[$($packageMetadata.ArtifactName)] = $respCode
128+
$responses[$($artifactOrModuleName)] = $respCode
128129
}
129130
}
130131
else
131132
{
132-
Write-Host "Pull request does not have any change for $($packageMetadata.ArtifactName)). Skipping API change detect."
133+
Write-Host "Pull request does not have any change for $($artifactOrModuleName)). Skipping API change detect."
133134
}
134135
}
135136
else
136137
{
137-
Write-Host "No package is found in artifact path to find API changes for $($packageMetadata.ArtifactName)"
138+
Write-Host "No package is found in artifact path to find API changes for $($artifactOrModuleName)"
138139
}
139140
}
140141

Diff for: eng/common/scripts/Package-Properties.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class PackageProps {
1313
[string]$SdkType
1414
[boolean]$IsNewSdk
1515
[string]$ArtifactName
16+
[string]$ModuleName
1617
[string]$ReleaseStatus
1718
# was this package purely included because other packages included it as an AdditionalValidationPackage?
1819
[boolean]$IncludedForValidation

Diff for: eng/common/scripts/Save-Package-Properties.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ foreach ($pkg in $allPackageProperties)
141141
Write-Host "Package Version: $($pkg.Version)"
142142
Write-Host "Package SDK Type: $($pkg.SdkType)"
143143
Write-Host "Artifact Name: $($pkg.ArtifactName)"
144+
Write-Host "Module Name: $($pkg.ModuleName)"
144145
Write-Host "Release date: $($pkg.ReleaseStatus)"
145146
$configFilePrefix = $pkg.Name
146147

0 commit comments

Comments
 (0)