-
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
Merged
+3,198
−170
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9c274fd
Refactor a few unpackaged paths into shared code
JohnMcPMS 48ec331
Start on database infra
JohnMcPMS aff0dd2
some work for dynamic storage base
JohnMcPMS 8fa3a75
much of the database work done, needs unit info and value set tables …
JohnMcPMS 4344626
needs work on value set table
JohnMcPMS 477ad2a
value set work
JohnMcPMS 82e2598
some more work on value table
JohnMcPMS 3bc54e0
Remove value set table in favor of just putting YAML in the database
JohnMcPMS 5f7c78a
finish using YAML for complex values
JohnMcPMS bcb17ad
stitching for compilation success
JohnMcPMS dfe98bb
work on last bit of product code in config core
JohnMcPMS 5101747
Finish config component code; builds
JohnMcPMS f33d9b1
Add a test that round trips the set through history and fix the issue…
JohnMcPMS cb2fef3
More unit tests
JohnMcPMS df1353d
wip on winget.exe integrations
JohnMcPMS 8de7edc
finish configure list functionality
JohnMcPMS 82a89a7
Add support to existing commands
JohnMcPMS 67c34fb
add history serialization and completion
JohnMcPMS af85897
e2e tests for winget
JohnMcPMS e5e6f04
wip: ps cmdlet updates for history
JohnMcPMS 682e69e
finish ps cmdlets and tests
JohnMcPMS ebf36f3
remove cmdlet
JohnMcPMS 4ee8adb
Move parameters for positional requirements
JohnMcPMS a6ee1ff
Fix copy-paste comment
JohnMcPMS c40c77f
Merge from master
JohnMcPMS 21530e0
Fix my bad merge
JohnMcPMS File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
#include "pch.h" | ||
#include "ConfigureListCommand.h" | ||
#include "Workflows/ConfigurationFlow.h" | ||
#include "ConfigurationCommon.h" | ||
|
||
using namespace AppInstaller::CLI::Workflow; | ||
|
||
namespace AppInstaller::CLI | ||
{ | ||
std::vector<Argument> ConfigureListCommand::GetArguments() const | ||
{ | ||
return { | ||
Argument{ Execution::Args::Type::ConfigurationHistoryItem, Resource::String::ConfigurationHistoryItemArgumentDescription, ArgumentType::Standard }, | ||
Argument{ Execution::Args::Type::OutputFile, Resource::String::OutputFileArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help }, | ||
Argument{ Execution::Args::Type::ConfigurationHistoryRemove, Resource::String::ConfigurationHistoryRemoveArgumentDescription, ArgumentType::Flag, Argument::Visibility::Help }, | ||
}; | ||
} | ||
|
||
Resource::LocString ConfigureListCommand::ShortDescription() const | ||
{ | ||
return { Resource::String::ConfigureListCommandShortDescription }; | ||
} | ||
|
||
Resource::LocString ConfigureListCommand::LongDescription() const | ||
{ | ||
return { Resource::String::ConfigureListCommandLongDescription }; | ||
} | ||
|
||
Utility::LocIndView ConfigureListCommand::HelpLink() const | ||
{ | ||
return "https://aka.ms/winget-command-configure#list"_liv; | ||
} | ||
|
||
void ConfigureListCommand::ExecuteInternal(Execution::Context& context) const | ||
{ | ||
context << | ||
VerifyIsFullPackage << | ||
CreateConfigurationProcessorWithoutFactory << | ||
GetConfigurationSetHistory; | ||
|
||
if (context.Args.Contains(Execution::Args::Type::ConfigurationHistoryItem)) | ||
{ | ||
context << SelectSetFromHistory; | ||
|
||
if (context.Args.Contains(Execution::Args::Type::OutputFile)) | ||
{ | ||
context << SerializeConfigurationSetHistory; | ||
} | ||
|
||
if (context.Args.Contains(Execution::Args::Type::ConfigurationHistoryRemove)) | ||
{ | ||
context << RemoveConfigurationSetHistory; | ||
} | ||
else | ||
{ | ||
context << ShowSingleConfigurationSetHistory; | ||
} | ||
} | ||
else | ||
{ | ||
context << ShowConfigurationSetHistory; | ||
} | ||
} | ||
|
||
void ConfigureListCommand::ValidateArgumentsInternal(Execution::Args& execArgs) const | ||
{ | ||
if ((execArgs.Contains(Execution::Args::Type::ConfigurationHistoryRemove) || | ||
execArgs.Contains(Execution::Args::Type::OutputFile)) && | ||
!execArgs.Contains(Execution::Args::Type::ConfigurationHistoryItem)) | ||
{ | ||
throw CommandException(Resource::String::RequiredArgError(ArgumentCommon::ForType(Execution::Args::Type::ConfigurationHistoryItem).Name)); | ||
} | ||
} | ||
|
||
void ConfigureListCommand::Complete(Execution::Context& context, Execution::Args::Type argType) const | ||
{ | ||
if (argType == Execution::Args::Type::ConfigurationHistoryItem) | ||
{ | ||
context << CompleteConfigurationHistoryItem; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
#pragma once | ||
#include "Command.h" | ||
|
||
namespace AppInstaller::CLI | ||
{ | ||
struct ConfigureListCommand final : public Command | ||
{ | ||
ConfigureListCommand(std::string_view parent) : Command("list", { "ls" }, parent) {} | ||
|
||
std::vector<Argument> GetArguments() const override; | ||
|
||
Resource::LocString ShortDescription() const override; | ||
Resource::LocString LongDescription() const override; | ||
|
||
Utility::LocIndView HelpLink() const override; | ||
|
||
protected: | ||
void ExecuteInternal(Execution::Context& context) const override; | ||
void ValidateArgumentsInternal(Execution::Args& execArgs) const override; | ||
void Complete(Execution::Context& context, Execution::Args::Type argType) const override; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andConfigureExportCommand
, which still call it.