Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions eng/common/scripts/Detect-Api-Changes.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ Param (
$configFileDir = Join-Path -Path $ArtifactPath "PackageInfo"

# Submit API review request and return status whether current revision is approved or pending or failed to create review
function Submit-Request($filePath, $packageName, $packageType)
function Submit-Request($filePath, $packageName, $packageType, $group)
{
# Construct full package name with groupId if available
$fullPackageName = $packageName
if ($group) {
$fullPackageName = "${group}:$packageName"
}
$repoName = $RepoFullName
if (!$repoName) {
$repoName = "azure/azure-sdk-for-$LanguageShort"
Expand All @@ -36,7 +41,7 @@ function Submit-Request($filePath, $packageName, $packageType)
$query.Add('commitSha', $CommitSha)
$query.Add('repoName', $repoName)
$query.Add('pullRequestNumber', $PullRequestNumber)
$query.Add('packageName', $packageName)
$query.Add('packageName', $fullPackageName)
$query.Add('language', $LanguageShort)
$query.Add('project', $DevopsProject)
$query.Add('packageType', $packageType)
Expand Down Expand Up @@ -75,7 +80,7 @@ function Submit-Request($filePath, $packageName, $packageType)
catch
{
Write-Host "ERROR: API request failed" -ForegroundColor Red
Write-Host "Status Code: $($_.Exception.Response.StatusCode.Value__)" -ForegroundColor Yellow
Write-Host "Status Code: $($_.Exception.Response.StatusCode.Value__)" -ForegroundColor Yellow
Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Yellow
if ($_.ErrorDetails.Message) {
Write-Host "Details: $($_.ErrorDetails.Message)" -ForegroundColor Yellow
Expand Down Expand Up @@ -165,7 +170,7 @@ foreach ($packageInfoFile in $packageInfoFiles)
if ($isRequired -eq $True)
{
$filePath = $pkgPath.Replace($ArtifactPath , "").Replace("\", "/")
$respCode = Submit-Request -filePath $filePath -packageName $pkgArtifactName -packageType $packageType
$respCode = Submit-Request -filePath $filePath -packageName $pkgArtifactName -packageType $packageType -group $packageInfo.Group
if ($respCode -ne '200')
{
$responses[$pkgArtifactName] = $respCode
Expand Down
36 changes: 26 additions & 10 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -484,8 +484,17 @@ function Get-java-GithubIoDocIndex()
}

# function is used to filter packages to submit to API view tool
function Find-java-Artifacts-For-Apireview($artifactDir, $pkgName)
# Function pointer name: FindArtifactForApiReviewFn
function Find-java-Artifacts-For-Apireview($artifactDir, $packageInfo)
{
# Check if packageInfo is null first
if (!$packageInfo) {
Write-Host "Package info is null, skipping API review artifact search"
return $null
}

$pkgName = $packageInfo.ArtifactName ?? $packageInfo.Name

# skip spark packages
if ($pkgName.Contains("-spark")) {
return $null
Expand All @@ -495,15 +504,21 @@ function Find-java-Artifacts-For-Apireview($artifactDir, $pkgName)
return $null
}

# Find all source jar files in given artifact directory
# Filter for package in "com.azure*" groupId.
$artifactPath = Join-Path $artifactDir "com.azure*" $pkgName
Write-Host "Checking for source jar in artifact path $($artifactPath)"
$files = @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
# And filter for packages in "io.clientcore*" groupId.
# (Is there a way to pass more information here to know the explicit groupId?)
$artifactPath = Join-Path $artifactDir "io.clientcore*" $pkgName
$files += @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
if ($packageInfo) {
$artifactPath = Join-Path $artifactDir $packageInfo.Group $pkgName
$files = @(Get-ChildItem "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
} else {
# Find all source jar files in given artifact directory
# Filter for package in "com.azure*" groupId.
$artifactPath = Join-Path $artifactDir "com.azure*" $pkgName
Write-Host "Checking for source jar in artifact path $($artifactPath)"
$files = @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
# And filter for packages in "io.clientcore*" groupId.
# (Is there a way to pass more information here to know the explicit groupId?)
$artifactPath = Join-Path $artifactDir "io.clientcore*" $pkgName
$files += @(Get-ChildItem -Recurse "${artifactPath}" | Where-Object -FilterScript {$_.Name.EndsWith("sources.jar")})
}

if (!$files)
{
Write-Host "$($artifactPath) does not have any package"
Expand Down Expand Up @@ -643,6 +658,7 @@ function Update-java-GeneratedSdks([string]$PackageDirectoriesFile) {
}
}

# Function pointer: IsApiviewStatusCheckRequiredFn
function Get-java-ApiviewStatusCheckRequirement($packageInfo) {
if ($packageInfo.IsNewSdk -and ($packageInfo.SdkType -eq "client" -or $packageInfo.SdkType -eq "spring")) {
return $true
Expand Down
2 changes: 1 addition & 1 deletion sdk/template/azure-sdk-template/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Azure Template client library for Java
# Azure Template client library for Java V2

Use the guidelines in each section of this template to ensure consistency and readability of your README.
The README resides in your package's GitHub repository at the root of its directory within the repo.
Expand Down
Loading