Replace repo-reinst with kraken, handle in UIs #3344
Merged
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.
Background
When you refresh the registry, if the metadata for one of your installed modules has been changed upstream, CKAN will ask whether you want to reinstall those modules, and if you say Yes, it will reinstall them.
Problems
If one of your installed modules has been updated to have a new dependency on a virtual module, the reinstall fails:
Causes
Repo.HandleModuleChanges
creates its ownModuleInstaller
to try to do the reinstall.When a dependency on a virtual module is found,
ModuleInstaller
(via other classes) throwsTooManyModsProvideKraken
. The UI is supposed to catch this, prompt the user, add the module they chose to the change set, and try again. However, this is impossible in the case of a repo-reinstall, because the UI does not know what changesRepo.HandleModuleChanges
was attempting to make and cannot retry the repo update to fix it.Changes
Now instead of initiating a half-hearted attempt at doing a reinstall itself,
Repo.HandleModuleChanges
throws a newReinstallModulesKraken
to instruct the UI-specific calling code to reinstall the given modules. Cmdline, ConsoleUI, and GUI are updated to catch this exception and launch into their upgrade flows for the given modules.Now ConsoleUI and GUI perform upgrades after installs, so the installs (which contain the user's choice of virtual module providers) can satisfy dependencies needed by the upgrades.
As a side fix, Cmdline's
ckan upgrade
command is updated to handle prompting for virtual module providers (in a shared function also now called by the repo update code as needed).Fixes #1889.
Fixes #3335.