microsoft / azure-pipelines-agent

Azure Pipelines Agent 🚀
MIT License
1.73k stars 869 forks source link

Add script for checking if agents support upgrade to v4 #4995

Closed aleksandrlevochkin closed 2 months ago

aleksandrlevochkin commented 2 months ago

WI AB#2211128

Description

Added a PS script for checking if agents in an organization can be upgraded from v3 to v4. Based on the previous v2 -> v3 migration script

Example Running the script like this:

.\QueryAgentPoolsForCompatibleOSV4.ps1 -OrganizationUrl $ORG_URL -Token $PAT -Force

produces the following output:

script

Please, note that in the screenshot above the WSL version of Ubuntu is used. Even though the version itself is supported, the output of uname -a is different from a regular Ubuntu, that is why the validation does not pass in this case.

geekzter commented 2 months ago

@aleksandrlevochkin Is there a reason to keep the v3 script around? I think we should encourage customers to use the v4 agent.

aleksandrlevochkin commented 2 months ago

@geekzter Thanks for the point, I refactored the PR to output v2/v3 -> v4 migration info all in one script

tristanbarcelon commented 4 weeks ago

@aleksandrlevochkin and @kirill-ivlev, can the v4 builds be used in production or would you suggest waiting for v4 to be marked for release before we upgrade v3 agents to it? In the Azure Devops organizational settings page, it is possible to go to both Agent Pools and Deployment Pools to drill down to specific agents and upgrade them. However, the rest api endpoint for them are not documented. Would it be possible for you to provide a -Upgrade switch to the script that would initiate a call to the api endpoint used by the page to update agents if upgrade is supported?

aleksandrlevochkin commented 2 weeks ago

@tristanbarcelon The v4 agent is generally the same as v3, except it runs on .NET 8 instead of .NET 6. Thank you for the proposal regarding the update switch, we will consider it. I tried looking it up, but I am also not aware of the API endpoint for initiating an agent update