Skip to content

azd x: non-fatal metadata warnings and azd x init wizard polish#8197

Draft
Copilot wants to merge 1 commit into
copilot/migrate-to-new-extension-root-commandfrom
copilot/fix-azd-x-init-metadata-warnings
Draft

azd x: non-fatal metadata warnings and azd x init wizard polish#8197
Copilot wants to merge 1 commit into
copilot/migrate-to-new-extension-root-commandfrom
copilot/fix-azd-x-init-metadata-warnings

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

This PR makes azd x build extension metadata warnings non-fatal so they no longer abort azd x init, and rolls in several azd x init wizard fixes including Issue #8207.

image

Warning handling

azd x build previously treated validation warnings (e.g. missing providers when the service-target-provider capability is declared) as command failures. azd x init then aborted on those warnings, and its build subprocess output was discarded so the user never saw why.

  • ux.TaskList: a task returning (Warning, err) no longer cancels subsequent tasks, and warning details render with warning styling instead of error styling.
  • azd x build reports validation warnings via the ux.Warning state and reserves the ux.Error state for missing required fields.
  • validateExtensionMetadata is extracted as a shared helper so azd x init validates the in-memory schema directly. The old subprocess-output-parsing approach (ANSI stripping, marker probing, trailing-paren trimming) is gone.
  • Validation warning messages now name the YAML field, the capability that requires it, and what to set.
  • A short inline summary appears in the init task list; the full bulleted detail prints once below it.
  • The redundant "Local extension source already exists." message is removed (the (-) Skipped task line already conveys that).

Wizard UX (resolves #8207)

  • Confirmation prompt now defaults to "yes".
  • Tags prompt is optional and accepts empty input. Also fixes a pre-existing bug where parsed tags were discarded and tags: was always empty.
  • Dotted namespaces (ai.project) are translated into the actual command path (azd ai project <command>) when generating the usage field and the "Try out the extension" follow-up hint, matching how bindExtension registers nested namespaces. The namespace prompt help text now explains this behavior.
  • Generated extension.yaml includes a # yaml-language-server: $schema=... modeline pointing at the published schema URL so editor tooling validates the file out of the box.

Scaffolded extension root command

The Go template produced Use: "azd {{namespace}} <command> [options]", which made cobra parse "azd" as the command name and rendered Usage: azd [command] in the extension's own --help output. The template now uses the leaf segment of the namespace for both Name and Use (matching the convention in azure.ai.agents), so azd ai test --help displays Usage: test <command> [options] as expected.

Copilot AI linked an issue May 15, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix azd x init to handle extension metadata warnings Treat extension metadata warnings as non-fatal May 15, 2026
Copilot AI requested a review from JeffreyCA May 15, 2026 01:25
@JeffreyCA JeffreyCA force-pushed the copilot/fix-azd-x-init-metadata-warnings branch from 7072a55 to bac949d Compare May 15, 2026 18:08
@JeffreyCA JeffreyCA changed the base branch from main to copilot/migrate-to-new-extension-root-command May 15, 2026 18:12
`azd x build` previously treated validation warnings (e.g. missing
`providers` when `service-target-provider` is declared) as failures.
That aborted `azd x init`, and the build subprocess output was
discarded so the user never saw why.

Warning handling:
- `ux.TaskList`: a task returning `(Warning, err)` no longer cancels
  subsequent tasks, and warning detail renders with warning styling
  instead of error styling.
- Extract `validateExtensionMetadata` as a shared helper. `azd x init`
  validates the in-memory schema directly instead of shelling out to
  `azd x build` and parsing its rendered output.
- Show a short summary in the task list and the full bulleted detail
  once below it.
- Drop the redundant "Local extension source already exists." message.
- Rephrase warnings to name the YAML field, the capability that needs
  it, and what to set.

Wizard UX (resolves #8207):
- Confirmation prompt defaults to "yes".
- Tags prompt is optional; also fixes a pre-existing bug where parsed
  tags were discarded.
- Translate dotted namespaces (`ai.project`) into the actual command
  path (`azd ai project <command>`) in the generated `usage` field and
  follow-up hints, matching how `bindExtension` registers them.
- Generated `extension.yaml` includes a `yaml-language-server` header
  pointing at the published schema URL.

Scaffolded extension root command:
- The Go template set `Use` to `"azd <namespace> <command> [options]"`,
  so cobra parsed `"azd"` as the root command name and rendered
  `Usage: azd [command]`. Use the leaf segment of the namespace for
  both `Name` and `Use`, matching the convention in `azure.ai.agents`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JeffreyCA JeffreyCA force-pushed the copilot/fix-azd-x-init-metadata-warnings branch from bac949d to 47e5638 Compare May 15, 2026 18:18
@JeffreyCA JeffreyCA changed the title Treat extension metadata warnings as non-fatal azd x: non-fatal metadata warnings and azd x init wizard polish May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

azd x init treats extension metadata warnings as build failures

2 participants