From 48f3a38d2e1f9e88dc15acac09726ff4fb121bd4 Mon Sep 17 00:00:00 2001 From: ray chen Date: Fri, 21 Nov 2025 23:13:03 +0000 Subject: [PATCH 1/5] Used full pkg name including groupId when create api view --- eng/common/scripts/Detect-Api-Changes.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 5c261de37171..fe0d89d37dec 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -75,7 +75,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 @@ -133,6 +133,11 @@ foreach ($packageInfoFile in $packageInfoFiles) { $packageInfo = Get-Content $packageInfoFile | ConvertFrom-Json $pkgArtifactName = $packageInfo.ArtifactName ?? $packageInfo.Name + + # Construct full package name with groupId if available + if ($packageInfo.Group) { + $pkgArtifactName = "$($packageInfo.Group):${pkgArtifactName}" + } $packageType = $packageInfo.SdkType LogInfo "Processing $($pkgArtifactName)" From d5a1cc2b6f103d3785a33311ca9283333ddeb359 Mon Sep 17 00:00:00 2001 From: ray chen Date: Fri, 21 Nov 2025 23:14:28 +0000 Subject: [PATCH 2/5] test template --- sdk/template/azure-sdk-template/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/template/azure-sdk-template/README.md b/sdk/template/azure-sdk-template/README.md index f1ce51214803..ea5d246550ac 100644 --- a/sdk/template/azure-sdk-template/README.md +++ b/sdk/template/azure-sdk-template/README.md @@ -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. From 383546d96113f9cb19e0c30f2826be3539356449 Mon Sep 17 00:00:00 2001 From: ray chen Date: Fri, 21 Nov 2025 23:27:31 +0000 Subject: [PATCH 3/5] Used package info to search for the api view artifact --- eng/scripts/Language-Settings.ps1 | 36 ++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index 4068c4719be4..9429ca370f98 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -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 @@ -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" @@ -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 From 5b381747fb45c5bd1bb9107eab90cca301b7f04d Mon Sep 17 00:00:00 2001 From: ray chen Date: Sat, 22 Nov 2025 00:12:47 +0000 Subject: [PATCH 4/5] Passed full pkg name to api view request only --- eng/common/scripts/Detect-Api-Changes.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index fe0d89d37dec..3962adfa66d1 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -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" @@ -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) @@ -133,11 +138,6 @@ foreach ($packageInfoFile in $packageInfoFiles) { $packageInfo = Get-Content $packageInfoFile | ConvertFrom-Json $pkgArtifactName = $packageInfo.ArtifactName ?? $packageInfo.Name - - # Construct full package name with groupId if available - if ($packageInfo.Group) { - $pkgArtifactName = "$($packageInfo.Group):${pkgArtifactName}" - } $packageType = $packageInfo.SdkType LogInfo "Processing $($pkgArtifactName)" @@ -170,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 From ead1ef95fbb64c1a085323098a72408de5af2eb5 Mon Sep 17 00:00:00 2001 From: ray chen Date: Tue, 25 Nov 2025 00:02:59 +0000 Subject: [PATCH 5/5] Used packageinfo in the submit-request function --- eng/common/scripts/Detect-Api-Changes.ps1 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/eng/common/scripts/Detect-Api-Changes.ps1 b/eng/common/scripts/Detect-Api-Changes.ps1 index 3962adfa66d1..e329935f5edb 100644 --- a/eng/common/scripts/Detect-Api-Changes.ps1 +++ b/eng/common/scripts/Detect-Api-Changes.ps1 @@ -22,12 +22,15 @@ 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, $group) +function Submit-Request($filePath, $packageInfo) { + $packageName = $packageInfo.ArtifactName ?? $packageInfo.Name + $packageType = $packageInfo.SdkType + # Construct full package name with groupId if available $fullPackageName = $packageName - if ($group) { - $fullPackageName = "${group}:$packageName" + if ($packageInfo.PSObject.Members.Name -contains "Group" -and $packageInfo.Group) { + $fullPackageName = "$($packageInfo.Group):$packageName" } $repoName = $RepoFullName if (!$repoName) { @@ -170,7 +173,7 @@ foreach ($packageInfoFile in $packageInfoFiles) if ($isRequired -eq $True) { $filePath = $pkgPath.Replace($ArtifactPath , "").Replace("\", "/") - $respCode = Submit-Request -filePath $filePath -packageName $pkgArtifactName -packageType $packageType -group $packageInfo.Group + $respCode = Submit-Request -filePath $filePath -packageInfo $packageInfo if ($respCode -ne '200') { $responses[$pkgArtifactName] = $respCode