[release/v7.4.15] Fix the APIScan pipeline#27282
Conversation
1. When removing unused runtimes, keep the `win` and `win-x64` runtime folders. 2. Stop downloading `getfilesiginforedist.dll` from Azure blob. The original `getfilesiginforedist.dll` produced from the build works fine with the symbols retrieved by `dotnet-symbols`.
There was a problem hiding this comment.
Pull request overview
Backport to release/v7.4.15 to repair the APIScan pipeline by keeping required Windows runtimes and removing reliance on downloading getfilesiginforedist.dll from Azure Blob storage.
Changes:
- Removed the Azure Blob variable group usage and the AzurePowerShell download step for
getfilesiginforedist.dll. - Adjusted build artifact copy to ensure the destination output directory exists before copying.
- Updated runtime cleanup logic to preserve
win/win-x64folders while removing other runtimes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.pipelines/templates/compliance/apiscan.yml |
Removes Azure Blob dependency and updates output copy + runtime pruning for APIScan artifacts. |
.pipelines/apiscan-gen-notice.yml |
Updates APIScan configuration metadata (including versionNumber) and fixes comment indentation. |
| enabled: true | ||
| softwareName: "PowerShell" # Default is repo name | ||
| versionNumber: "7.5" # Default is build number | ||
| versionNumber: "7.6" # Default is build number |
There was a problem hiding this comment.
versionNumber is hard-coded to "7.6", which can easily drift from the branch/version this pipeline is running for (and requires manual updates). Prefer omitting versionNumber to use the default build number, or set it based on a branch/version variable appropriate for this release branch.
| versionNumber: "7.6" # Default is build number |
| # Only key windows runtimes | ||
| Get-ChildItem -Path '$(ob_outputDirectory)\runtimes\*' -File -Recurse | Where-Object {$_.FullName -notmatch '.*\/runtimes\/win'} | Foreach-Object { | ||
| # Only keep windows runtimes | ||
| Write-Verbose -Verbose -Message "Deleting non-win-x64 runtimes ..." |
There was a problem hiding this comment.
The verbose message says "Deleting non-win-x64 runtimes ..." but the filter keeps any runtime folder whose path matches \runtimes\win (including win and other win-* RIDs). Update the message (or the filter) so the log accurately reflects what's being deleted/kept.
| Write-Verbose -Verbose -Message "Deleting non-win-x64 runtimes ..." | |
| Write-Verbose -Verbose -Message "Deleting non-Windows runtimes ..." |
19b46f5
into
PowerShell:release/v7.4.15
Backport of #26016 to release/v7.4.15
Triggered by @SeeminglyScience on behalf of @SeeminglyScience
Original CL Label: CL-BuildPackaging
/cc @PowerShell/powershell-maintainers
Impact
REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.
Tooling Impact
Fixes the APIScan pipeline: keeps
winandwin-x64runtime folders when removing unused runtimes, and stops downloadinggetfilesiginforedist.dllfrom Azure blob (the build-produced version works correctly withdotnet-symbols).Customer Impact
Regression
REQUIRED: Check exactly one box.
This is not a regression.
Testing
The APIScan validation pipeline was run and passed successfully. This change only affects CI/build tooling with no user-facing code changes, so no new automated tests are needed.
Risk
REQUIRED: Check exactly one box.
This is a CI/build pipeline-only fix with no changes to user-facing PowerShell code. The risk of regression is minimal.