-
Notifications
You must be signed in to change notification settings - Fork 763
Fix user secrets saving for parameters - add IsAvailable property and CLI auto-initialization #13702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…crets initialization in CLI Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
…UserSecretsManager Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
…imeout to process execution Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
| InteractionInput? saveParameters = null; | ||
|
|
||
| if (showSaveToSecrets) | ||
| if (showSaveToSecrets && userSecretsManager.IsAvailable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot We don't want to skip the input, we want to disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e08d8d1. The "Save to user secrets" checkbox is now always shown but disabled when user secrets are not available, allowing users to see the option exists even when it's not configured.
… when user secrets not available Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
|
@copilot Run dotnet pack /p:ApiCompatGenerateSuppressionFile=true on Aspire.Hosting to update the supressions file |
Co-authored-by: davidfowl <95136+davidfowl@users.noreply.github.com>
Done in 028021c. The API compatibility suppressions file has been updated to account for the new |
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13702Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13702" |
Description
Since 13.1.0, parameters could not be saved to user secrets because projects lacked a UserSecretsId. This occurred when:
Changes:
Added
IUserSecretsManager.IsAvailableproperty - Returnstruewhen UserSecretsId is configured,falseotherwise. Implemented in bothUserSecretsManagerandNoopUserSecretsManager.Updated
ParameterProcessor- The "Save to user secrets" checkbox is now always displayed but disabled whenuserSecretsManager.IsAvailableisfalse. This provides visual feedback that the feature exists but isn't currently configured, rather than hiding it completely.Added CLI auto-initialization -
aspire runnow checks AppHost .csproj for UserSecretsId and runsdotnet user-secrets initif missing. Uses XDocument for robust XML parsing. Includes 30-second timeout to prevent hangs.Updated API compatibility suppressions - Added suppressions for the new
IsAvailableproperty and the additionalIUserSecretsManagerconstructor parameter inParameterProcessor.Example:
Checklist
<remarks />and<code />elements on your triple slash comments?Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.