fix panic on middleware construction failure#6517
fix panic on middleware construction failure#6517rajeshkamal5050 merged 3 commits intoAzure:mainfrom
Conversation
…zure#6373)" This reverts commit 851ae6e.
There was a problem hiding this comment.
Pull request overview
This PR fixes a panic issue when middleware construction fails by properly propagating errors instead of silently continuing. The change also reverts #6373 by removing lazy loading of ProjectConfig in HooksMiddleware, now that middleware construction failures are properly handled.
Changes:
- Middleware resolution failures now properly return errors instead of being silently logged and ignored
- HooksMiddleware simplified to require ProjectConfig directly instead of lazy loading it
- Removed test case for silent skipping when project is unavailable, as this is no longer expected behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cli/azd/cmd/middleware/middleware.go | Changed to return error on middleware resolution failure instead of silently continuing |
| cli/azd/cmd/middleware/hooks.go | Changed from lazy-loaded ProjectConfig to direct injection, simplified code by removing null checks |
| cli/azd/cmd/middleware/hooks_test.go | Removed test for unavailable project scenario, updated test helpers to use direct ProjectConfig |
16d4b92 to
53aebab
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #6506
With this change, we also safely revert #6373 to allow hooks attached to commands to validate cleanly now that middleware construction failures are no longer silent.