Repository navigation
Honor extension inputs and persist file source locations - #10181
Mohamed Hessien (m7md7sien) merged 5 commits into
Conversation
Reject trailing objects or documents in selected Foundry file references. Fail explicit unattended version requests when replacement confirmation is required, preserving installed state and normal cancellation semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). 24 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution Mohamed Hessien (@m7md7sien)! We will review the pull request and get back to you soon. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused changes satisfy both linked issues with comprehensive regression coverage and consistent documentation.
Review effort: Balanced
Findings: None
What changed in this PR
Strengthens Foundry reference parsing and extension version-pin enforcement.
Changes:
- Rejects referenced files containing invalid shapes or trailing documents/content.
- Fails unmet explicit version requests in non-interactive mode with actionable guidance.
- Adds regression coverage and documentation.
| File | Description |
|---|---|
docs/guides/creating-an-extension.md |
Documents strict Foundry reference validation. |
cli/azd/pkg/foundry/includes.go |
Enforces exactly one referenced object. |
cli/azd/pkg/foundry/includes_test.go |
Covers valid and invalid reference forms. |
cli/azd/docs/extensions/extension-resolution-and-versioning.md |
Documents non-interactive version-pin behavior. |
cli/azd/cmd/extension.go |
Returns an actionable error for blocked explicit versions. |
cli/azd/cmd/extension_install_version_test.go |
Covers version, source, force, and interaction cases. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/check-enforcer evaluate |
Resolve relative file-source locations with the existing working-directory and user-config lookup before saving. Preserve URL, bundle and absolute locations and cover directory changes, alias reuse and failed resolution without persistence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve empty reference guidance, retain only numeric trailing parse locations, and clarify explicit latest and noninteractive installation guidance. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Capture Cobra version flag presence after parsing and preserve bundle and multi-install conflicts. Cover parsed empty, omitted, and explicit version inputs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Wrap ErrInvalidArgValue so empty install versions retain actionable diagnostics and satisfy telemetry classification. Assert the sentinel for parsed empty version flags. Co-authored-by: Copilot App <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
|
Fixes #10180
Fixes #10179
Fixes #10183
Changes
Three cohesive extension-input contract fixes:
$reffile to contain exactly one YAML or JSON object. Reject trailing objects/documents/content without changing the YAML decoder's value types, aliases, overlays or path resolution.extension install --versionrequest cannot replace an installed extension in non-interactive mode without confirmation. Preserve installed version/files, same-version idempotence, default skip behavior, interactive cancellation and confirmed/forced replacement.The install error retains installed/target version and source context and explains
--forceand interactive alternatives. Related contributor and version-resolution documentation is updated. No dependency, version or changelog changes.Verification
c4d2ed79: six trailing-content/document cases and four unmet explicit-version cases failed their new assertions before the fix.c0ed8a2ab. Registration and loader code matched public main56ea5742. Relative registration from A succeeded but saved a relative location; an identical install from B exited 1. Original-directory, absolute-path, loopback-URL and configuration-directory fallback controls succeeded with matching artifact hashes.go vet,go fix -diff, pinned golangci-lint 2.11.4 and repository-configured cspell 8.13.1 pass.AZD_CONFIG_DIR, local registries/artifacts: nine explicit-pin command checks pass. Same-source/cross-source unconfirmed pins exit 1 with guidance and no success message; versions and hashes remain unchanged. Fresh install, same-version no-op, default skip, forced pin and cleanup retain their expected behavior.--cwd. Later-directory installs resolve the registered file and exact artifact; missing sources leave config bytes unchanged. All fixture installations were removed and the loopback server stopped. No shared profile, authentication or cloud resources used.Delivery boundary
The file-reference fix changes SDK source. Existing extensions compiled against released SDK v1.34.0 are not repaired by this PR or a host-only update. SDK release, extension consumption and rebuilt-extension acceptance remain separate follow-up gates. No local dependency replacement or unreleased SDK bump is included.
The old host's extra final success message on skipped installs was already corrected on main; this PR fixes the remaining successful exit status for an unmet explicit version request. The file-source registration fix likewise requires a future core binary release. No merge or release is performed by this change.