Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade deprecated azure tools package #372

Merged
merged 10 commits into from
Jan 9, 2025

Conversation

blackchoey
Copy link
Collaborator

@blackchoey blackchoey commented Jan 3, 2025

When setting up new CI pipelines, I found the pipeline cannot success anymore due to the deprecated vscode package. Update below packages to ensure we can continue setup the pipelines.

  1. Upgrade deprecated vscode package to @types/vscode and @vscode/test-electron.
  2. Upgrade deprecated vscode-azureextensionui package to @microsoft/vscode-azext-azureutils and @microsoft/vscode-azext-utils.
  3. Upgrade deprecated vscode-azureextensiondev package to @microsoft/vscode-azext-dev.
  4. Upgrade TypeScript to 5.0 as the new packages use new typescript features
  5. Upgrade Azure SDK for APIM and App Service from Track 1 to Track 2 to avoid build errors
  6. Upgrade Webpack to pack the new code successfully

After upgraded above packages, following changes were made to pass the build:
7. Initialize ServiceClient directly instead of using createGenericClient as the type of provided credential cannot be used by createGenericClient directly. Append vscode-apimanagement user agent to the service client when initializing.
8. Use the ui element in IActionContext instead of ext.ui from extension variables to control VS Code UI. This is because the AzureUserInput class is no longer exported by the @microsoft/vscode-azext-utils package, so we cannot initialize ext.ui proactively anymore.
9. Since AzExtTreeItem and other tree items no longer has the root property that saves information about the resource, add ITreeItemWithRoot interface to add the root property back in order to reduce code change during the upgrade.
10. Add additional root parameter in each TreeItem's constructor to initialize and expose the root property.
11. Update editor classes to leverage ITreeItemWithRoot instead of using the root property in old AzureParentTreeItem.
12. Update some TreeItem implementation due to the interface change in AzExtTreeItem. For example: change commandId from a property to an accessor.
13. Update Azure SDK related logic to support the Track 2 SDK. The paging implementation is removed temporary to reduce the effort of the upgrade as the implementation is totally different. Will add paging back in another PR.
14. Use @vscode/test-cli to run test cases

Follow ups (will create other PR):
How to set the body's value in ConsoleRequest.ts
Add paging back when show resources in tree view, right now we show all the resource

@blackchoey blackchoey requested review from Copilot, annaji-msft, malincrist and adashen and removed request for annaji-msft January 6, 2025 07:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 96 out of 111 changed files in this pull request and generated 1 comment.

Files not reviewed (15)
  • package.json: Language not supported
  • src/commands/authorizations/common.ts: Evaluated as low risk
  • src/commands/authorizations/createAuthorizationAccessPolicy.ts: Evaluated as low risk
  • src/commands/addApiFilter.ts: Evaluated as low risk
  • src/azure/webApp/FunctionAppService.ts: Evaluated as low risk
  • src/commands/authorizations/createAuthorization.ts: Evaluated as low risk
  • src/commands/authorizations/authorizeAuthorization.ts: Evaluated as low risk
  • src/azure/resourceGraph/ResourceGraphService.ts: Evaluated as low risk
  • src/azure/apim/ApimService.ts: Evaluated as low risk
  • src/commands/authorizations/createAuthorizationProvider.ts: Evaluated as low risk
  • src/commands/addApiToProduct.ts: Evaluated as low risk
  • src/commands/addApiToGateway.ts: Evaluated as low risk
  • src/commands/authorizations/copyAuthorizationProviderRedirectUrl.ts: Evaluated as low risk
  • src/commands/authorizations/copyAuthorizationPolicy.ts: Evaluated as low risk
  • src/azure/graph/GraphService.ts: Evaluated as low risk

src/azure/clientOptions.ts Show resolved Hide resolved
@blackchoey blackchoey merged commit fdbcbd5 into main Jan 9, 2025
1 check passed
@blackchoey blackchoey deleted the chyuan/upgrade-deprecated-packages branch January 9, 2025 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants