Resolve compatibility conflicts after multi-host merge #3991
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
ksp_version mixed with ksp_version_(min|max)
. GitHub download fallbacks for applicable mods KSP2-NetKAN#125 had to use overrides to get around this:Inputbinder
had adownload
property containing an array with one element. This is odd and unnecessary.Cause
ksp_version
/ksp_version_max
based on the game version the uploader selects that isn't available on GitHub, so the GitHub branch of the netkan inflates with justksp_version_min
, while the SpaceDock branch hasksp_version
, and the two branches are merged just by combining their JSON properties, which creates inconsistent metadata with bothksp_version
andksp_version_min
set.NetKAN.Model.Metadata.MergeJson
was generating an array regardless of how many download URLs it had. Single-host netkans weren't affected because that function is only called for multi-host.Changes
NetKAN.Services.ModuleService.ApplyVersions
(which is the logic we use elsewhere to combine compatibility from different sources) is used to reconcile these properties. This should make SpaceDock's compatibility carry through to the merged netkan without the need for overrides.download
property will be a string rather than an arrayI'll remove the overrides from KSP-CKAN/KSP2-NetKAN#125 in a subsequent pull request.