textpattern / textpattern-plugins-website

Textpattern CMS Plugins website.
https://plugins.textpattern.com
GNU General Public License v2.0
7 stars 1 forks source link

Idea: Textpattern plugins library repo as a bridge to the Textpattern plugins website #8

Closed jools-r closed 4 years ago

jools-r commented 4 years ago

This discussion is being brought over from here and here.

Synopsis so far (mostly based on @philwareham's overview):

Problem

A current problem is that the Textpattern plugins website uses the GitHub v4 API (GraphQL) to populate most of the content on the individual plugin page. However after trying that the following limitations surface:

  1. Obviously the plugin has to be on GitHub in the first place. Some plugin authors don't use it and I guess (although I haven't checked) they may use GitLab or Bitbucket, etc.
  2. Of the plugins that are on GitHub, a fair few don't use GitHubs tagging and release features - meaning the automated tracking of latest versions (by tag) and multiple releases is broken. We can provide workarounds for this (i.e. just link to dev release if tags missing) but it's not elegant or satisfying.
  3. We would be at the mercy of the GitHub API stability and their content-breaking API updates (as I mentioned above). If the API is down or breaks, then the plugin page content disappears until fixed.

Idea

Create a repo (or repurpose https://github.com/textpattern-community/textpattern-plugin-archive) to house some JSON manifests or whatever that serve as ‘library cards’ for each plugin. Make the content of those extremely easy to edit, then read those into an interpreter or even GraphQL parser on the plugins site. To create a new plugin entry you would create a card on the repo, then create a page on the Textpattern plugin site (which you have to do anyway) and point a custom field to the resource.

This repo could be managed by the Textpattern community with a small steering group adding / accepting PRs.

Advantages

  1. We control exactly what content is in the manifest/library cards. Making it easier to edit and update as needed (we can create an issue template to ease users updating the repo). We are not at the mercy of GitHub's API (apart from having too link to a resource file for each plugin on a GitHub repo).
  2. We can add endpoints on GitLab, author's own site, or wherever the plugin is downloaded from.
  3. We can add entries in those library cards that list older plugin versions that work on older Textpattern versions (there was no way to do this in a suitable way on just the GitHub API due to limitations above).

‘Library card’ format + contents

We should be quite careful in thinking through what data is in the manifest, so we get this right first time. Of course we can add to manifests in future, but the core entries need to be well thought out. It needs to be:


Thoughts?

philwareham commented 4 years ago

@jools-r @Bloke @petecooper @bloatware I've created a JSON 'library card' repo for this here: https://github.com/textpattern/textpattern-curated-plugins-list

Actual JSON format to be decided by committee - keeping in mind we want to make this as easy and quick as possible for contributors to update the JSON cards.

philwareham commented 4 years ago

We have been doing extensive work on this model now, and it is coming along nicely. :)

JSON cards are imported from the curated plugins list repo to the server periodically (twice an hour, currently, with the option to do an immediate import if necessary), merged into the Textpattern-powered plugins site, and output as a page.

Next step is to serve a new JSON file for each plugin directly from within the Textpattern site which outputs an extended JSON file including our curated content over an above the original JSON file that was imported.

This will in turn allow Textpattern's core from 4.9 onwards to check for newer versions of a plugin, check the compatibility, and provide an auto-update upon user's request. It should hopefully also allow us to flag when a plugin has been superseded by core features.

philwareham commented 4 years ago

This concept is now built and working. A few additions to do but I think I'll close this issue.