KSP2 mods have been getting submitted to the KSP1 repo as users discover that SpaceDock's CKAN checkbox is always visible in the mod editing page (a fix for which will be rolling out in about 22 hours, see KSP-SpaceDock/SpaceDock#480). Not only is it the wrong repo, but KSP1-specific logic is being applied to the install paths, files/dependencies, etc.
Problem
283's merge lost some changes from #287 related to the pull request body and labels.
Changes
Now the lost changes from #287 are restored, so co-authors will be shown in the body again
Now the redundant "Pull request" label will no longer be added to SD pull requests
Now Game has a mod_root property that returns GameData for KSP1 and BepInEx/plugins for KSP2
The mod analyzer's game root logic had to be refactored to support multi-level paths
The adder receives the Game and passes it to the mod analyzer
Now the mod analyzer sets $vref: '#/ckan/space-warp' and adds a dependency on SpaceWarp if the ZIP contains a file named swinfo.json
The SpaceDockAdder now uses the shared logic in XkanRepo.change_branch to create and push its branch rather than duplicating that logic itself
The commit message is now generated from a template in a file to eliminate string concatenations and newlines embedded in strings
The PR title is now generated from a template
This will allow KSP2 mods to be analyzed according to their own game's logic, once SpaceDock starts using the new game-specific webhooks (again, about 22 hours from now).
Motivation
KSP2 mods have been getting submitted to the KSP1 repo as users discover that SpaceDock's CKAN checkbox is always visible in the mod editing page (a fix for which will be rolling out in about 22 hours, see KSP-SpaceDock/SpaceDock#480). Not only is it the wrong repo, but KSP1-specific logic is being applied to the install paths, files/dependencies, etc.
Problem
283's merge lost some changes from #287 related to the pull request body and labels.
Changes
Game
has amod_root
property that returnsGameData
for KSP1 andBepInEx/plugins
for KSP2Game
and passes it to the mod analyzer$vref: '#/ckan/space-warp'
and adds a dependency onSpaceWarp
if the ZIP contains a file namedswinfo.json
SpaceDockAdder
now uses the shared logic inXkanRepo.change_branch
to create and push its branch rather than duplicating that logic itselfThis will allow KSP2 mods to be analyzed according to their own game's logic, once SpaceDock starts using the new game-specific webhooks (again, about 22 hours from now).