Manual release builds do not hard-gate on APIView approval
bugneeds-triage
## Problem
A manual storage release build published packages even though APIView approval was pending for `com.azure:azure-storage-internal-avro` version `12.19.0`.
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6301632&view=results
The `Validate packages and update work items` step detected the pending APIView status, but it did not fail the build because `IsReleaseBuild` was `False`. For a manually queued release run, this appears wrong: the pipeline should automatically set `SetAsReleaseBuild=true` or otherwise hard-gate release publishing on APIView approval.
## Impact
Manual release runs can continue through Signing/Release and publish packages even when the package validation step has already found pending APIView approval for a GA package.
## Evidence from the storage pipeline logs
The validation step was run with `IsReleaseBuild: False`:
```text
2026-05-14T23:34:28.1546181Z Artifact path: /mnt/vss/_work/1/a
2026-05-14T23:34:28.1549237Z Package Info Files: /mnt/vss/_work/1/a/PackageInfo/azure-storage-common.json, ... /mnt/vss/_work/1/a/PackageInfo/azure-storage-internal-avro.json, ...
2026-05-14T23:34:28.1555748Z IsReleaseBuild: False
```
The avro package was a GA client package selected for validation/release:
```text
2026-05-14T23:34:48.0165738Z Processing artifact: azure-storage-internal-avro
2026-05-14T23:34:48.0167815Z Is Release Build: False
2026-05-14T23:34:48.0169404Z Checking if we need to create or update work item for package azure-storage-internal-avro and groupId @{Name=azure-storage-internal-avro; Version=12.19.0; DevVersion=; DirectoryPath=sdk/storage/azure-storage-internal-avro; ServiceDirectory=storage; ReadMePath=sdk/storage/azure-storage-internal-avro/README.md; ChangeLogPath=sdk/storage/azure-storage-internal-avro/CHANGELOG.md; Group=com.azure; SdkType=client; IsNewSdk=True; ArtifactName=azure-storage-internal-avro; ReleaseStatus=2026-05-14; IncludedForValidation=False; AdditionalValidationPackages=System.Object[]; ArtifactDetails=; CIParameters=; SpecProjectPath=}.Group with version 12.19.0.
```
APIView was explicitly pending:
```text
2026-05-14T23:34:49.1724803Z Checking API review status for package com.azure:azure-storage-internal-avro
2026-05-14T23:34:49.1726372Z Checking API review status for package com.azure:azure-storage-internal-avro with version 12.19.0. language [java].
2026-05-14T23:34:49.1728564Z Request to APIView: [https://apiview.dev/AutoReview/GetReviewStatus?language=Java&packageName=com.azure:azure-storage-internal-avro&packageVersion=12.19.0]
2026-05-14T23:34:49.2158982Z Response: 201
2026-05-14T23:34:49.2162402Z WARNING: API Review is not approved for package com.azure:azure-storage-internal-avro. Release pipeline will fail if API review is not approved for a GA version release. You can check http://aka.ms/azsdk/engsys/apireview/faq for more details on API Approval. Once your API is approved, re-trigger the release pipeline again.
2026-05-14T23:34:49.2163825Z Package name is approved for package com.azure:azure-storage-internal-avro
```
The work item was updated to pending, but the build still continued because release mode was false:
```text
2026-05-14T23:34:49.2166971Z Output: {
2026-05-14T23:34:49.2167463Z "Name": "azure-storage-internal-avro",
2026-05-14T23:34:49.2167934Z "GroupId": "com.azure",
2026-05-14T23:34:49.2168415Z "Version": "12.19.0",
...
2026-05-14T23:34:49.2171344Z "APIReviewValidation": {
2026-05-14T23:34:49.2171845Z "Name": "API Review Approval",
2026-05-14T23:34:49.2172345Z "Status": "Pending",
2026-05-14T23:34:49.2173148Z "Message": "API Review is not approved for package com.azure:azure-storage-internal-avro. Release pipeline will fail if API review is not approved for a GA version release. You can check http://aka.ms/azsdk/engsys/apireview/faq for more details on API Approval. Once your API is approved, re-trigger the release pipeline again."
...
2026-05-14T23:34:49.9693663Z Change log status: Success
2026-05-14T23:34:49.9694532Z API Review status: Pending
2026-05-14T23:34:49.9695056Z Package Name status: Approved
```
## Code path
`validate-all-packages.yml` passes `SetAsReleaseBuild` to the validation script:
```yaml
-IsReleaseBuild $$(SetAsReleaseBuild)
```
But the same template defaults `SetAsReleaseBuild` to `false` when it is empty:
```yaml
- pwsh: |
echo "##vso[task.setvariable variable=SetAsReleaseBuild]false"
displayName: "Set as release build"
condition: and(succeededOrFailed(), eq(variables['SetAsReleaseBuild'], ''))
```
`Validate-All-Packages.ps1` only hard-fails validation when `IsReleaseBuild` is true:
```powershell
if ($IsReleaseBuild)
{
if (!$updatedWi -or $changeLogStatus.Status -ne "Success" -or $apireviewDetails.ApiviewApproval.Status -ne "Approved" -or $apireviewDetails.PackageNameApproval.Status -ne "Approved") {
Write-Error "At least one of the Validations above failed for package $pkgName with version $versionString."
exit 1
}
}
```
Also, the AzureCLI validation task currently has `continueOnError: true`, so this step may not be acting as a hard gate even when the script exits non-zero.
## Expected behavior
For a manually queued internal release run, the pipeline should treat package validation as a release build and fail before publishing if a GA package has pending APIView approval.
At minimum, manual release runs should set `SetAsReleaseBuild=true` before `validate-all-packages.yml` executes.
## Suggested fix
Consider one of the following:
1. Automatically set `SetAsReleaseBuild=true` for manual internal release runs that have release artifacts selected.
2. Remove or override `continueOnError: true` for release validation.
3. Add an explicit pre-Signing/pre-Release APIView approval gate in `archetype-java-release-batch.yml`, so APIView approval is verified on the actual release path before packages are published.
Option 3 may be the most robust because the current release stage itself does not call `validate-all-packages.yml`; the validation runs in the Build stage while Signing/Release are separate stages.
关闭于 2026-06-11 1 条评论