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

Catch nested GameData folders in Netkan #2948

Merged
merged 1 commit into from
Jan 6, 2020

Conversation

HebaruSan
Copy link
Member

Motivation

#2788 created Netkan validation checks based on the legacy Perl bot and the pull request validation scripts. There's one remaining check that isn't migrated yet:

https://github.com/KSP-CKAN/xKAN-meta_testing/blob/73cd8a319ae8833e40b52b49976afe49d00db30b/NetKAN/build.sh#L455-L462

    # Check for Installations that have gone wrong.
    gamedata=($(find dummy_ksp/GameData/. -name GameData -exec sh -c 'if test -d "{}"; then echo "{}";fi' \;))
    if (( ${#gamedata[@]} > 0 ))
    then
      echo "GameData directory found within GameData"
      printf '%s\n' "Path: ${gamedata[@]}"
      exit 1;
    fi

In KSP-CKAN/NetKAN#7587 we discovered that MoreHabPlanets' current latest version was blocked by this check. Presumably it was fine when first indexed, then the format of the ZIP changed later. This could have been caught by the bot as soon as that release was inflated if this check was in Netkan.

Changes

Now the InstallsFilesValidator looks for multiple occurrences of GameData in a mod's files' installation paths and throws an exception if found. This will allow us to adjust metadata to fix this problem before such modules are indexed.

@HebaruSan HebaruSan added Enhancement Easy This is easy to fix Pull request Netkan Issues affecting the netkan data labels Dec 22, 2019
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional check LGTM (from my vague C# knowledge). I don't see any reason not to merge this as is.

HebaruSan added a commit that referenced this pull request Jan 6, 2020
@HebaruSan HebaruSan merged commit 9d3374f into KSP-CKAN:master Jan 6, 2020
@HebaruSan HebaruSan deleted the feature/netkan-gamedata-check branch January 6, 2020 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy This is easy to fix Enhancement Netkan Issues affecting the netkan data Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants