Require --yes with --non-interactive for destroy cmd#16805
Conversation
Added validation to enforce --yes when --non-interactive is used with the destroy command, returning a localized error if omitted. Introduced a new NonInteractiveRequiresYes resource and updated all localization files. Expanded DestroyCommandTests to cover new validation, multiple CLI permutations, and error scenarios for failed destroy activities. Fix #16623
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16805Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16805" |
|
/backport to release/13.3 |
|
Started backporting to |
There was a problem hiding this comment.
Pull request overview
Updates the Aspire CLI destroy command to fail fast when --non-interactive is used without explicit confirmation via --yes, and adds coverage to ensure destroy pipeline failures propagate a non-zero exit code.
Changes:
- Added a
DestroyCommandvalidator requiring--yeswhen--non-interactiveis specified. - Introduced a new localized resource string (
NonInteractiveRequiresYes) and propagated it to allDestroyCommandStringslocalization files. - Expanded
DestroyCommandTeststo cover argument permutations and non-zero exit code behavior when destroy activities report failure.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Commands/DestroyCommandTests.cs | Adds fail-fast validation tests for --non-interactive without --yes, plus a test ensuring activity-reported failures return a non-zero exit code. |
| src/Aspire.Cli/Commands/DestroyCommand.cs | Adds a command validator enforcing --yes when running destroy in non-interactive mode. |
| src/Aspire.Cli/Resources/DestroyCommandStrings.resx | Adds the NonInteractiveRequiresYes localized string. |
| src/Aspire.Cli/Resources/DestroyCommandStrings.Designer.cs | Regenerates strongly-typed accessor for NonInteractiveRequiresYes. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.cs.xlf | Adds NonInteractiveRequiresYes entry for Czech localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.de.xlf | Adds NonInteractiveRequiresYes entry for German localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.es.xlf | Adds NonInteractiveRequiresYes entry for Spanish localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.fr.xlf | Adds NonInteractiveRequiresYes entry for French localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.it.xlf | Adds NonInteractiveRequiresYes entry for Italian localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.ja.xlf | Adds NonInteractiveRequiresYes entry for Japanese localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.ko.xlf | Adds NonInteractiveRequiresYes entry for Korean localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.pl.xlf | Adds NonInteractiveRequiresYes entry for Polish localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.pt-BR.xlf | Adds NonInteractiveRequiresYes entry for Portuguese (Brazil) localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.ru.xlf | Adds NonInteractiveRequiresYes entry for Russian localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.tr.xlf | Adds NonInteractiveRequiresYes entry for Turkish localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.zh-Hans.xlf | Adds NonInteractiveRequiresYes entry for Simplified Chinese localization. |
| src/Aspire.Cli/Resources/xlf/DestroyCommandStrings.zh-Hant.xlf | Adds NonInteractiveRequiresYes entry for Traditional Chinese localization. |
Files not reviewed (1)
- src/Aspire.Cli/Resources/DestroyCommandStrings.Designer.cs: Language not supported
|
/deployment-tests |
|
🎬 CLI E2E Test Recordings — 76 recordings uploaded (commit View all recordings
📹 Recordings uploaded automatically from CI run #25406378054 |
|
No documentation PR is required for this change. Reason: This PR adds a validation that requires
|
Added validation to enforce --yes when --non-interactive is used with the destroy command, returning a localized error if omitted. Introduced a new NonInteractiveRequiresYes resource and updated all localization files. Expanded DestroyCommandTests to cover new validation, multiple CLI permutations, and error scenarios for failed destroy activities. Fix microsoft#16623
Added validation to enforce --yes when --non-interactive is used with the destroy command, returning a localized error if omitted. Introduced a new NonInteractiveRequiresYes resource and updated all localization files. Expanded DestroyCommandTests to cover new validation, multiple CLI permutations, and error scenarios for failed destroy activities.
Fix #16623
Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist