feat: full azd extension framework adoption - metadata, MCP server, lifecycle events#37
Merged
feat: full azd extension framework adoption - metadata, MCP server, lifecycle events#37
Conversation
Add the metadata capability to the azd-exec extension to enable: - CLI help integration with rich usage information - IntelliSense support for extension flags and arguments - Configuration validation schemas Changes: - Add 'metadata' to capabilities in extension.yaml - Create hidden metadata command that outputs JSON metadata - Register metadata command in root command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implement full azd extension framework integration: - Real listen command with azdext.ExtensionHost for lifecycle events - MCP server with exec_script, exec_inline, list_shells, get_environment tools - Rate limiting (60 calls/min, burst 10) and security validation for MCP tools - Update extension.yaml with lifecycle-events and mcp-server capabilities - Add go.work entry for azure-dev dependency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Hydrate context with TRACEPARENT for distributed trace correlation - Replace duplicated rate limiter with azdextutil.RateLimiter - Use azdextutil security helpers for path/shell validation - Use azdextutil.GetProjectDir for safe directory resolution Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Switch from azdextutil.SetupTracingFromEnv to azdext.NewContext() for proper OTel tracing - Replace hand-written metadata with azdext.GenerateExtensionMetadata() for framework-conforming schema Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Filter get_environment to only return AZD_*/AZURE_*/ARM_* prefixed vars (security) - Remove meaningless lifecycle event handler stubs from listen command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace azdext.NewContext() (starts from context.Background()) with
propagation.TraceContext{}.Extract() on the existing cobra context,
preserving Ctrl+C handling and other context values.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Filter secret-bearing env vars (SECRET, PASSWORD, KEY, TOKEN, etc.) - Switch from deprecated ValidatePath to security.ValidatePathWithinBases - Normalize shell binary names to lowercase for cross-platform compat Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Website Preview
Preview has been cleaned up as the PR was closed. |
Pin go.mod to azd-core v0.5.2-0.20260223042348-df3319c65059 which includes lint fixes, macOS symlink test fix, and gofmt formatting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Check error return of fmt.Fprintln in metadata command - Fix gofmt formatting (CRLF -> LF line endings) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Use t.Setenv in tests instead of unchecked os.Setenv - Simplify lambda wrappers (gocritic unlambda) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
🚀 Test This PRA preview build ( 🌐 Website PreviewLive Preview: https://jongio.github.io/azd-exec/pr/37/ One-Line Install (Recommended)PowerShell (Windows): iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-exec/main/cli/scripts/install-pr.ps1) } -PrNumber 37 -Version 0.3.7-pr37"Bash (macOS/Linux): curl -fsSL https://raw.githubusercontent.com/jongio/azd-exec/main/cli/scripts/install-pr.sh | bash -s 37 0.3.7-pr37UninstallWhen you're done testing: PowerShell (Windows): iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-exec/main/cli/scripts/uninstall-pr.ps1) } -PrNumber 37"Bash (macOS/Linux): curl -fsSL https://raw.githubusercontent.com/jongio/azd-exec/main/cli/scripts/uninstall-pr.sh | bash -s 37Build Info:
What to Test: |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace pseudo-version with official tagged release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fully adopts the azd extension framework capabilities: metadata, lifecycle-events, mcp-server, and distributed tracing. Adds an MCP server with 4 tools for script execution and environment introspection, with comprehensive security hardening.
Extension Framework Capabilities Added
azdext.GenerateExtensionMetadata()for IntelliSense and CLI helpazdext.ExtensionHost(no stub handlers)exec_script,exec_inline,list_shells,get_environmentSecurity Hardening
security.ValidatePathWithinBases()for script path containmentget_environmentTest Coverage
Changes