Make env_name optional in EnvironmentService gRPC methods#6733
Make env_name optional in EnvironmentService gRPC methods#6733
Conversation
…lveEnvironment helper, update methods, add tests Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
|
@copilot can you make sure comments for |
…tional Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Updated all Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
This PR makes the env_name parameter optional in all EnvironmentService gRPC methods, standardizing the behavior so that all methods can either use a specified environment or fall back to the default environment when env_name is empty.
Changes:
- Added
env_namefield to config-related proto request messages (GetConfigRequest,GetConfigStringRequest,GetConfigSectionRequest,SetConfigRequest,UnsetConfigRequest) - Updated both proto files (main and extension mirror) with consistent comments marking
env_nameas optional - Implemented
resolveEnvironmenthelper method to centralize environment resolution logic - Updated all 8 service methods to use the new helper for consistent behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/grpc/proto/environment.proto | Added env_name field to config request messages and updated comments to indicate the field is optional |
| cli/azd/extensions/microsoft.azd.extensions/internal/resources/languages/proto/environment.proto | Mirrored the proto changes for extension compatibility |
| cli/azd/pkg/azdext/environment.pb.go | Regenerated Go protobuf code with new env_name fields and getter methods |
| cli/azd/internal/grpcserver/environment_service.go | Added resolveEnvironment helper and updated all 8 methods to use it for consistent environment resolution |
| cli/azd/internal/grpcserver/environment_service_test.go | Added comprehensive test coverage for the new optional env_name behavior across multiple methods |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
|
/azp run azure-dev - cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This PR makes the
env_nameparam in various EnvironmentService methods optional, and adds them to methods that were missing it (GetConfig,SetConfig, etc.).If
env_nameis empty or omitted, the service now defaults to using the current (default) environment. The implementation includes updates to proto definitions, Go service logic, and comprehensive new tests to ensure correct behavior.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.