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

Fill more info from GitHub for SpaceDock mods #3390

Merged
merged 1 commit into from Jun 12, 2021

Conversation

HebaruSan
Copy link
Member

Motivation

#3384 added the ability to set resources.bugtracker for SpaceDock mods with a source code link to a GitHub repo with the issues list enabled. This is nice, but there is more we can do.

Changes

Now if a SpaceDock mod has a source code link that points to GitHub, we do a little more with the GitHub API info:

  • resources.repository will be set to the proper URL of the repo, so the CKAN metadata will be current in case it has been moved or renamed (I think this will also remove suffixes like /releases from repo links that have them, which is probably good)
  • If the SpaceDock mod entry has no homepage, then the homepage from GitHub will be populated into resources.homepage (this will probably be very rare, people usually set the homepage on SpaceDock and rarely set it on GitHub)
  • If the repository has been archived, we emit a warning that suggests we might want to freeze the mod (see Netkan warning for archived repos, set bugtracker for GitHub #3061)

The code is restructured slightly to allow for this, since getBugtracker is not a great place to put the new code.

@HebaruSan HebaruSan added Easy This is easy to fix Pull request Netkan Issues affecting the netkan data labels May 31, 2021
@HebaruSan HebaruSan requested a review from DasSkelett May 31, 2021 16:22
@DasSkelett
Copy link
Member

* (I think this will also remove suffixes like `/releases` from repo links that have them, which is probably good)

I know of one mod, InterstellarFuelSwitch, which appends a path to the repo link on purpose, since the repo is shared with KSPIE:

It would be neat to keep this, though cleaning "dirty" links with suffixes that don't make sense, like /releases, would be handy as well, although I don't think there are that many.
Alternatively, we could explicitly keep /tree links, but that might be more complex than we want.

@HebaruSan
Copy link
Member Author

I think this is the complete list of long repositories, but not necessarily limited to those hosted on SpaceDock, shared for background purposes:

$ jq -rM '.resources.repository' */*.ckan | sort -u | egrep '^https://github.com/[^/]*/[^/]*/.+'

https://github.com/Benji-13/StructuralDisks/tree/master
https://github.com/Benji-13/StructuralDisks/tree/master/GameData/StructuralDisks
https://github.com/cmac994/KerbalWeatherProject/tree/lite
https://github.com/DennyTX/SituationModuleInfo/tree/master/SituationModuleInfo
https://github.com/dxeh/Outer-Kerbin/releases
https://github.com/Eskandare/KerbinSideRemastered/releases/tag/1.0.1
https://github.com/ferram4/Ferram-Aerospace-Research/tree/NEAR
https://github.com/FruitGooseKSP/LieInMustEnsue/tree/v1.0.1
https://github.com/FruitGooseKSP/OhReallyAnotherNamingEndeavour/tree/v1.0.0
https://github.com/FruitGooseKSP/ProgramaticExtensionAndRetraction/tree/v1.0.0
https://github.com/gordonfpanam/ExplodiumBreathingEngines/tree/v1.0.0
https://github.com/h0yer/CommunityRealAgencyPack/archive/v1.0.zip
https://github.com/h0yer/RealAgenciesCollection/archive/v1.0.4.zip
https://github.com/icedown/CactEye-2/releases
https://github.com/ihsoft/KSPDev_LogConsole/tree/master/Source
https://github.com/ihsoft/KSPDev/tree/master/Sources/LogConsole
https://github.com/JadeOfMaar/sandbox/tree/master/OPT_WBI
https://github.com/JDCollie/Data-Storage-Device/releases/tag/1.0
https://github.com/Jed-Tech/TweakScale/tree/master/GameData/TweakScale/patches/SquadExpansion
https://github.com/JonnyOThan/RasterPropMonitor/releases
https://github.com/linuxgurugamer/DraftTwitchViewers/releases
https://github.com/linuxgurugamer/KerbalTubes/releases
https://github.com/linuxgurugamer/MicroSat_0.35m_Probe_Parts/releases/tag/0.1.0
https://github.com/linuxgurugamer/QuizTechAeroPackContinued/releases/tag/1.3.0
https://github.com/LordFjord/KSP/tree/master/IntakeBuildAid
https://github.com/lu-kay/Realism-Lite/tree/master/GameData/RealismLite
https://github.com/maculator/No-more-science-grinding/tree/master
https://github.com/maculator/RoverSpeed/tree/master
https://github.com/Mark-Kerbin/Kerbal-Academy-Contract-Pack/releases
https://github.com/Monniasza/SSTO-Project/issues
https://github.com/NepalRAWR/KerbalKlinic/releases
https://github.com/NepalRAWR/NodeAlert/releases
https://github.com/net-lisias-ksp/KAX/releases
https://github.com/Outsoldier/Space-Frontier-Technologies/releases
https://github.com/PalverZ/PalverZExhaustRecycler/releases
https://github.com/rbray89/ActiveTextureManagement/asset_match/x86-Aggressive-*
https://github.com/rbray89/ActiveTextureManagement/asset_match/x86-Basic-*
https://github.com/riocrokite/InlineBallutes/releases/tag/1.2.1
https://github.com/russnash/Kaboom/releases
https://github.com/SerTheGreat/G-Effects/releases
https://github.com/SerTheGreat/NavInstruments/tree/continued
https://github.com/shadowmage45/TexturesUnlimited/releases
https://github.com/SlimJimDodger/ExceptionDetectorUpdated/releases
https://github.com/sswelm/KSP-Interstellar-Extended/tree/master/FuelSwitch
https://github.com/sswelm/KSPInterstellar/tree/master/FuelSwitch
https://github.com/WarezCrawler/Guybrush101/releases
https://github.com/whale2/InfernalRobotics/tree/master
https://github.com/WillThe84th/realistic-remodel/tree/master
https://github.com/WolfairCorp/AoA-Technologies/tree/Update
https://github.com/zer0Kerbal/DaMichel/tree/master/GameData/DaMichel/AeroRadial
https://github.com/zer0Kerbal/DaMichel/tree/master/GameData/DaMichel/CargoBays
https://github.com/zer0Kerbal/DaMichel/tree/master/GameData/DaMichel/Fuselage
https://github.com/zer0Kerbal/DaMichel/tree/master/GameData/DaMichel/SphericalTanks
https://github.com/zer0Kerbal//DockingPortDescriptions
https://github.com/zer0Kerbal/Jack-O-Lantern/releases/tag/1.0.0.1
https://github.com/zer0Kerbal/KGEx/tree/master/GameData/KGEx//DockingPortDescriptions
https://github.com/zer0Kerbal/KGEx/tree/master/GameData/KGEx/MM-Patches/ShieldedPicoPort
https://github.com/zer0Kerbal/KGEx/tree/master/GameData/KGEx/MoreHitchhikers
https://github.com/zer0Kerbal/ODFCr/releases
https://github.com/zer0Kerbal/Pteron/releases/latest

@HebaruSan
Copy link
Member Author

* (I think this will also remove suffixes like `/releases` from repo links that have them, which is probably good)

I know of one mod, InterstellarFuelSwitch, which appends a path to the repo link on purpose, since the repo is shared with KSPIE:

It would be neat to keep this, though cleaning "dirty" links with suffixes that don't make sense, like /releases, would be handy as well, although I don't think there are that many.

OK, I looked at the list, and this seemed like the only example of a meritorious use of this behavior, so I moved it to the .netkan so it won't be overwritten by the true repo link if this PR is merged.

@DasSkelett
Copy link
Member

OK, I looked at the list, and this seemed like the only example of a meritorious use of this behavior, so I moved it to the .netkan so it won't be overwritten by the true repo link if this PR is merged.

Hm, what about these?

They also look like they match this scheme.

@HebaruSan
Copy link
Member Author

Good point, added those to the netkans as well.

Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

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

Looks good. We just need to remember to check the exact repo link on SpaceDock for new netkans and hardcode it if it points to a valid, sensible subdirectory.

@DasSkelett DasSkelett merged commit da3ee06 into KSP-CKAN:master Jun 12, 2021
@HebaruSan HebaruSan deleted the feature/more-sd-from-gh branch September 12, 2021 21:38
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 Netkan Issues affecting the netkan data Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants