-
Notifications
You must be signed in to change notification settings - Fork 267
AZD VS Code Extension Updates & Improvements #6425
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
Conversation
- Add new Extensions view with tree data provider for managing azd extensions - Implement extension commands: install, uninstall, and upgrade - Add ExtensionProvider service for interacting with azd extension APIs - Add environment variables tree node for displaying env vars in workspace - Enhance environment tree views with toggle visibility and .env file viewing - Add inline actions to environment view (view .env, select environment) - Add navigation buttons to view titles (new environment, install extension) - Improve tree view type checking with isTreeViewModel utility - Update telemetry IDs for new extension and environment operations - Refactor command handlers to support both workspace and environment tree views
…g Posts - Rename 'Resources' link to 'AZD Blog Posts' in Help and Feedback view - Update URL to point to Azure SDK blog filtered by azure-developer-cli tag - Update command title to 'Open AZD Blog Posts'
- Added new command to open Azure resources directly in the Azure Portal - Created OpenInPortalStep wizard step to handle portal URL opening - Enhanced RevealStep with improved resource tree navigation and error handling - Added debug logging throughout wizard steps for better diagnostics - Improved error handling in PickResourceStep and PickResourceGroupStep - Updated command registration and package.json with new command - Added localized command title in package.nls.json - Modified reveal.ts to support both TreeViewModel and direct service item inputs - Enhanced RevealStep to activate required Azure extensions and refresh tree before reveal - Added fallback mechanisms when automatic reveal fails (copy ID, open in portal options)
…ents view - Extended environment commands to support both workspace and standalone views - Added refresh functionality to Environments view after environment operations - Connected env-refresh, env-edit, env-delete, and revealResourceGroup commands to standalone environments - Updated reveal.ts to handle EnvironmentTreeItem for resource group navigation - Modified env.ts to accept EnvironmentTreeItem in all environment operations - Added view refresh commands after env operations (delete, new, select, refresh) - Removed automatic env-select on click for non-default environments - Fixed ESLint warnings with naming-convention for Azure provider types - Added comment explaining focusGroup limitation in RevealStep - Improved regex patterns in RevealStep for better linting compliance This unifies the experience across both the workspace environments and the standalone environments view, ensuring users can perform the same operations from either location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This WIP PR introduces significant improvements to the Azure Developer CLI VS Code extension, adding a new dedicated activity bar view with multiple panels for managing environments, extensions, and resources. The changes focus on providing a standalone interface for environment management and adding convenient navigation features to Azure Portal.
Key Changes:
- Adds a new activity bar container with four views: My Project, Environments, Extensions, and Help and Feedback
- Implements environment variable visibility toggle functionality with hidden-by-default behavior
- Adds "Show in Azure Portal" command for quick navigation from services
- Extends reveal commands to work with both workspace and standalone environment views
Reviewed changes
Copilot reviewed 35 out of 38 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
package-lock.json |
Empty lock file added at repository root (should be removed) |
ext/vscode/ext/vscode/package-lock.json |
Empty lock file in duplicate nested path (should be removed) |
ext/vscode/package-lock.json |
Lock file dependency updates (peer dependencies unmarked) |
.vscode/settings.json |
Added aspire settings (unrelated to PR scope) |
ext/vscode/package.json |
Registered new views container, views, commands, and menus for enhanced UI |
ext/vscode/package.nls.json |
Added localization for new "Show in Azure Portal" command |
ext/vscode/src/extension.ts |
Integrated new view registration in activation |
ext/vscode/src/views/registerViews.ts |
New file registering all tree data providers and view commands |
ext/vscode/src/views/myProject/MyProjectTreeDataProvider.ts |
New provider for My Project view without environments |
ext/vscode/src/views/environments/EnvironmentsTreeDataProvider.ts |
New standalone environments view with variable visibility toggle |
ext/vscode/src/views/extensions/ExtensionsTreeDataProvider.ts |
New extensions management view |
ext/vscode/src/views/helpAndFeedback/HelpAndFeedbackTreeDataProvider.ts |
New help and feedback view with links |
ext/vscode/src/views/workspace/AzureDevCliApplication.ts |
Added environment variables provider and optional environment inclusion |
ext/vscode/src/views/workspace/AzureDevCliEnvironment.ts |
Enhanced with collapsible environment variables child node |
ext/vscode/src/views/workspace/AzureDevCliEnvironments.ts |
Added env values provider integration |
ext/vscode/src/views/workspace/AzureDevCliEnvironmentVariables.ts |
New classes for environment variable tree items with visibility toggle |
ext/vscode/src/views/workspace/AzureDevCliWorkspaceResourceBranchDataProvider.ts |
Added visibility state management |
ext/vscode/src/services/AzureDevEnvValuesProvider.ts |
New service to fetch environment variable values via CLI |
ext/vscode/src/services/AzureDevExtensionProvider.ts |
New service to list installed azd extensions |
ext/vscode/src/commands/registerCommands.ts |
Registered new extension management and portal navigation commands |
ext/vscode/src/commands/extensions.ts |
New command implementations for extension install/uninstall/upgrade |
ext/vscode/src/commands/env.ts |
Extended environment commands to support standalone view items |
ext/vscode/src/commands/azureWorkspace/reveal.ts |
Extended reveal commands with EnvironmentTreeItem support and portal navigation |
ext/vscode/src/commands/azureWorkspace/wizard/OpenInPortalStep.ts |
New wizard step for opening resources in Azure Portal |
ext/vscode/src/commands/azureWorkspace/wizard/RevealStep.ts |
Enhanced with extension activation, retry logic, and better error handling |
ext/vscode/src/commands/azureWorkspace/wizard/PickEnvironmentStep.ts |
Added debug logging |
ext/vscode/src/commands/azureWorkspace/wizard/PickResourceStep.ts |
Added error handling and debug logging |
ext/vscode/src/commands/azureWorkspace/wizard/PickResourceGroupStep.ts |
Added error handling and improved error messages |
ext/vscode/src/commands/up.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/down.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/deploy.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/provision.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/restore.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/packageCli.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/pipeline.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/commands/monitor.ts |
Added support for AzureDevCliModel type guard |
ext/vscode/src/utils/isTreeViewModel.ts |
Added isAzureDevCliModel type guard function |
ext/vscode/src/telemetry/telemetryId.ts |
Added telemetry IDs for extension management commands |
Files not reviewed (2)
- ext/vscode/ext/vscode/package-lock.json: Language not supported
- ext/vscode/package-lock.json: Language not supported
ext/vscode/src/commands/azureWorkspace/wizard/PickResourceStep.ts
Outdated
Show resolved
Hide resolved
ext/vscode/src/views/environments/EnvironmentsTreeDataProvider.ts
Outdated
Show resolved
Hide resolved
ext/vscode/src/views/environments/EnvironmentsTreeDataProvider.ts
Outdated
Show resolved
Hide resolved
Added unit tests for: - OpenInPortalStep: Tests portal URL construction for various Azure resource types * Web Apps, Storage Accounts, Cosmos DB, Container Apps, Resource Groups * Error handling for missing resource IDs * Priority configuration - RevealStep: Tests Azure resource reveal functionality * Extension activation for different Azure providers * Resource group pre-expansion logic * Multi-attempt reveal with fallback * Error handling and user notifications * Tree refresh mechanisms - EnvironmentsTreeDataProvider: Tests standalone environments view * Environment listing and hierarchy * Default environment marking * Environment variable visibility toggling * Tree refresh events * Integration with environment providers - ExtensionsTreeDataProvider: Tests extensions management view * Extension listing and display * Version information * Tree item creation * Refresh functionality All tests use proper mocking with sinon, follow established patterns, and provide comprehensive coverage of success and error paths.
- Add sinon and @types/sinon for test mocking - Remove unused telemetryId parameter from registerActivityCommand - Add documentation for telemetry tracking in commands - Fix isAzdCommand to handle undefined input - Add TEST_COVERAGE.md documentation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
bwateratmsft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of the playwright tests that were added provide any real value. They should just be removed, along with the playwright dev dependency.
ext/vscode/src/test/suite/unit/environmentsTreeDataProvider.test.ts
Outdated
Show resolved
Hide resolved
- Remove Playwright e2e testing infrastructure - Update extension icon - Add copyright header requirement to Copilot instructions - Convert unit tests from assert to Chai assertions - Merge azureYamlValidation.test.ts into azureYamlDiagnostics.test.ts - Update .vscodeignore and .gitignore
|
Thanks @bwateratmsft, made the needed changes. Good call on the playwright feedback (trying to be too fancy)
|
|
I see the latest build is failing, I'm guessing it's referring to not wanting the extension icon to be an SVG. The activity bar icon definitely can be an SVG. |
…icons: resources/icon.svg
yea, fixed that. |
- Rename WorkspaceViewExtensionResolve to ExtensionsViewResolve (correct view ID) - Remove fragile caching test from azureDevTemplateProvider.test.ts - Add copyright headers to view providers - Add vscode.l10n.t() for user-visible strings in HelpAndFeedbackTreeDataProvider - Rename toggle commands to toggleEnvVarVisibility for clarity - Make Help and Feedback view collapsed by default - Use specific context values for templates to avoid conflicts - Consolidate duplicate environment menu entries using regex alternation - Add NLS strings to package.nls.json for new commands - Fix refresh command registration (define command, remove @1) - Restore telemetryId parameter in registerActivityCommand - Remove redundant azureWorkspace.refresh from refreshEnvironment - Add comments explaining hard-coded delays in RevealStep.ts
|
@bwateratmsft - all comments addressed
|
|
@bwateratmsft just need you to do a final check here and sign off and we can discuss how to move foward here. |
bwateratmsft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still some things, most important is the file watchers thing, and checking if those tree refreshes are needed (note to self)
ext/vscode/src/views/workspace/AzureDevCliEnvironmentVariables.ts
Outdated
Show resolved
Hide resolved
- Remove root-level package-lock.json (unnecessary) - Reduce excessive logging in RevealStep.ts - Remove verbose appendLog calls throughout - Use .debug() and .error() for appropriate log levels - Remove unnecessary extension activation (Resources extension handles it) - Update addService.ts to use context.ui.showInputBox/showQuickPick - Add vscode.l10n.t() to all user-facing strings - Update extensions.ts to use context.ui.showInputBox - Update Copilot instructions with UI best practices - Document l10n requirement for user-facing strings - Document context.ui usage instead of vscode.window - Note FileSystemWatcher scarcity
92f9899 to
b7ecc73
Compare
- Extract duplicated language list to shared constant (languages.ts) - Use SUPPORTED_LANGUAGES constant in AzureYamlCodeActionProvider - Eliminates hardcoded ['python', 'js', 'ts', 'csharp', 'java', 'go'] arrays - Add l10n (internationalization) to user-facing strings: - AzureYamlCodeActionProvider: All UI strings, tooltips, and commands - TemplateToolsTreeDataProvider: All tree item labels and tooltips - EnvironmentsTreeDataProvider: Environment variable labels and tooltips - AzureDevTemplateProvider: Category display names - Consolidate FileSystemWatcher usage: - Create shared FileSystemWatcherService to manage watchers - FileSystemWatchers are a limited resource (few hundred per system) - TemplateToolsTreeDataProvider now uses shared service - EnvironmentsTreeDataProvider now uses shared service - MyProjectTreeDataProvider now uses shared service - Reduces watcher count from 3+ individual watchers to shared pool These changes improve code maintainability, enable proper localization, and reduce system resource consumption as requested in PR review.
- Remove playwright.config.js.map - Fix extensions.ts to use context.ui.showInputBox - Add vscode.l10n.t() for user-facing strings in AzureDevCliEnvironmentVariables.ts - Add vscode.l10n.t() for error message in AzureDevTemplateProvider.ts - Move view titles from package.json to package.nls.json - Simplify RevealStep.ts by removing excessive logging and retry logic - Fix test files to pass FileSystemWatcherService to providers
- Fix registerViews.ts to use vscode.window.showTextDocument() - Remove unused templateProvider parameter from TemplateItem and CategoryGroupItem
- Add extractEnvironmentContext() utility to extract environment info from tree items - Add refreshAllEnvironmentViews() to consolidate view refresh logic - Apply DRY principle to deleteEnvironment, selectEnvironment, newEnvironment, refreshEnvironment
- Remove unnecessary AzureDevExtensionProvider interface - Class now directly returns AzureDevExtension[] as suggested
- addService.ts: Use SUPPORTED_LANGUAGES constant instead of hardcoded array - RevealStep.ts: Extract l10n strings to constants before comparison - FileSystemWatcherService.ts: Add clarifying comments for watcher registration flow - AGENTS.md: Add agent development guide per Jeffrey's suggestion
- Fix RevealStep tests to match simplified implementation - Fix addService tests to use context.ui and UserCancelledError - Update copilot-instructions.md with correct cspell config path - Update AGENTS.md with testing requirements and correct cspell config - Emphasize running tests before committing to avoid pipeline failures
VSCode Extension Installation Instructions
|
Introduces significant improvements to the Azure Developer CLI VS Code extension, focusing on enhanced environment management, improved resource navigation, and better user experience.
📋 Summary of Changes
🆕 New Features
1. Standalone Environments View
2. Extensions Management View
3. "Show in Azure Portal" Command
4. Enhanced Environment Operations
env-refresh,env-edit,env-delete,revealAzureResourceGroup🔧 Improvements
Resource Navigation
revealAzureResourceGroupto support standalone environmentsUser Experience
Code Quality
EnvironmentTreeItemsupport📊 Commits Included
bec9154f- Remove Environments from My Project view89d29243- Add extensions view and enhanced environment managementab57695c- Update Help and Feedback link from Resources to AZD Blog Posts15197c3d- Add 'Show in Azure Portal' command for servicesa9f3d191- Integrate environment commands with standalone Environments view🧪 Testing Checklist
🔍 Related Issues
<- Improved regex patterns in RevealStep for better linting compliance Link any related issues here -->
📝 Notes
This is a work in progress. Additional testing and refinement may be needed before final review.