Fix upgrading and installing from .ckan in GUI #2680
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.
Problems
Upgrading modules in GUI is broken as of #2669. On Windows it throws an exception and crashes, on Linux the Apply changes button doesn't enable.
Cancelling out of a "recommends" based install from .ckan operation in GUI causes assorted issues. In addition to those detailed in #2676, the Apply changes button is enabled despite there being no change set.
Causes
See #2669 for details of the upgrade problem; to sum up, there's now an extra entry in an upgrade change set that throws exceptions when we try to use it. This entry says that its selection reason is
Installed
, even though the user asked us to upgrade / install it.GUI's install-from-ckan function can add a Metapackage to the registry (if that's what's in the .ckan file), which thereafter can appear in the mod list, change sets, etc. This can cause problems because it's missing properties that are otherwise always set such as
CkanModule.download
, and it's not useful to have it there.FailWaitDialog
was enabling the Apply changes button for cancelled installs.Changes
Now
RelationshipResolver
will not say the selection reason isInstalled
when we're installing an upgrade. This avoids the exception that is breaking upgrades.Fixes #2679.
Now GUI doesn't add Metapackages to the registry. And just in case, the change set logic checks whether a module is a Metapackage before attempting to access the
download
property. NowFailWaitDialog
allowsChangeSetUpdated
to govern the enablement of the Apply changes button, so once again it is enabled when there's a change set and disabled when there isn't.Fixes #2676.