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

Netkan: Self-Published Metadata #865

Closed
dbent opened this issue May 18, 2015 · 6 comments
Closed

Netkan: Self-Published Metadata #865

dbent opened this issue May 18, 2015 · 6 comments
Labels
Enhancement Netkan Issues affecting the netkan data Policy Issues with our policy

Comments

@dbent
Copy link
Member

dbent commented May 18, 2015

This proposal is to allow mod authors to self-publish authoritative metadata for their mods by creating recursive .netkan files. The way I envisage it working is thusly:

A .netkan file is created in the NetKAN metadata repository as follows:

{
    "spec_version": 1,
    "$kref": "#/ckan/http/https://www.example.com/AwesomeMod.netkan"
}

This .netkan is actually recursive, it simply references another .netkan file, except this one is published by the mod author.

I've chosen to overload the HTTP $kref here, and indicate the recursive mode by having the URL end with .netkan as a matter of convention. If you want to be more explicit, a new $kref scheme could be used:

{
    "spec_version": 1,
    "$kref": "#/ckan/netkan/https://www.example.com/netkan?mod=AwesomeMod"
}

In either case, the NetKAN bot would download the .netkan periodically and use it exactly as if it were in the NetKAN metadata repository. Within their own .netkan file, Mod authors could choose to specify a Kerbal Stuff $kref or a GitHub $kref, or just use all explicit data.

For added flexibility the original .netkan (henceforth referred to as the "MetaNetKAN"), could append/override data in the Mod-authored .netkan. So for instance, if a mod author adds a ksp_version_min but fails to add a ksp_version_max, and subsequent updates cause the mod to break, a CKAN team member could change the MetaNetKAN to be:

{
    "spec_version": 1,
    "$kref": "#/ckan/netkan/https://www.example.com/netkan?mod=AwesomeMod",
    "ksp_version_max": "x.y.z"
}

And all is well.

The main benefits I see this having are twofold:

  1. Mod authors have more control and responsibility for their mods, which means more robust, accurate, and timely metadata. This also means mod authors can be more proactive about issues and less reliant on the CKAN team.
  2. CKAN team spends less time keeping on top of changes to upstream (a problem a lot of Linux distributions have).
@dbent
Copy link
Member Author

dbent commented May 18, 2015

As a side note, under this scheme it may be considered best practice (but not required) that the MetaNetKAN file contain a hardcoded identifier field, so a malicious mod author can't "spoof" another mod.

@birdspider
Copy link

this screams for a check on lookup-circles/loops [A->B->C->A->B...] and/or limits to the recur-depth

@dbent
Copy link
Member Author

dbent commented May 18, 2015

this screams for a check on lookup-circles/loops [A->B->C->A->B...] and/or limits to the recur-depth

I should have made it explicit, but my assumption is that the NetKAN bot would refuse to follow a MetaNetKAN more than one level (if the result of fetching from a MetaNetKAN is another MetaNetKAN, the code should bail out, set the server on fire, and walk away in slow motion).

@pjf pjf added the Policy Issues with our policy label May 22, 2015
@pjf
Copy link
Member

pjf commented May 22, 2015

I ducking love this. I'd tweak it a little so we have some way of the author providing version-ranged metadata, so they can update their .netkan file first, but not have that get picked up by the bot until the actual corresponding release that goes with it, but that's really a nice-to-have are than an essential. This is better than having mod authors embed .ckan files in their releases, since the metadata can be adjusted after a release.

The main gotchas are that if a mod author becomes unresponsive or uncooperative then we'll have an increased workload because users will keep reporting bugs to us. In that case I'd guess we'd have to resume control of the metadata, but I imagine the most users of this will be the really awesome mod authors who already send us PRs when they make new releases, so this really just saves everyone a step.

Adding this to our enhancement queue.

@pjf pjf added Netkan Issues affecting the netkan data Enhancement ★★☆ labels May 22, 2015
@pjf pjf changed the title Proposal: Self-Published Metadata Netkan: Self-Published Metadata May 22, 2015
@BasharMilesTeg
Copy link

I think this would be especially useful to @Ezriilc and possibly anyone who uses http-style .netkans as they could write a new version of their self-hosted .netkan as part of their release process. I think it might even be useful for ModuleManager-dev but that requires more thought.
In addition, using HTTP headers ('If-Modified-Since' or 'Last-Modified' maybe?) would valuable to consider, depending on server support.

@dbent
Copy link
Member Author

dbent commented Jul 16, 2015

Implemented in #1218.

@dbent dbent closed this as completed Jul 16, 2015
@pjf pjf removed the ★★☆ label Jul 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Netkan Issues affecting the netkan data Policy Issues with our policy
Projects
None yet
Development

No branches or pull requests

4 participants