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

[Feature] Provide a web hook for inflating a specific SpaceDock mod ID #8

Closed
HebaruSan opened this issue Jul 13, 2019 · 0 comments · Fixed by #48
Closed

[Feature] Provide a web hook for inflating a specific SpaceDock mod ID #8

HebaruSan opened this issue Jul 13, 2019 · 0 comments · Fixed by #48
Labels
Enhancement New feature or request

Comments

@HebaruSan
Copy link
Member

This is an outgrowth of KSP-CKAN/CKAN#2789 (comment). I assume that the initial functionality of the queue-based bot will be identical to NetKAN-bot, so ideas for further improvements should be submitted here for better tracking.

Motivation

When a mod author uploads a new release to SpaceDock for a CKAN-indexed mod, SpaceDock uses the NetKAN-bot's web hooks to inflate that module immediately. This provides quicker indexing for such modules.

For this to work, someone needs to translate from a SpaceDock mod ID to a netkan module identifier. Surprisingly, this is currently done by SpaceDock (I searched for it in vain in our web hooks for a long time)! SpaceDock has an internal web app that searches a local copy of the NetKAN repo for modules matching a given $kref, which are then passed to the actual CKAN web hook:

https://github.com/KSP-SpaceDock/SpaceDock-Notify/blob/e7c2881d01948b5fc98e06de04df59af3763a23d/app.py#L31-L47

This architecture is a bit fishy. It means that if we make certain kinds of netkan-related changes to the spec (replace $kref with something else, add an optional suffix to the format for SpaceDock $krefs, add an alternate $kref format that works differently somehow, etc.), the SpaceDock web hook could stop working, and we could not fix it without collaborating with the SpaceDock team.

Suggestion

Add a /update/spacedock/<number> web hook route that searches our own local copy of the NetKAN repo for a matching $kref and inflates it, essentially just like the above. This would better encapsulate the functionality, and it would allow SpaceDock to only worry about the ID numbers that it knows, while the CKAN team would maintain the mapping to identifiers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant