Repository navigation
Add Java release API hashes from staged sources - #51391
Weidong Xu (weidongxu-microsoft) wants to merge 4 commits into
Conversation
Reuse the ARH executable for release PackageInfo ApiHash metadata, including source-built patch packages. Preserve metadata through existing signed-artifact transfers without adding approval or publication gates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d47c40e0-dce3-4856-b258-f62b42922e1b
|
Add |
|
Azure Pipelines: Successfully started running 2 pipeline(s). 33 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Note
Copilot was unable to run its full agentic suite in this review.
Copilot review overview
3 open issues
What changed in this PR
Adds automation to compute and persist Java API review hashes into staged PackageInfo metadata, and ensures tooling can be staged from sparse checkouts.
Changes:
- Introduces
Save-Package-ApiHash-Property.ps1(and Pester tests) to computeApiHashfrom staged*-sources.jarwithout rebuilding packages. - Updates
Stage-ApiReviewTools.ps1to optionally expand sparse checkouts to include required tooling sources. - Integrates API-hash saving into CI/release pipelines via a reusable pipeline step template.
| File | Description |
|---|---|
| sdk/tools/api-review-maven-plugin/README.md | Documents how SDK pipelines use the tool to persist ApiHash into PackageInfo. |
| eng/scripts/tests/Save-Package-ApiHash-Property.tests.ps1 | Adds test coverage for saving/skipping/rejecting API hashes and preserving PackageInfo fields. |
| eng/scripts/tests/ApiReviewHub.tests.ps1 | Adds coverage for sparse-checkout expansion behavior and -WhatIf behavior. |
| eng/scripts/Stage-ApiReviewTools.ps1 | Adds -ExpandSparseCheckout option and git sparse-checkout mutation logic. |
| eng/scripts/Save-Package-ApiHash-Property.ps1 | New script that runs the tooling against staged sources JARs and writes ApiHash into PackageInfo. |
| eng/pipelines/templates/steps/save-package-api-hash.yml | New pipeline step template to build tooling + save hashes (Java 17 + PowerShell scripts). |
| eng/pipelines/templates/stages/archetype-sdk-client-patch.yml | Wires the new step template into the patch archetype stage. |
| eng/pipelines/templates/jobs/ci.yml | Wires the new step template into CI job flow. |
Review effort: Lite
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d47c40e0-dce3-4856-b258-f62b42922e1b
There was a problem hiding this comment.
🔵 Needs a closer look
Human verification is needed because normal CI and end-to-end signing and artifact-transfer checks remain pending, leaving published PackageInfo ApiHash retention unverified across shared normal and patch release pipelines.
3 open issues
Review effort: Balanced
|
The task-scoped JDK selection follows existing repository practice: build-and-test.yml sets Hashing uses This retains the repository’s existing preinstalled-JDK assumption, not a guarantee for future images. An image without JDK 17 would require corresponding provisioning or configuration changes. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d47c40e0-dce3-4856-b258-f62b42922e1b
There was a problem hiding this comment.
🔵 Needs a closer look
Hash generation now affects every staged binary package, but CI, published PackageInfo verification, and real signing remain unverified, requiring human validation of end-to-end signed artifact metadata.
No open issues 🎉
3 resolved since last review
Review effort: Balanced
| -Artifacts ('$(ArtifactsJsonEscaped)' | ConvertFrom-Json | Where-Object -Not skipPublishPackage) | ||
| -InformationAction Continue | ||
|
|
||
| - template: /eng/pipelines/templates/steps/save-package-api-hash.yml |
There was a problem hiding this comment.
This follows the existing APIView lifecycle: the patch pipeline calls APIView after publication to mark packages as shipped. We generate ApiHash here so the metadata is ready when that call is replaced by ARH's mark-released operation. This prepares the planned migration without adding an ARH call or a new release gate today.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d47c40e0-dce3-4856-b258-f62b42922e1b

Changes
Calculate PackageInfo
ApiHashlocally from staged sources JARs using ARH's generator. Cover shared PR/service builds and the separate source-built patch pipeline; preserve existing package metadata through artifact transfers.No ARH submissions, approval gates, review labels, or release-policy changes. Patch hashing prepares migration of its existing post-release APIView call, not a new approval check.
Validation
UnitTestfilter.These completed CI runs precede the warning-only update in
e0c4038; CI for that commit is pending.Multi-origin coverage: data-plane
azure-compute-batch, control-planeazure-resourcemanager-compute, coreazure-core, JSONazure-json, and toolingapi-review-maven-plugin. Tooling built once (~38 seconds); hashing all five took ~26 seconds.Considerations
ApiHash. Verified with actual localazure-sdk-bom1.3.10 build output; its dedicated BOM pipeline is unchanged.azure-openrewrite-compiler-maven-pluginbuild produced a binary without sources, but it is not a release artifact and has no releasable PackageInfo, so it is not a hash candidate.JAVA_HOME_17_X64, scoped to hash-tool tasks; does not change other SDK/test tasks' Java selection.Live patch/signing flows and full-repository scale have not been validated. The disposable multi-origin test PR was closed without merging.