feat: add 'website' field to extension registry.json schema#6904
Conversation
Add an optional 'website' field to ExtensionMetadata so each extension in a multi-extension registry can have its own documentation URL. Changes: - Add Website field to ExtensionMetadata struct (omitempty for backward compat) - Display website in 'azd extension show' output when present - Add registry_test.go with tests for JSON parsing of the website field Refs Azure#6897 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds an optional website field to the extension registry schema, enabling each extension in a multi-extension registry to advertise its own documentation or homepage URL. The change addresses a limitation where the awesome-azd gallery could only apply a single website to all extensions from a registry. The implementation uses the omitempty JSON tag for backward compatibility, ensuring existing registries continue to work unchanged.
Changes:
- Added
Websitefield toExtensionMetadatastruct withjson:"website,omitempty"tag - Updated
azd extension showcommand to conditionally display website URL when present - Added comprehensive tests covering JSON parsing, omitempty behavior, and multi-extension scenarios
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cli/azd/pkg/extensions/registry.go |
Adds optional Website string field to ExtensionMetadata struct |
cli/azd/cmd/extension.go |
Updates extensionShowItem struct and display logic to show website URL |
cli/azd/pkg/extensions/registry_test.go |
New test file with 4 test cases validating website field behavior |
Comments suppressed due to low confidence (1)
cli/azd/cmd/extension.go:449
- The Website field should be displayed earlier in the Extension Information section to match the struct field ordering and be more prominent. Consider inserting it after "Description" and before "Source" for better consistency. The website is user-facing documentation and should be displayed prominently, not at the end of the section.
Update the display logic to insert the website conditionally between Description and Source, rather than appending it after Namespace.
if t.Website != "" {
extensionInfo = append(extensionInfo, []string{"Website", ":", t.Website})
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add the website property to the Extension definition in registry.schema.json to match the Go struct. Uses type string with format uri for URL validation. Addresses review feedback from copilot-pull-request-reviewer. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
Add an optional
websitefield to the extension schema inregistry.jsonso each extension in a multi-extension registry can have its own documentation website URL.Closes #6897
Changes
cli/azd/pkg/extensions/registry.goWebsite stringfield toExtensionMetadatastruct withjson:"website,omitempty"tagcli/azd/cmd/extension.goazd extension showoutput when presentcli/azd/pkg/extensions/registry_test.goSchema Change
The
ExtensionMetadatastruct now includes an optionalwebsitefield:{ "extensions": [ { "id": "example.extension", "displayName": "Example Extension", "description": "...", "website": "https://example.com/docs", "versions": [...] } ] }Testing
extensionspackage test suite passes (no regressions)cmdpackage builds cleanlyBackward Compatibility
websitefield usesomitempty— existing registries without the field continue to work unchangedazd extension showonly displays the website line when the field is present