Netkan warning when include_only doesn't match #3805
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.
Problem
See KSP-CKAN/NetKAN#9614; a mod using
include_only
was changed to contain different filenames than we were trying to include, and there was no inflation error or warning.Cause
A different
include_only
list element (Assets
) still matched, so there were still files being installed. (The other mods from that PR had no otherinclude_only
members, so they hit the "No files found" error).Changes
Now the
InstallsFilesValidator
prints a warning if anyinclude_only
fails to match at least one installed file.The logic isn't super sophisticated or water tight; it can miss things in very complex setups (e.g., if two stanzas have the same
include_only
and one has a match and the other doesn't, that file will count towards both). But it catches what we need it to:I made this a warning instead of an error because
include_only
might conceivably be used to select things that might be in a mod, so human judgment should be applied to determine whether changes are needed. (And also because it's not water tight, so a false positive should not block merging.)