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

Fixes for installing .ckan files and DarkKAN mods #4006

Merged
merged 1 commit into from
Jan 23, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Jan 23, 2024

Problems

@JonnyOThan has been working with .ckan files for mods that aren't indexed yet and finding lots of bugs:

  • ckan install -c currently doesn't work. If you use it with a module that's in one of your metadata repos, it'll try to install the version from the repo, and for mods that aren't there, it reports that it can't find the mod even though it's right there in the file.
  • If you install from a .ckan file in GUI and it depends on an identifier that doesn't exist, you end up stuck with an hourglass cursor on the mod list with an error in the status bar, and some parts of the app window are disabled.
  • If you install from a .ckan file in GUI and it fails, clicking Retry takes you to the change set tab, but it's empty, and trying to install again crashes.
  • If you install some modules from .ckan files that aren't indexed in a metadata repo, the Relationships tab can throw exceptions when you try to look at it.

Causes

  • ckan install -c used to work by adding the module from the file into the registry's available modules list and then pretending that you had typed identifier=version for that module at the command line. That ceased to be a thing when available modules were divested from the registry, but the command wasn't updated to work with the newer systems.
  • An exception was being thrown when ModuleInstaller.FindRecommendations tried to find all the dependencies of the changeset, since one of them doesn't exist, which happened after the cursor was set to hourglass and before the progress tab was activated.
  • IRegistryQuerier.CompatibleGameVersions was using AvailableByIdentifier without catching the exceptions it can throw when the mod isn't in the available list.

Changes

  • Now ckan install is refactored to operate in terms of CkanModules instead of strings, generated either by looking up the given identifiers in the available modules or by loading them from .ckan files.
  • Now ckan install's usage message includes the -c form and points out that it can handle URLs.
  • Now if you install from a .ckan file in GUI, the first step is the changeset tab showing the modules from the files you selected (yes, multiple are allowed). This allows you to confirm what you're installing and also makes Retry work if there's a problem.
  • Now if ModuleInstaller.FindRecommendations throws an exception during the install flow, we activate the progress tab so you can see the error and turn off the hourglass cursor
    image
  • Now IRegistryQuerier.CompatibleGameVersions catches AvailableByIdentifier's exceptions, tries to fall back to installed mods, and just returns the empty string if nothing is found at all

Fixes #4005.

@HebaruSan HebaruSan added Bug Enhancement GUI Issues affecting the interactive GUI Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc. labels Jan 23, 2024
@HebaruSan HebaruSan merged commit 5d4a210 into KSP-CKAN:master Jan 23, 2024
8 checks passed
@HebaruSan HebaruSan deleted the fix/install-c branch January 23, 2024 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Enhancement GUI Issues affecting the interactive GUI Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening the relationships tab with locally-installed .ckan files throws an exception
1 participant