From 2a0d0a12109b87c45648b2b0f05495585a3881c1 Mon Sep 17 00:00:00 2001 From: leileizhang Date: Wed, 21 Jan 2026 13:18:51 +0800 Subject: [PATCH] [CI] Remove tests folder before code signing to reduce signing workload (#44800) ## Summary of the Pull Request Remove the tests folder before ESRP code signing step to significantly reduce the number of files being signed. ## Problem The current code signing process signs **8,148 files**, with approximately **5,000+ files** coming from the `tests/` directory. These test files (primarily localized `.resources.dll` files from test frameworks) do not need to be signed since they are not included in the final release package. The excessive file count causes: - HTTP 429 (Too Many Requests) throttling from ESRP Gateway - Signing operations getting stuck in "Inprogress" status - Pipeline timeouts after ~57 minutes image image image Fix: Reduce signing time by 10+ minutes From image to image ## PR Checklist - [ ] Closes: #xxx - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- .pipelines/v2/templates/job-build-project.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pipelines/v2/templates/job-build-project.yml b/.pipelines/v2/templates/job-build-project.yml index 57fdba6397..b05e8907ed 100644 --- a/.pipelines/v2/templates/job-build-project.yml +++ b/.pipelines/v2/templates/job-build-project.yml @@ -504,6 +504,14 @@ jobs: Remove-Item -Force -Recurse "$(JobOutputDirectory)/_appx" -ErrorAction:Ignore displayName: Re-pack the new CmdPal package after signing + - pwsh: | + $testsPath = "$(Build.SourcesDirectory)/$(BuildPlatform)/$(BuildConfiguration)/tests" + if (Test-Path $testsPath) { + Remove-Item -Path $testsPath -Recurse -Force + Write-Host "Removed tests folder to reduce signing workload: $testsPath" + } + displayName: Remove tests folder before signing + - template: steps-esrp-signing.yml parameters: displayName: Sign Core PowerToys