{"action":"created","issue":{"url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/37","repository_url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing","labels_url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/37/comments","events_url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/37/events","html_url":"https://github.com/KSP-CKAN/xKAN-meta_testing/pull/37","id":314270978,"number":37,"title":"Dynamically retrieve real game versions","user":{"login":"HebaruSan","id":1559108,"avatar_url":"https://avatars2.githubusercontent.com/u/1559108?v=4","gravatar_id":"","url":"https://api.github.com/users/HebaruSan","html_url":"https://github.com/HebaruSan","followers_url":"https://api.github.com/users/HebaruSan/followers","following_url":"https://api.github.com/users/HebaruSan/following{/other_user}","gists_url":"https://api.github.com/users/HebaruSan/gists{/gist_id}","starred_url":"https://api.github.com/users/HebaruSan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HebaruSan/subscriptions","organizations_url":"https://api.github.com/users/HebaruSan/orgs","repos_url":"https://api.github.com/users/HebaruSan/repos","events_url":"https://api.github.com/users/HebaruSan/events{/privacy}","received_events_url":"https://api.github.com/users/HebaruSan/received_events","type":"User","site_admin":false},"labels":[{"id":362322541,"url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/labels/Enhancement","name":"Enhancement","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-13T22:47:41Z","updated_at":"2018-04-23T02:16:18Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/pulls/37","html_url":"https://github.com/KSP-CKAN/xKAN-meta_testing/pull/37","diff_url":"https://github.com/KSP-CKAN/xKAN-meta_testing/pull/37.diff","patch_url":"https://github.com/KSP-CKAN/xKAN-meta_testing/pull/37.patch"},"body":"## Background\r\n\r\nWhen a pull request is submitted for NetKAN or CKAN-meta, a script runs to validate the metadata. In addition to JSON parsing, the script also:\r\n\r\n1. Creates a dummy KSP install with a specific version number\r\n2. Performs a full cmdline install of each affected mod and its dependencies to make sure they're all valid and non-conflicting\r\n\r\n## Problems\r\n\r\nThe NetKAN and CKAN-meta pull request validation scripts must be updated every time a new game version is released, in order to keep the version info up to date. Otherwise the dummy KSP install would use old version numbers, and mods for newer versions wouldn't validate correctly.\r\n\r\nRelatedly, the scripts can fail due to versioning conflicts that don't affect real users. Suppose:\r\n\r\n1. The latest version is 1.4.2\r\n2. The main mod being tested says it's compatible with game versions 1.4.0&ndash;1.4.3\r\n3. Therefore the test script will generate a dummy KSP install with version 1.4.3\r\n4. But one of the dependencies is only compatible with 1.4.2, so it's not available to the dummy install, and the dependency check fails\r\n5. However, once the pull request is merged, users will be using game version 1.4.2, and the mod will install just fine\r\n\r\nThis happened in KSP-CKAN/NetKAN#5663, as well as KSP-CKAN/NetKAN#6476.\r\n\r\n## Causes\r\n\r\nThe strategy for version selection was:\r\n\r\n1. Get an initial guess from the metadata (which might have wildly unrealistic values like 99.99.99)\r\n2. Tweak it a bit with a few hard coded rules\r\n3. Hope that whatever we end up with is valid\r\n\r\nThis approach can't help but suffer from these issues.\r\n\r\n## Changes\r\n\r\nNow we download the CKAN repo's `builds.json` file on the fly and parse it to get a list of real game versions, then compare each one to the .ckan file's constraints to determine the most recent compatible game version, and use this for the dummy KSP install. This means we no longer need to edit these scripts with every release, because newer versions will become available to them as soon as we update `builds.json`. It also means we will no longer build on \"fake\" or future versions, so dependency problems will be much more reflective of what users will encounter.\r\n\r\n## Hopes and dreams\r\n\r\nTechnically, it's still possible for the scripts to fail when they arguably shouldn't. This would happen if the latest real compatible game version is missing a dependency, but a _previous_ compatible game version has everything needed. This should be allowed because users might still be using that previous compatible game version, and future updates of the dependencies can make everything work on the current version.\r\n\r\nIt would be nice to address this by having the script attempt to install the changed mods on _all_ compatible versions, considering the test a success if any of them are successful. I decided not to attempt that for this pull request because I think it would conflict with the `set -e` command at the start of the script. Currently this causes the script to terminate when _any_ command fails, whereas this idea would require the script to continue running instead and move on to the next compatible game version."},"comment":{"url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/comments/383435608","html_url":"https://github.com/KSP-CKAN/xKAN-meta_testing/pull/37#issuecomment-383435608","issue_url":"https://api.github.com/repos/KSP-CKAN/xKAN-meta_testing/issues/37","id":383435608,"user":{"login":"techman83","id":3467784,"avatar_url":"https://avatars0.githubusercontent.com/u/3467784?v=4","gravatar_id":"","url":"https://api.github.com/users/techman83","html_url":"https://github.com/techman83","followers_url":"https://api.github.com/users/techman83/followers","following_url":"https://api.github.com/users/techman83/following{/other_user}","gists_url":"https://api.github.com/users/techman83/gists{/gist_id}","starred_url":"https://api.github.com/users/techman83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/techman83/subscriptions","organizations_url":"https://api.github.com/users/techman83/orgs","repos_url":"https://api.github.com/users/techman83/repos","events_url":"https://api.github.com/users/techman83/events{/privacy}","received_events_url":"https://api.github.com/users/techman83/received_events","type":"User","site_admin":false},"created_at":"2018-04-23T02:16:18Z","updated_at":"2018-04-23T02:16:18Z","author_association":"OWNER","body":"I like what you've done here. LGTM."}}
{"actor":{"display_login":"techman83"}}