Skip to content
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

Package type Dependency graph #1341

Merged
merged 109 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
9c72b02
first tests for show depenencies feature
fzanollo Jun 4, 2021
0a81ec5
show dependencies feature for show, install, need to change message
fzanollo Jun 4, 2021
b416985
showflow output changed
fzanollo Jun 9, 2021
c848824
install commands shows dependencies as in specs
fzanollo Jun 10, 2021
688cbe5
tests for informing dependencies on commands: show, install, upgrade,…
fzanollo Jun 10, 2021
7b488f1
refactor install flow
fzanollo Jun 11, 2021
c8d02ea
change import command from install flow (install multiple)
fzanollo Jun 11, 2021
72fd209
import shows all dependencies together
fzanollo Jun 11, 2021
d6d0c53
show dependencies for validate and uninstall
fzanollo Jun 11, 2021
d3063f2
tests for validate and uninstall
fzanollo Jun 11, 2021
9d05f6f
create show dependencies exp feature
fzanollo Jun 12, 2021
e3ccc8e
test for validate command
fzanollo Jun 14, 2021
44fe9e2
put functionality under experimental feature check
fzanollo Jun 14, 2021
a69b930
enable show dep experimental feature on unit test cases
fzanollo Jun 14, 2021
8bb3aa1
change experimental feature name
fzanollo Jun 15, 2021
9737ae1
remove info stream characters on testcase
fzanollo Jun 15, 2021
49c7fea
move check for exp feature inside report function, create new Depende…
fzanollo Jun 15, 2021
74d29ff
DependenciesFlow header and cpp inside Workflow
fzanollo Jun 15, 2021
b7590c3
–change representation of Dependency, create DependencyType and Depen…
fzanollo Jun 18, 2021
b04225a
dependencies context data is of type DependencyList (not optional)
fzanollo Jun 18, 2021
2a620d8
fix spelling errors
fzanollo Jun 18, 2021
40e05b4
ApplyTo function, can receibe a lambda function to apply on specific …
fzanollo Jun 18, 2021
d8c411f
localize user strings, code style changes, validate report dependenci…
fzanollo Jun 22, 2021
9f3961a
change uninstall flow (gets dependencies from package version), make …
fzanollo Jun 22, 2021
1c6347f
add missing report dep on upgrade
fzanollo Jun 22, 2021
c785b14
Update src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw
fzanollo Jun 23, 2021
0a31f79
compare id with ICU case insensitive
fzanollo Jun 23, 2021
af7b09c
move dependencies related functions to DependenciesFlow, ReportDepend…
fzanollo Jun 23, 2021
8fce81d
TODO to get dependencies on uninstall context, remove testcase for no…
fzanollo Jun 23, 2021
af036e4
wfIds not temporary
fzanollo Jun 23, 2021
3388ea7
DependencyList Add function checks for existence and updates min vers…
fzanollo Jun 23, 2021
f07fdc6
root dependencies are used when installer are not present, otherwise …
fzanollo Jun 24, 2021
5eb6270
add tests names to spelling expect
fzanollo Jun 24, 2021
c8e9e27
merge commits from master
fzanollo Jun 24, 2021
0bbe093
style and details
fzanollo Jun 24, 2021
f0f3676
fix merge conflicts
fzanollo Jun 24, 2021
dd03b85
spellcheck exception
fzanollo Jun 24, 2021
2985cd5
detail when adding dep
fzanollo Jun 28, 2021
021e326
proto
fzanollo Jun 29, 2021
4e623d4
divide identity report and installation disclaimer from actual instal…
fzanollo Jun 29, 2021
8f39bd6
Merge branch 'showDependenciesFeature' into dependencyGraph
fzanollo Jun 30, 2021
160242b
proto tests
fzanollo Jul 6, 2021
06ddcd6
testing
fzanollo Jul 7, 2021
e6d7b82
questions
fzanollo Jul 8, 2021
62ef1c7
test for dependency graph and fixes
fzanollo Jul 12, 2021
0ed66ee
check loop logic change
fzanollo Jul 12, 2021
6eb87bf
const & dep graph
fzanollo Jul 12, 2021
d69b3e3
with installation order
fzanollo Jul 12, 2021
b67708c
two more tests
fzanollo Jul 12, 2021
d5f6050
change map key to Dependency (missing min version check)
fzanollo Jul 12, 2021
c737c8d
Dependency implements operand<
fzanollo Jul 13, 2021
087dd8d
Dependency.MinVersion type is AppInstaller::Utility::Version
fzanollo Jul 13, 2021
46d9d0b
choose installer using ManifestComparator
fzanollo Jul 13, 2021
c82f234
getting composite source
fzanollo Jul 14, 2021
aebac6b
Drop const from the returned type of GetSource
JohnMcPMS Jul 14, 2021
3bac9ab
add check for min version
fzanollo Jul 14, 2021
0e1fc7f
Merge branch 'master' into dependencyGraph
fzanollo Jul 14, 2021
3ebfb65
Merge remote-tracking branch 'john/dropconst' into dependencyGraph
fzanollo Jul 14, 2021
da52d81
spelling
fzanollo Jul 15, 2021
0a8f069
add dependencies source
fzanollo Jul 15, 2021
d70c55d
new parameter dependency source, open source can set up both: source …
fzanollo Jul 15, 2021
2e6f29f
spelling
fzanollo Jul 15, 2021
9d39e48
DependencyGraph struct, manages only node/adjacent addition, loop check
fzanollo Jul 16, 2021
00489c6
OpenSource() missing
fzanollo Jul 16, 2021
572c2bf
add adjacents to spellchecker
fzanollo Jul 16, 2021
70978ee
graph logic is ok, installer selection and test source settings needs…
fzanollo Jul 19, 2021
743ca96
dependency-source argument
fzanollo Jul 19, 2021
edde7c0
typo
fzanollo Jul 19, 2021
25f30de
DependencyGraph receives function to search for dependencies, auto-bu…
fzanollo Jul 21, 2021
ef3e6a0
dependency table, create with id
fzanollo Jul 22, 2021
e371668
dependency graph logic moved to manifest common
fzanollo Jul 23, 2021
e6c00d6
refactor
fzanollo Jul 26, 2021
7b4238a
break InstallMultiple workflow into two
fzanollo Jul 27, 2021
a05f384
SelectInstallerFromMetadata does not receive context
fzanollo Jul 28, 2021
4a1aec8
leaving workflow to work as in report dependencies, with the addition…
fzanollo Jul 28, 2021
29bc5fd
move dependencies to context data
fzanollo Jul 28, 2021
48fbb52
dependency graph + installation, all tests passed
fzanollo Jul 29, 2021
43099ed
information detail, delete temp folder
fzanollo Jul 29, 2021
8eede60
merge with master
fzanollo Aug 3, 2021
70cc93e
Merge branch 'showDependenciesFeature' into dependencyGraph
fzanollo Aug 3, 2021
40abbda
more testing for dependencies on install command
fzanollo Aug 5, 2021
e8b4e6a
valid min version test
fzanollo Aug 6, 2021
cadeaa8
typo
fzanollo Aug 6, 2021
eb91317
Merge branch 'master' into showDependenciesFeature
fzanollo Aug 6, 2021
622d39c
Merge branch 'showDependenciesFeature' into dependencyGraph
fzanollo Aug 6, 2021
d67fabd
Merged from master
Sep 30, 2021
d9f41c8
temp stash
Oct 1, 2021
1bd88aa
temp stash
Oct 1, 2021
609f791
Fixed merge errors
Oct 1, 2021
fddc0ae
Merge branch 'master' of https://github.com/hackean-msft/winget-cli i…
Oct 5, 2021
ed7e390
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
Oct 5, 2021
87b9e10
More cleanup
Oct 5, 2021
4f67502
Removed prompt for failed dependencies
Oct 11, 2021
bfd8c47
Removed declarations for dependencies table
Oct 11, 2021
a24cff0
Spell check fix
Oct 11, 2021
851bda6
Merged and fixed merge conflicts
Oct 11, 2021
68e9c53
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
Oct 14, 2021
212ffa6
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
Oct 16, 2021
4d4af06
Addressed pr comments.
Oct 19, 2021
681d88c
Addressed PR comments 2
Oct 19, 2021
1210a5f
Code cleanup
Oct 20, 2021
5b6a4fb
Merge branch 'master' into dependencyGraph
hackean-msft Oct 20, 2021
e2e5f61
Fixed spell check error
Oct 20, 2021
ee9ea0b
Merge branch 'dependencyGraph' of https://github.com/fzanollo/winget-…
Oct 20, 2021
160c4c6
Merge branch 'master' of https://github.com/microsoft/winget-cli into…
Oct 20, 2021
ad46ffe
Refactored DependencyGraph
Oct 22, 2021
2a247bd
Fixed typos
Oct 23, 2021
b5788b9
Code refactor and typo fix
Oct 23, 2021
d7a0391
Pulled and fixed merge conficts
Oct 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
abcd
adjacents
activatable
adml
admx
Expand Down Expand Up @@ -38,6 +39,7 @@ Baz
bcp
Beigi
bfd
BFirst
bght
bitmask
bkup
Expand Down
2 changes: 2 additions & 0 deletions src/AppInstallerCLICore/AppInstallerCLICore.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@
<ClInclude Include="VTSupport.h" />
<ClInclude Include="PackageCollection.h" />
<ClInclude Include="Workflows\CompletionFlow.h" />
<ClInclude Include="Workflows\DependencyNodeProcessor.h" />
<ClInclude Include="Workflows\DownloadFlow.h" />
<ClInclude Include="Workflows\ImportExportFlow.h" />
<ClInclude Include="Workflows\MsiInstallFlow.h" />
Expand Down Expand Up @@ -325,6 +326,7 @@
<ClCompile Include="Resources.cpp" />
<ClCompile Include="VTSupport.cpp" />
<ClCompile Include="Workflows\CompletionFlow.cpp" />
<ClCompile Include="Workflows\DependencyNodeProcessor.cpp" />
<ClCompile Include="Workflows\DownloadFlow.cpp" />
<ClCompile Include="Workflows\ImportExportFlow.cpp" />
<ClCompile Include="Workflows\MsiInstallFlow.cpp" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
<ClInclude Include="Workflows\DownloadFlow.h">
<Filter>Workflows</Filter>
</ClInclude>
<ClInclude Include="Workflows\DependencyNodeProcessor.h">
<Filter>Workflows</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="pch.cpp">
Expand Down Expand Up @@ -310,7 +313,10 @@
<ClCompile Include="Workflows\SettingsFlow.cpp">
<Filter>Workflows</Filter>
</ClCompile>
<ClCompile Include="Workflows\DlownloadFlow.cpp">
<ClCompile Include="Workflows\DownloadFlow.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Workflows\DependencyNodeProcessor.cpp">
<Filter>Workflows</Filter>
</ClCompile>
</ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/AppInstallerCLICore/Argument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace AppInstaller::CLI
return Argument{ "command", NoAlias, Args::Type::Command, Resource::String::CommandArgumentDescription, ArgumentType::Standard, Argument::Visibility::Help };
case Args::Type::Source:
return Argument{ "source", 's', Args::Type::Source, Resource::String::SourceArgumentDescription, ArgumentType::Standard };
case Args::Type::DependencySource:
return Argument{ "dependency-source", NoAlias, Args::Type::DependencySource, Resource::String::DependencySourceArgumentDescription, ArgumentType::Standard };
case Args::Type::Count:
return Argument{ "count", 'n', Args::Type::Count, Resource::String::CountArgumentDescription, ArgumentType::Standard };
case Args::Type::Exact:
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Commands/ExportCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace AppInstaller::CLI

context <<
Workflow::ReportExecutionStage(Workflow::ExecutionStage::Discovery) <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed) <<
Workflow::SearchSourceForMany <<
Workflow::HandleSearchResultFailures <<
Expand Down
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/Commands/InstallCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace AppInstaller::CLI
Argument::ForType(Args::Type::Override),
Argument::ForType(Args::Type::InstallLocation),
Argument::ForType(Args::Type::HashOverride),
Argument::ForType(Args::Type::DependencySource),
Argument::ForType(Args::Type::AcceptPackageAgreements),
Argument::ForType(Args::Type::CustomHeader),
Argument::ForType(Args::Type::AcceptSourceAgreements),
Expand Down
4 changes: 2 additions & 2 deletions src/AppInstallerCLICore/Commands/ListCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace AppInstaller::CLI
void ListCommand::Complete(Execution::Context& context, Execution::Args::Type valueType) const
{
context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed);

switch (valueType)
Expand Down Expand Up @@ -73,7 +73,7 @@ namespace AppInstaller::CLI
context.SetFlags(Execution::ContextFlag::TreatSourceFailuresAsWarning);

context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed) <<
Workflow::SearchSourceForMany <<
Workflow::HandleSearchResultFailures <<
Expand Down
4 changes: 2 additions & 2 deletions src/AppInstallerCLICore/Commands/SearchCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace AppInstaller::CLI
{
case Execution::Args::Type::Query:
context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::RequireCompletionWordNonEmpty <<
Workflow::SearchSourceForManyCompletion <<
Workflow::CompleteWithMatchedField;
Expand All @@ -71,7 +71,7 @@ namespace AppInstaller::CLI
context.SetFlags(Execution::ContextFlag::TreatSourceFailuresAsWarning);

context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::SearchSourceForMany <<
Workflow::HandleSearchResultFailures <<
Workflow::EnsureMatchesFromSearchResult(false) <<
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Commands/ShowCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace AppInstaller::CLI
else
{
context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::SearchSourceForSingle <<
Workflow::HandleSearchResultFailures <<
Workflow::EnsureOneMatchFromSearchResult(false) <<
Expand Down
4 changes: 2 additions & 2 deletions src/AppInstallerCLICore/Commands/UninstallCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace AppInstaller::CLI
}

context <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed);

switch (valueType)
Expand Down Expand Up @@ -106,7 +106,7 @@ namespace AppInstaller::CLI
// open the sources where to search for the package
context <<
Workflow::ReportExecutionStage(ExecutionStage::Discovery) <<
Workflow::OpenSource <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed);

// find the uninstaller
Expand Down
8 changes: 4 additions & 4 deletions src/AppInstallerCLICore/Commands/UpgradeCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace AppInstaller::CLI
}

context <<
OpenSource <<
OpenSource() <<
OpenCompositeSource(Repository::PredefinedSource::Installed);

switch (valueType)
Expand Down Expand Up @@ -128,9 +128,9 @@ namespace AppInstaller::CLI
}

context <<
ReportExecutionStage(ExecutionStage::Discovery) <<
OpenSource <<
OpenCompositeSource(Repository::PredefinedSource::Installed);
Workflow::ReportExecutionStage(ExecutionStage::Discovery) <<
Workflow::OpenSource() <<
Workflow::OpenCompositeSource(Repository::PredefinedSource::Installed);

if (ShouldListUpgrade(context))
{
Expand Down
1 change: 1 addition & 0 deletions src/AppInstallerCLICore/ExecutionArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ namespace AppInstaller::CLI::Execution
Help, // Show command usage
Info, // Show general info about WinGet
VerboseLogs, // Increases winget logging level to verbose
DependencySource, // Index source to be queried against for finding dependencies
CustomHeader, // Optional Rest source header
AcceptSourceAgreements, // Accept all source agreements

Expand Down
7 changes: 7 additions & 0 deletions src/AppInstallerCLICore/ExecutionContextData.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ namespace AppInstaller::CLI::Execution
Sources,
ARPSnapshot,
Dependencies,
DependencySource,
AllowedArchitectures,
Max
};
Expand Down Expand Up @@ -225,6 +226,12 @@ namespace AppInstaller::CLI::Execution
using value_t = Manifest::DependencyList;
};

template <>
struct DataMapping<Data::DependencySource>
{
using value_t = std::shared_ptr<Repository::ISource>;
};

template <>
struct DataMapping<Data::AllowedArchitectures>
{
Expand Down
12 changes: 12 additions & 0 deletions src/AppInstallerCLICore/Resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ namespace AppInstaller::CLI::Resource
WINGET_DEFINE_RESOURCE_STRINGID(CompleteCommandLongDescription);
WINGET_DEFINE_RESOURCE_STRINGID(CompleteCommandShortDescription);
WINGET_DEFINE_RESOURCE_STRINGID(CountArgumentDescription);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowInstall);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowSourceNotFound);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowSourceTooManyMatches);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowPackageVersionNotFound);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowNoInstallerFound);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowNoMinVersion);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowNoSuitableInstallerFound);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowNoMatches);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesFlowContainsLoop);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesManagementError);
WINGET_DEFINE_RESOURCE_STRINGID(DependenciesManagementExitMessage);
WINGET_DEFINE_RESOURCE_STRINGID(CountOutOfBoundsError);
WINGET_DEFINE_RESOURCE_STRINGID(DisabledByGroupPolicy);
WINGET_DEFINE_RESOURCE_STRINGID(Done);
Expand Down Expand Up @@ -265,6 +276,7 @@ namespace AppInstaller::CLI::Resource
WINGET_DEFINE_RESOURCE_STRINGID(SourceAgreementsTitle);
WINGET_DEFINE_RESOURCE_STRINGID(SourceArgArgumentDescription);
WINGET_DEFINE_RESOURCE_STRINGID(SourceArgumentDescription);
WINGET_DEFINE_RESOURCE_STRINGID(DependencySourceArgumentDescription);
WINGET_DEFINE_RESOURCE_STRINGID(SourceCommandLongDescription);
WINGET_DEFINE_RESOURCE_STRINGID(SourceCommandShortDescription);
WINGET_DEFINE_RESOURCE_STRINGID(SourceExportCommandLongDescription);
Expand Down
2 changes: 1 addition & 1 deletion src/AppInstallerCLICore/Workflows/CompletionFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace AppInstaller::CLI::Workflow
case Execution::Args::Type::Version:
case Execution::Args::Type::Channel:
context <<
Workflow::OpenSource;
Workflow::OpenSource();
break;
}

Expand Down
Loading