Migrate 1P extensions to azdext.NewExtensionRootCommand and remove reserved-flag conflicts#7955
Migrate 1P extensions to azdext.NewExtensionRootCommand and remove reserved-flag conflicts#7955
Conversation
Agent-Logs-Url: https://github.com/Azure/azure-dev/sessions/75322263-b3bb-41fd-8655-49629099f22c Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
jongio
left a comment
There was a problem hiding this comment.
The migration to NewExtensionRootCommand is a solid direction - centralizes flag management in the SDK and removes duplicated registration across extensions. CI is green.
Two things to address:
1. Breaking shorthand: -n removed for --environment
Both azure.ai.finetune and azure.ai.models init commands previously used -n as shorthand for --environment. The SDK uses -e. Users who relied on init -n myenv will get an error. Worth a CHANGELOG entry noting this change.
2. Pseudo-version dependency
Both finetune and models pin to a pseudo-version (v1.24.3-0.20260428202310-4d8945f915d8). Per AGENTS.md, extensions should use semver tags. Is there a planned SDK release before this merges, or is this intentionally temporary?
The updated SDK dependency also pulls in ~40 new indirect deps (Azure RM packages for cosmos, container registry, keyvault, machine learning, etc., plus copilot-sdk and azure-devops-go-api). None are used directly by these extensions. The comment in extension_command.go already notes the CLI helpers are candidates for extraction into an azdext/cobra sub-package - that'd help here.
| github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 | ||
| github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/cognitiveservices/armcognitiveservices v1.8.0 | ||
| github.com/azure/azure-dev/cli/azd v1.23.13 | ||
| github.com/azure/azure-dev/cli/azd v1.24.3-0.20260428202310-4d8945f915d8 |
There was a problem hiding this comment.
This pseudo-version replaces the semver v1.23.13 tag. Per AGENTS.md convention, extensions should pin to semver tags (cli/azd/vX.Y.Z). If the SDK features this PR needs (RegisterFlagOptions, NewExtensionRootCommand) aren't in a released tag yet, consider coordinating the SDK release first, or add a TODO comment here noting it should be updated to the next stable tag.
| Short: fmt.Sprintf("Initialize a new AI Fine-tuning project. %s", color.YellowString("(Preview)")), | ||
| Args: cobra.NoArgs, | ||
| RunE: func(cmd *cobra.Command, args []string) error { | ||
| if extCtx != nil { |
There was a problem hiding this comment.
This reads environment from extCtx.Environment (populated by the SDK's -e/--environment flag). Previously this command had -n as the shorthand for --environment. Users who relied on init -n myenv will break silently - they'll get an unknown shorthand flag error.
Aligning to -e is the right call long-term (matches azd convention), but this should be documented as a breaking change in the release notes.
|
Hi @@copilot. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
Audits the remaining first-party extensions in
cli/azd/extensions/and migrates them toazdext.NewExtensionRootCommand, removing flags that collide with azd's reserved global flag set (--debug,--no-prompt,--cwd,-e/--environment,-o/--output, etc.). Mirrors the work already done forazure.ai.agents(#7947);microsoft.azd.extensionsis intentionally out of scope (tracked in #7951).Per-extension changes
azure.ai.finetune— SDK root;init --environment/-nremoved (readsextCtx.Environment);jobs showandjobs listswap their local-o/--outputforazdext.RegisterFlagOptions(defaulttable, allowedtable,json[,yaml]).azure.ai.models— SDK root;init --environment/-nremoved;custom show/custom listuseRegisterFlagOptionsfor--output;custom deletereads--no-promptfromextCtx.azure.appservice— SDK root;swapreads--no-promptfromextCtxinstead of the droppedrootFlagsDefinition.azure.coding-agent— SDK root; also drops the conflictingconfig --debug(the issue lists only the root flag, but the same--debugis re-registered on the subcommand and would still failValidateNoReservedFlagConflicts). Reads fromextCtx.Debug.microsoft.azd.concurx— SDK root; duplicateup --debugremoved (readsextCtx.Debug).microsoft.azd.demo— adoptsNewExtensionRootCommandfor consistency (no flag conflicts).SDK version
azure.ai.finetuneandazure.ai.modelsgo.modbumped to acli/azdrevision that includesRegisterFlagOptions(#7826). The other four extensions only depend onNewExtensionRootCommand(already incli/azd v1.23.13) so theirgo.modis unchanged.microsoft.azd.demobuilds against the in-treecli/azdmodule.Migration shape