-
Notifications
You must be signed in to change notification settings - Fork 261
Support azure.yml in addition to azure.yaml #6285
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
base: main
Are you sure you want to change the base?
Conversation
- Updated Go code to search for both azure.yaml and azure.yml files - azure.yaml takes precedence when both files exist - Updated VS Code extension context menus to show for both file extensions - Updated glob patterns and validation schemas for both file names - Updated error messages to mention both file extensions Co-authored-by: spboyer <[email protected]>
- Add clarifying comment to ProjectPath() method explaining its dual behavior - Fix VS Code glob pattern to be case-insensitive using character classes - Pattern now correctly matches azure.yaml, azure.yml, AZURE.YAML, Azure.Yml, etc. Co-authored-by: spboyer <[email protected]>
Co-authored-by: spboyer <[email protected]>
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.
VSCode parts look fine. Someone else, please review the Go code, I'm not well-qualified to do that! I'm guessing that Copilot shouldn't be touching go.mod and go.sum but don't know for sure.
Probably right about that. :-) |
|
@copilot - why change |
These files are manifest/lockfiles managed by the Go toolchain and should not be manually modified. Restored them to their original state before my changes. Co-authored-by: spboyer <[email protected]>
Reverted go.mod and go.sum to their original state in commit 2292716. These files are now unchanged from the base branch. 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:
|
Added proper error handling to return errors from os.Stat that are not os.ErrNotExist. This ensures unexpected file system errors (e.g., permission issues) are properly propagated instead of being silently ignored. Co-authored-by: weikanglim <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
|
| // ProjectPath returns the path to the project file. If the context was created by searching | ||
| // for a project file, returns the actual file that was found. Otherwise, returns the default | ||
| // project file name joined with the project directory (useful when creating new projects). | ||
| func (c *AzdContext) ProjectPath() string { |
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.
@copilot - please add some unit tests to validate this existing and new behavior.
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.
Added comprehensive unit tests in commit f298fdf. The test suite includes 16 test cases covering:
- Finding azure.yaml and azure.yml files
- Precedence behavior (azure.yaml over azure.yml)
- Subdirectory navigation
- Error handling (missing files, invalid paths)
- Edge cases (directories with same name as project files)
- All helper methods
All tests pass with 0 linting issues.
Added unit tests to validate: - Finding azure.yaml files - Finding azure.yml files - Precedence when both files exist (azure.yaml takes priority) - Walking up from subdirectories - Handling missing project files (returns ErrNoProject) - Handling directories with same name as project files - ProjectPath() behavior with and without found files - Helper methods (SetProjectDirectory, EnvironmentDirectory, etc.) - ProjectFileNames order and contents All tests pass with 0 linting issues. Co-authored-by: wbreza <[email protected]>
Support
azure.ymlin addition toazure.yaml✅ Implementation Complete
This PR adds support for both
azure.ymlandazure.yamlfile names in the Azure Developer CLI and VS Code extension, addressing issue #542.Changes Made
Go CLI (
cli/azd/pkg/environment/azdcontext/azdcontext.go)ProjectFileNamesvariable listing both valid file names in preference orderNewAzdContextFromWdto search for all valid project file namesProjectPath()to return the actual file found with clear documentationazure.yamltakes precedence (backward compatible)cli/azd/pkg/environment/azdcontext/azdcontext_test.go)VS Code Extension
ext/vscode/package.json:/azure.ya?ml/i)azure.yamlandazure.ymlext/vscode/src/commands/cmdUtil.ts:Testing & Verification
Unit Tests (
cli/azd/pkg/environment/azdcontext/azdcontext_test.go)azure.yamlfilesazure.ymlfilesazure.yamltakes priority)ErrNoProject)ProjectPath()behavior with and without found filesSetProjectDirectory,EnvironmentDirectory, etc.)ProjectFileNamesorder and contents validationProjectNamefunction with various inputsAutomated Tests
azure.yamlonly → ✓ recognizedazure.ymlonly → ✓ recognizedazure.yamltakes precedenceCode Quality
gofmtpassedgolangci-lintpassed (0 issues)cspellpassedpackage.jsonvalidatedSecurity Review
Backward Compatibility
✅ Fully backward compatible:
azure.yamlcontinue to work without changesazure.yamlImplementation Details
File Discovery Logic:
azure.yaml, thenazure.ymlazure.yamlwhen generating new projectsVS Code Pattern Matching:
**/[aA][zZ][uU][rR][eE].{[yY][aA][mM][lL],[yY][mM][lL]}azure.yaml,Azure.Yml,AZURE.YML, etc.Security Summary
No security vulnerabilities introduced. All changes use safe file operations with proper error handling.
Original prompt
azure.ymlin addition toazure.yaml#364💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.