Mark auto-install correctly when installing from .ckan file #2793
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.
Problem
If you install a module from a .ckan file, its dependencies will be marked as manually installed instead of auto-installed (see #2753).
Cause
When installing from the mod list, we use
ComputeChangeSetFromModList
to calculate the change set to display, butComputeUserChangeSet
generates the change set to install, soModuleInstaller.InstallList
can determine which modules were selected by the user:CKAN/GUI/Main.cs
Line 707 in 91c5bf4
CKAN/GUI/MainChangeset.cs
Lines 140 to 145 in 74ff9af
However, when installing from a .ckan file, we pass
ComputeChangeSetFromModList
's change set as if it was selected by the user:CKAN/GUI/MainInstall.cs
Lines 51 to 68 in 74ff9af
This makes
ModuleInstaller.InstallList
think that the user selected them all manually.Changes
Now we only pass the module from the .ckan file in the change set, so the dependencies can be marked as auto-installed. A few other minor changes are made along the way
List
instead ofHashSet
since we need aList
in the end anywayRelationshipResolver.DependsOnlyOpts()
instead ofRelationshipResolver.DefaultOpts()
with modifications after the fact, for consistency with other installation codepathsFixes #2792.