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

Feat/plugin install #69

Open
wants to merge 108 commits into
base: main
Choose a base branch
from
Open

Feat/plugin install #69

wants to merge 108 commits into from

Conversation

onerandomusername
Copy link
Member

@onerandomusername onerandomusername commented Aug 30, 2021

depends on #74

Relevant Issues

Closes #54
Closes #62
Closes #63

Overview

Installation system for plugins. Portions of this may be used in the future for other addons, so nearly everything up to when the import is done should be in an addons.py utility file.

The currently supported type of repos are in zip format, using the following structure:

{{user}}/{{repo}}/Plugins/{{directory}}/{{files}}.py

This gives the advantage to be able to extend the addons api in the future without having to worry about the structure of the repo.

A sample repository is viewable here: onerandomusername/modmal-addons, with a clone to gitlab/onerandomusername/modmal-addons

Details

Provided a github or gitlab repo, parses it to get the specific plugin information, if it exists, from the plugin.toml file.
The plugin.toml file is supplemental to the folders, meaning that the nature of the toml file existing does not override the existing plugins.

Rather than provide a list of all of the features here, I recommend checking out the documentation for this pull request, found here: https://discord-modmail.readthedocs.io/en/feat-plugin-install/addons/

@onerandomusername onerandomusername added p: normal Normal Priority s: approved The issue has received a maintainer's approval t: feature Relating to the functionality of the application. a: addon system Involving the system for addons to utlise labels Aug 30, 2021
@onerandomusername onerandomusername added this to the Addon System milestone Aug 30, 2021
@onerandomusername onerandomusername added this to In progress in v1.0.0 via automation Aug 30, 2021
@onerandomusername onerandomusername self-assigned this Aug 30, 2021
@onerandomusername onerandomusername force-pushed the feat/plugin-install branch 3 times, most recently from 70cf1a5 to a023c07 Compare November 19, 2021 09:03
this is too involved to fix right now

Solution involves returning zip files, but the changes to do that require
commiting a zipfile, or zipping a zip file before the test.
But the contents of that zipfile should be the expected format,
so there needs to be several mock files for that.
But then they should be in a test resources directory
But then the test resources directory should have a few helper methods
But then the test resources will need a large amount of review.

So the short is, there is a fix for these tests, but it adds a subsystem
and is out of scope of this pr.
@onerandomusername onerandomusername force-pushed the feat/plugin-install branch 6 times, most recently from 6a79437 to 1ebbed3 Compare November 19, 2021 14:11
@onerandomusername
Copy link
Member Author

Linting workflows are going to fail until this is merged with main again due to how github merges then and a dependency mismatch. Given that there's so many merge commits already, I'm holding off on a merge until later.

This reverts commit 1c88421.

Not part of the scope of this pr. Also should not have been here
but a rebase would change more history than I want to change.
@@ -0,0 +1,29 @@
# NOTICE: This file is automatically generated by scripts/export_requirements.py
Copy link
Member Author

Choose a reason for hiding this comment

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

This file may not be needed. Currently discussing internally.

- don't require future annotations in modmail/addons/converters.py

- make all `__all__` tuples

- set score cutoff to a constant in modmail/addons/models.py

- compress if statements

- use {} in place of dict()

- fix typos in some docstrings

- use correct typehints where they are incorrect

- decode the stderr stream only once in pip install

- remove unnecessary logging debug statements

- restructure finding plugins to be easy to be easier to read

- use set() where previously it was {}.
This would cause the variable to be of the wrong type
@coveralls
Copy link
Collaborator

coveralls commented Apr 21, 2022

Coverage Status

Coverage decreased (-2.2%) to 70.798% when pulling bfba8e2 on feat/plugin-install into df5dbb9 on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: addon system Involving the system for addons to utlise p: normal Normal Priority s: WIP Waiting for author to address a review or respond to a comment t: feature Relating to the functionality of the application.
Projects
v1.0.0
Review in progress
3 participants