-
Notifications
You must be signed in to change notification settings - Fork 274
Description
Summary
Move the extension registry validation logic from the standalone Node.js script in awesome-azd into the azd x extension itself (e.g. azd x validate-registry). This would make validation reusable outside of the GitHub Actions workflow and keep the source of truth for valid capabilities, platforms, and semver rules in one place.
Context
PR Azure/awesome-azd#749 adds azd extension integration into the awesome-azd gallery, including an automated submission workflow. As part of that workflow, a standalone Node.js validation script validates extension registry.json files before they're added to the gallery.
@wbreza suggested that these checks should be built directly into the azd x extension so they can be invoked from the workflow and by extension authors locally.
Current Validation Logic (to migrate)
The script currently validates:
- Required fields:
id,displayName,description,versions - Valid capabilities:
custom-commands,lifecycle-events,mcp-server,service-target-provider,framework-service-provider,metadata - Semver version format: Strict regex
/^\d+\.\d+\.\d+(-[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)?$/ - Platform artifact structure: Valid
os/archcombinations (windows/amd64,darwin/arm64,linux/amd64, etc.) with requiredurlfield - Extension ID format: Dot-separated namespace (e.g.
jongio.azd.app) - Version ordering: Ensures latest stable version is selected correctly (stable > pre-release)
Proposed CLI Integration
azd x validate-registry ./registry.json
# Validate a remote registry.json by URL
azd x validate-registry https://raw.githubusercontent.com/jongio/azd-app/main/registry.json
# Could also be used in CI/CD
azd x validate-registry $REGISTRY_URL --json --strict
Benefits
- Single source of truth: Capabilities, platforms, and validation rules defined once in the CLI
- Local validation: Extension authors can validate before submitting
- Workflow integration: awesome-azd workflow calls
azd x validate-registryinstead of maintaining a separate script - Consistency: Same validation in CLI and gallery submission
- Extensibility: Easy to add new checks (e.g. artifact URL reachability, signature verification)
Acceptance Criteria
-
azd x validate-registrycommand accepts a local path or URL to aregistry.json - Validates all fields currently checked by the Node.js script
- Returns structured JSON output for CI integration (
--jsonflag) - Exit code 0 on success, non-zero on validation failure
- Update awesome-azd workflow to use
azd x validate-registryinstead of the Node.js script - Document the command in azd extension docs