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

Automate adding plugins to the channel #82

Closed
wants to merge 5 commits into from

Conversation

gamemaker1
Copy link

Hi @zyedidia,

Thanks a ton for creating and maintaining Micro - it is an amazing project, and I use the editor for everything to do with, well... editing :D

I noticed that there are a lot of PRs for adding a plugin piling up - and I decided to help out by attempting to automate the process:

What this PR does

This PR makes the process of adding plugins to the channel automatic. It runs a script every 24 hours (via GitHub actions) that:

  1. uses the Github search API to search for repositories with the micro-editor-plugin tag.
  2. for each repo retrieved, it searches for a repo.json file in the root of the repository.
  3. if found, it parses the repo.json file.
  4. it then adds the plugin to the table in the plugins.md file.
  5. it also adds the URL to the repo.json file to the channel.json file.

Caveats

A couple of issues:

1. Github-API dependent

This script only queries the GitHub API. So projects on Gitlab, Gitea, etc. cannot be added.

2. Cannot add plugins manually

This script overrides the current channel.json file every time it runs. This is so that we do not need to worry about repo/plugin renames, deletions and modifications to metadata. The downside is that if the repo owner does not add the micro-editor-plugin tag, the plugin will not be listed. Also, if the repo is not on GitHub, the plugin will not be listed.


I am working on a solution for the second caveat - so we can add plugins even if they are not on GitHub, or if the owner cannot add the micro-editor-plugin tag.

@zyedidia
Copy link
Member

zyedidia commented Dec 26, 2021

This is interesting. However, I worry about security issues if we add any plugin to the repo. We don't want any malicious plugins, and it is hard/impossible to automatically determine if a plugin is malicious. Perhaps this could be used as a tool for users to discover plugins on GitHub, although perhaps we should just recommend that plugin authors use the micro-editor-plugin github tag for discoverability.

At the moment I think the plugin channel serves two uses:

  • Easy installation of plugins. However, it is still possible to manually install plugins that are not in the channel, or create your own channel.
  • Find a list of available plugins.

This approach might be useful for automating the second usecase, and then users themselves determine if they want to manually install plugins from github. Perhaps there could be a tool/command integrated into micro (or separately) that searches github for plugins with a repo.json and a micro-editor-plugin tag. It could additionally search according to some keywords that the user gives, and return results with some sort of ranking (stars/downloads/commits, something like that).

@gamemaker1
Copy link
Author

We don't want any malicious plugins, and it is hard/impossible to automatically determine if a plugin is malicious

Good point.

Perhaps there could be a tool/command integrated into micro (or separately) that searches github for plugins with a repo.json and a micro-editor-plugin tag. It could additionally search according to some keywords that the user gives, and return results with some sort of ranking (stars/downloads/commits, something like that).

I really like this idea - making something like a 'search engine' for micro plugins. Maybe I could give that a try.


Thanks again for your amazing work on Micro!

@gamemaker1 gamemaker1 closed this Dec 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants