-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Configuration history support #4552
Conversation
@@ -54,7 +54,7 @@ namespace AppInstaller::CLI | |||
|
|||
namespace Configuration | |||
{ | |||
void ValidateCommonArguments(Execution::Args& execArgs) | |||
void ValidateCommonArguments(Execution::Args& execArgs, bool requireConfigurationSetChoice) |
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.
Why do we need requireConfigurationSetChoice? All the callers pass true.
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.
Since I made it an optional parameter defaulting to false, I didn't need to update both ConfigureValidateCommand
and ConfigureExportCommand
, which still call it.
public string InstanceIdentifier { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the configuration history item identifier. |
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.
This doesn't sound like All
Change
This change adds basic configuration history support. This is stored in an SQLite database that is shared by all of the configuration code (so both
winget.exe
and PowerShell modules will use the same database).The database currently holds a representation of every configuration set that has been applied (or at least attempted to be applied). Basic fields are stored directly, while more complex data is stored by serializing to YAML. While the database currently has only basic data, it will eventually contain status information for configuration units and other information used during synchronization of multiple configuration users.
Note
The dev build (based on
AICLI_DISABLE_TEST_HOOKS
) uses a different location for history to prevent local tests runs from adversely affecting the configuration usage experience for us.winget.exe interface changes
A new command is added under the
configure
top level command,list
. This shows details about items in the history.In addition to listing everything, one can provide the listed name of the configuration or any unique starting sequence of the identifier to select a single item to view. The selection options apply to all other commands that take in the history item parameter, and completion has been added for the parameter so that substrings of either identifier or name can be expanded.
The
configure
,configure show
, andconfigure test
commands have all had the history parameter added so that one can operate directly against a historical set.In addition to displaying information about history, the
configure list
command also allows for removing items from history with--remove
and creating a YAML file for the set with--output
.PowerShell interface changes
The existing cmdlet
Get-WinGetConfiguration
was updated to include parameter set options-All
to get all set from history and-InstanceIdentifier
to get a single one (these are exclusive with-File
and each other).Remove-WinGetConfigurationHistory
was added to allow removing sets from history, andConvertTo-WinGetConfigurationYaml
was added to enable serializing a set to a string.Validation
Many new tests are added for the interface implementations, as well as unit tests for the internals. The entire existing test base is also exercising writing to history.
Microsoft Reviewers: Open in CodeFlow