rfennell / AzurePipelines

A single Repo to contain the source for ALL my Azure DevOps Build/Release Extensions. The packages can be found in the Azure DevOps Marketplace
https://marketplace.visualstudio.com/search?term=fenn&target=VSTS&sortBy=Relevance
MIT License
343 stars 430 forks source link

DACPAC Versioning Slow #1594

Open rfennell opened 7 months ago

rfennell commented 7 months ago

Azure DevOps Extensions

Manifest Versioning

Platform

Azure DevOps Services

Azure DevOps Server (TFS) Version

No response

Extension Version

DACPAC 3.7.2

Describe the bug

The discovery of the path to the location of the required tools is very slow on some agent, in this example it took over 6minutes

2024-03-04T18:44:31.5982842Z No user provided ToolPath, so searching default locations
2024-03-04T18:44:31.5989613Z Scan standard Visual Studio locations (2017 and later)
2024-03-04T18:44:31.6014688Z ##[debug]Found a VS2022 SKU in 'C:\Program Files\Microsoft Visual Studio\2022'
2024-03-04T18:51:10.9244247Z ##[debug]Found 1 SDK(s)
2024-03-04T18:51:10.9277486Z ##[debug]Considering 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\Microsoft.SqlServer.Dac.Extensions.dll'
2024-03-04T18:51:10.9304294Z Found the newest SDK in 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC'

Repo Steps

Run the task, on sone agent the time is slow, on others it is not

Expected Behavior

Fast discovery of the path

Logging Information

No response

rfennell commented 7 months ago

This it appears is due to the way get-childitem -filter works.

The workaround is to provide a toolpath to the task so it does not have to do the search itself

See https://devblogs.microsoft.com/powershell/why-is-get-childitem-so-slow/