Updated validate pkg template to use packageInfo#12478
Conversation
There was a problem hiding this comment.
Pull Request Overview
Updates the package validation pipeline template and scripts to support Java v2 library requirements by adding a new PackageInfoFiles parameter. This allows the system to differentiate packages with the same artifactId by using groupId and artifactId from packageInfo.
- Added
PackageInfoFilesparameter to both pipeline template and PowerShell scripts for direct package info file processing - Refactored parameter handling to prioritize
ArtifactsthenPackageInfoFilesfor backward compatibility - Consolidated validation functions from
Validate-Package.ps1intoValidate-All-Packages.ps1and moved DevOps work item functions to shared helpers
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| eng/common/scripts/Validate-All-Packages.ps1 | Major refactor consolidating validation logic, adding PackageInfoFiles support, and implementing Java groupId:artifactId handling |
| eng/common/scripts/Prepare-Release.ps1 | Updated to use consolidated DevOps helper function instead of separate script |
| eng/common/scripts/Helpers/DevOps-WorkItem-Helpers.ps1 | Added consolidated functions for DevOps operations and authentication checks |
| eng/common/pipelines/templates/steps/validate-all-packages.yml | Added PackageInfoFiles parameter with proper YAML structure |
| exit 1 | ||
| } | ||
|
|
||
| &$EngCommonScriptsDir/Update-DevOps-Release-WorkItem.ps1 ` |
There was a problem hiding this comment.
I assume we should also update this script to use the newly created function.
There was a problem hiding this comment.
There're only two places calling this script. One is the validate-package.ps1 and the other is the prepare-release.ps1. Both of them have been updated in this PR.
This script will be deleted as part of the clean-up task.
There was a problem hiding this comment.
I think I'm OK with deleting that script but please do update the docs at https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/444/Marking-a-Package-as-In-Release what references it. I don't expect anyone is using it.
|
|
||
| # If there's a groupId that means this is Java and pkgName = GroupId+ArtifactName | ||
| # but the VerifyAPIReview requires GroupId:ArtifactName | ||
| if ($packageInfo.PSObject.Members.Name -contains "Group") { |
There was a problem hiding this comment.
Is this the core of the changes? The rest seem mostly like refactoring, which is fine but I want to understand what we are actually changing.
There was a problem hiding this comment.
Line#32 to line#165 were copied from the original validate-package.ps1, which will be deleted as part of the clean-up task.
Main changes include:
ProcessPackage function was updated to take packageInfo parameter. When parameters.ArtifactList is provided for current usage, code was added(line#265) to parse them and create packageInfo, and then it will be passed into ProcessPackage function.
The following snippet is the original code, which means VerifyAPIReview already consumes the full name including groupId for Java package name.
# API review and package name validation
$fulPackageName = $pkgName
$groupId = $null
if ($pkgInfo.PSObject.Members.Name -contains "Group") {
$groupId = $pkgInfo.Group
}
if ($groupId){
$fulPackageName = "${groupId}:${pkgName}"
}
@praveenkuttappan do you know if Java uses groupId:artifactId as identifier in APIReview service? It seems to be the case from the apiview, e.g. https://spa.apiview.dev/review/c12fd0a7ffe74c2c8349a181345bffff?activeApiRevisionId=fe96d87ce3f84e48b7b42bc99b8082cd
|
/azp run azure-sdk-tools - sync - eng-common |
|
Azure Pipelines successfully started running 1 pipeline(s). |
7903402 to
81699a8
Compare
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12478 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: ray chen <raychen@microsoft.com>
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12478 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: ray chen <raychen@microsoft.com>
The change is to support Java v2 library which needs to get
groupIdandartifactIdfrompackageInfoto differenciate sameartifactId.Refer to #10229 for details.
Added a new
PackageInfoFilesparameter to both the pipeline template and the PowerShell scriptRefactored parameter handling in
Validate-All-Packages.ps1to prioritizeArtifacts, thenPackageInfoFiles, ensuring backward compatibility with previous usages while supporting the new method.Refactored the
ProcessPackagefunction to work with package info objectsMoved functions in the
Validate-Package.ps1toValidate-All-Packages.ps1and the former script will be deleted in separate PRDeprecated
Update-DevOps-Release-WorkItem.ps1and consolidated the code into theDevOps-WorkItem-Helpers.ps1