discord-modmail / discord-modmail/modmail

[Extension Metadata]: small refactor & add load attribute

Open
#54 0 comments 0 reactions 0 assignees Claimed by @onerandomusername View on GitHub
good first issue help wanted l: beginner p: normal s: approved t: enhancement t: feature
Dominant language
Python
Stars
14
Forks
8
PR merge metrics
No merged PRs in 30d

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues and there is no existing issue.

### What is the feature?

### Overview
While our extension loading system is able to handle multiple different cases, we'd like to add support to the metadata to be able to set files to not load when the bot is loaded, and load them at a later time.
We'd also like to have extensions and plugins which are walked, deemed valid, but not loaded. This allows us to have them in the system, but not have them loaded at the time.

### Implementation
The majority of the walking takes place in [modmail/utils/extensions.py](https://github.com/discord-modmail/modmail/blob/f6f3eb33ef6cf25b488af41b5efdf23838840fcc/modmail/utils/extensions.py), but a bit of it also takes place in modmail/utils/plugins.py

Both of these metadata loaders should be refactored to load metadata into a dict, in order to make easier to expand over time. Anywhere that these wailking methods are used will need to be updated to use the dict, and where `EXTENSIONS` or `PLUGINS` global variables are used.

### Would you like to implement this yourself?

No, someone else can implement it

Contributor guide

Open the contributing guide

Research direction

Start with modmail/utils/extensions.py and modmail/utils/plugins.py, then trace callers of their walking methods and uses of the EXTENSIONS and PLUGINS globals. Review the open linked pull request before making changes. Done means metadata is represented as dictionaries and supports marking extensions or plugins valid but deferred, including files that should not load at bot startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.